Skip to content

Commit 66fbdf3

Browse files
committed
Hardcoded Android Versions
1 parent bc1ad80 commit 66fbdf3

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

Sources/OsBuildVersion.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public extension AndroidBuild.Version {
1919
public typealias Sdk = AndroidBuildSdk
2020
}
2121

22-
public struct AndroidBuildSdk: RawRepresentable {
22+
public struct AndroidBuildSdk: RawRepresentable, Equatable {
2323

2424
public let rawValue: Int
2525

@@ -35,7 +35,7 @@ public struct AndroidBuildSdk: RawRepresentable {
3535
public static let previewSdkInt = Android.OS.Build.Version.Sdk(rawValue: AndroidBuildVersionConstants.PREVIEW_SDK_INT)
3636
}
3737

38-
public struct AndroidBuildVersion: RawRepresentable {
38+
public struct AndroidBuildVersion: RawRepresentable, Equatable {
3939

4040
public let rawValue: String
4141

Sources/OsBuildVersionCodes.swift

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public extension AndroidBuild {
1414
public typealias VersionCodes = AndroidBuildVersionCodes
1515
}
1616

17-
public struct AndroidBuildVersionCodes: RawRepresentable {
17+
public struct AndroidBuildVersionCodes: RawRepresentable, Equatable {
1818

1919
public let rawValue: Int
2020

@@ -23,91 +23,91 @@ public struct AndroidBuildVersionCodes: RawRepresentable {
2323
}
2424

2525
/// October 2008: The original, first, version of Android. Yay!
26-
public static let base = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.BASE)
26+
public static let base = 1
2727

2828
/// February 2009: First Android update, officially called 1.1.
29-
public static let base11 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.BASE_1_1)
29+
public static let base11 = 2
3030

3131
/// May 2009: Android 1.5.
32-
public static let cupcake = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.CUPCAKE)
32+
public static let cupcake = 3
3333

3434
/// Magic version number for a current development build, which has not yet turned into an official release.
35-
public static let CurDevelopment = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.CUR_DEVELOPMENT)
35+
public static let CurDevelopment = 10000
3636

3737
/// September 2009: Android 1.6.
38-
public static let donut = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.DONUT)
38+
public static let donut = 4
3939

4040
/// November 2009: Android 2.0
41-
public static let eclair = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.ECLAIR)
41+
public static let eclair = 5
4242

4343
/// December 2009: Android 2.0.1
44-
public static let eclair01 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.ECLAIR_0_1)
44+
public static let eclair01 = 6
4545

4646
/// January 2010: Android 2.1
47-
public static let eclairMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.ECLAIR_MR1)
47+
public static let eclairMr1 = 7
4848

4949
/// June 2010: Android 2.2
50-
public static let froyo = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.FROYO)
50+
public static let froyo = 8
5151

5252
/// November 2010: Android 2.3
53-
public static let gingerbread = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.GINGERBREAD)
53+
public static let gingerbread = 9
5454

5555
/// February 2011: Android 2.3.3.
56-
public static let gingerbreadMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.GINGERBREAD_MR1)
56+
public static let gingerbreadMr1 = 10
5757

5858
/// February 2011: Android 3.0.
59-
public static let honeycomb = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.HONEYCOMB)
59+
public static let honeycomb = 11
6060

6161
/// May 2011: Android 3.1.
62-
public static let honeycombMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.HONEYCOMB_MR1)
62+
public static let honeycombMr1 = 12
6363

6464
/// June 2011: Android 3.2.
65-
public static let honeycombMr2 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.HONEYCOMB_MR2)
65+
public static let honeycombMr2 = 13
6666

6767
/// October 2011: Android 4.0.
68-
public static let iceCreamSandwich = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.ICE_CREAM_SANDWICH)
68+
public static let iceCreamSandwich = 14
6969

7070
/// December 2011: Android 4.0.3.
71-
public static let iceCreamSandwichMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.ICE_CREAM_SANDWICH_MR1)
71+
public static let iceCreamSandwichMr1 = 15
7272

7373
/// June 2012: Android 4.1.
74-
public static let jellyBean = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.JELLY_BEAN)
74+
public static let jellyBean = 16
7575

7676
/// November 2012: Android 4.2, Moar jelly beans!
77-
public static let jellyBeanMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.JELLY_BEAN_MR1)
77+
public static let jellyBeanMr1 = 17
7878

7979
/// July 2013: Android 4.3, the revenge of the beans.
80-
public static let jellyBeanMr2 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.JELLY_BEAN_MR2)
80+
public static let jellyBeanMr2 = 18
8181

8282
/// October 2013: Android 4.4, KitKat, another tasty treat.
83-
public static let kitkat = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.KITKAT)
83+
public static let kitkat = 19
8484

8585
/// June 2014: Android 4.4W. KitKat for watches, snacks on the run.
86-
public static let kitkatWatch = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.KITKAT_WATCH)
86+
public static let kitkatWatch = 20
8787

8888
/// November 2014: Lollipop. A flat one with beautiful shadows. But still tasty.
89-
public static let lollipop = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.LOLLIPOP)
89+
public static let lollipop = 21
9090

9191
/// March 2015: Lollipop with an extra sugar coating on the outside!
92-
public static let lollipopMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.LOLLIPOP_MR1)
92+
public static let lollipopMr1 = 22
9393

9494
/// M is for Marshmallow!
95-
public static let m = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.M)
95+
public static let M = 23
9696

9797
/// N is for Nougat.
98-
public static let n = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.N)
98+
public static let N = 24
9999

100100
/// N MR1: Nougat++.
101-
public static let nMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.N_MR1)
101+
public static let nMr1 = 25
102102

103103
/// O.
104-
public static let o = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.O)
104+
public static let O = 26
105105

106106
/// O MR1.
107-
public static let oMr1 = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.O_MR1)
107+
public static let O_Mr1 = 27
108108

109109
/// P.
110-
public static let p = Android.OS.Build.VersionCodes(rawValue: AndroidBuildVersionCodesConstants.P)
110+
public static let P = 28
111111
}
112112

113113
fileprivate class AndroidBuildVersionCodesConstants: JavaObject {

0 commit comments

Comments
 (0)