Commit 6cd854c
[ci] Preliminary JDK11 Support (#4567)
Context: https://issuetracker.google.com/issues/150189789
Context: https://developer.android.com/preview/features#signature-scheme-v4
Context: https://developer.android.com/preview/features#incremental
Preliminary JDK 11 support.
The Android SDK Build-tools r30.0.0-rc4 package currently requires
JDK 11 in order to use `apksigner.jar`:
Task "AndroidApkSigner"
Task Parameter:ApkSignerJar=C:\Users\dlab14\android-toolchain\sdk\build-tools\30.0.0-rc4\lib\apksigner.jar
…
Task Parameter:ToolPath=C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25\bin
Task Parameter:ManifestFile=obj\Release\android\AndroidManifest.xml
C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25\bin\java.exe -jar C:\Users\dlab14\android-toolchain\sdk\build-tools\30.0.0-rc4\lib\apksigner.jar sign --ks "C:\Users\dlab14\AppData\Local\Xamarin\Mono for Android\debug.keystore" --ks-pass pass:android --ks-key-alias androiddebugkey --key-pass pass:android --min-sdk-version 21 --max-sdk-version 29 "C:\A\vs2019xam00000Y-1\_work\1\s\bin\TestRelease\temp\BuildAotApplication AndÜmläüts_x86_64_True_True\bin\Release\UnnamedProject.UnnamedProject-Signed.apk"
java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
…
…\Xamarin.Android.Common.targets(2559,2): error MSB6006: "java.exe" exited with code 1.
This could be triggered by using the Android SDK Manager to install
Build-tools r30.0.0-rc4, then overriding the
`$(AndroidSdkBuildToolsVersion)` MSBuild property in `App.csproj`:
<PropertyGroup>
<AndroidSdkBuildToolsVersion>30.0.0-rc4</AndroidSdkBuildToolsVersion>
</PropertyGroup>
Many previous commits have added support for JDK 11, e.g. d99facb,
dcee2c8, 4742d50, 89f3dc1, and 895b7bc (among many others).
Additionally, c8ab455 updated the build environment so that *both*
JetBrains OpenJDK 1.8 and 11 were installed, though 1.8 was still used.
Now it's time to "flip the build environment," and use JDK 11 to build
the product, installers, and run (most) unit tests:
* Update `azure-pipelines.yaml` and `azure-pipelines-oss.yaml` so
that JDK 11 is used to build everything.
* Update `xaprepare` so that when `$(JavaSdkDirectory)` isn't
overridden, JDK 11 is used by default.
* Override the `JI_JAVA_HOME` environment variable when preparing
`external/Java.Interop` so that it uses the desired JDK.
* Update the default `$(LatestSupportedJavaVersion)` value to
11.0.4, the version of the JDK we install.
* Update the `<ValidateJavaVersions/>` task so that JDK 11 is
required when `$(AndroidSdkBuildToolsVersion)` is >= r30.
This will cause an XA0032 error if JDK 1.8 is used to build a
project when `$(AndroidSdkBuildToolsVersion)` is >= r30.
* `apksigner` from Build-tools r30 creates a new `.idsig` file
next to the `.apk`. This is to enable a new
`adb install --incremental` feature. Add the `.idsig` file
to `@(FileWrites)`.
* Update various unit test `.csproj` files to consistently
`<Import/>` the `Configuration.props` file and use properties
within it for default values. This in particular allowed building
e.g. `samples/HelloWorld` to implicitly use JDK 11.
* Increase "expected" times in
`tests/msbuild-times-reference/MSBuildDeviceIntegration.csv`
as JDK 11 appears to be slower than JDK 1.8 (🙁).
* *Disable* support for `@(JavaSourceJar)` when JDK 11 is used.
JDK 11 changes the HTML generated by the `javadoc` command, and
we need to update our HTML parser to handle it. In the interest
of expediency, disable this for now.
The Android Designer integration tests continue to use JDK 1.8,
as the Designer doesn't currently build under JDK 11.
TODO:
* Fix `@(JavaSourceJar)` support:
#4789
* Allow Android Designer to work with JDK 11, run Designer
integration tests using JDK 11.
* Figure out how to not accidentally bitrot JDK 1.8 support.
Co-authored-by: Jonathan Pryor <jonpryor@vt.edu>
Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Co-authored-by: Jonathan Pobst <jonathan.pobst@microsoft.com>
Co-authored-by: Peter Collins <pecolli@microsoft.com>1 parent 4175950 commit 6cd854c
File tree
25 files changed
+219
-62
lines changed- Documentation/release-notes
- build-tools
- automation
- yaml-templates
- xaprepare/xaprepare
- ConfigAndData
- Steps
- samples/HelloWorld
- HelloLibrary
- src/Xamarin.Android.Build.Tasks
- Microsoft.Android.Sdk/targets
- Tasks/Legacy
- Tests/Xamarin.Android.Build.Tests
- Tasks
- tests
- BCL-Tests
- LocalTests.NUnit
- Xamarin.Android.Bcl-Tests
- CodeBehind
- BuildTests
- CommonSampleLibrary
- CodeGen-Binding/Xamarin.Android.JcwGen-Tests
- EmbeddedDSOs/EmbeddedDSO
- TestRunner.xUnit
- locales/Xamarin.Android.Locale-Tests
- msbuild-times-reference
25 files changed
+219
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
101 | | - | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
| |||
900 | 905 | | |
901 | 906 | | |
902 | 907 | | |
903 | | - | |
| 908 | + | |
904 | 909 | | |
905 | 910 | | |
906 | 911 | | |
| |||
909 | 914 | | |
910 | 915 | | |
911 | 916 | | |
912 | | - | |
| 917 | + | |
913 | 918 | | |
914 | 919 | | |
915 | | - | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
916 | 929 | | |
917 | 930 | | |
| 931 | + | |
| 932 | + | |
918 | 933 | | |
919 | 934 | | |
| 935 | + | |
| 936 | + | |
920 | 937 | | |
921 | 938 | | |
922 | 939 | | |
923 | 940 | | |
924 | | - | |
| 941 | + | |
925 | 942 | | |
926 | 943 | | |
927 | 944 | | |
| |||
964 | 981 | | |
965 | 982 | | |
966 | 983 | | |
967 | | - | |
| 984 | + | |
968 | 985 | | |
969 | 986 | | |
970 | 987 | | |
| |||
973 | 990 | | |
974 | 991 | | |
975 | 992 | | |
976 | | - | |
| 993 | + | |
977 | 994 | | |
978 | 995 | | |
979 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
980 | 1008 | | |
981 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
982 | 1012 | | |
983 | 1013 | | |
| 1014 | + | |
| 1015 | + | |
984 | 1016 | | |
985 | 1017 | | |
986 | 1018 | | |
987 | 1019 | | |
988 | | - | |
| 1020 | + | |
989 | 1021 | | |
990 | 1022 | | |
991 | 1023 | | |
| |||
Lines changed: 20 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
19 | 29 | | |
20 | 30 | | |
21 | 31 | | |
| |||
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
38 | | - | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
50 | | - | |
51 | | - | |
| 60 | + | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
| |||
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
64 | | - | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
69 | 79 | | |
70 | | - | |
| 80 | + | |
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
74 | 84 | | |
75 | | - | |
| 85 | + | |
76 | 86 | | |
77 | | - | |
| 87 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
61 | 74 | | |
62 | | - | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
| 78 | + | |
| 79 | + | |
65 | 80 | | |
66 | 81 | | |
67 | 82 | | |
| |||
0 commit comments