Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Use Microsoft OpenJDK 17.0.8 #8309

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

jonpryor
Copy link
Member

Context: #8304
Context: #8029
Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17

Starting from Android Studio Flamingo Canary 3, the Studio IDE is
bundled with JDK 17.

Context: dotnet/java-interop#1141

Does It Build™?

Because of #8029 we know we can use JDK 17.

Because of #8304 we know we should use JDK 17.

Update xaprepare so that Microsoft OpenJDK 17.0.8 is provisioned for the build. Note: $(_JavacSourceVersion) and $(_JavacTargetVersion) are not changed, so that our built .jar tooling can still run on JDK-11.

Update to use Gradle 8.1.1. This is needed for JDK-17 support.

Update $(LatestSupportedJavaVersion) to 17.0.99 so that JDK 17 can be used by .NET Android projects by default.

@jonpryor
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Aug 30, 2023
Context: dotnet#8309
Context: https://learn.microsoft.com/java/openjdk/download#openjdk-17

Classic Xamarin.Android apps appear to work with JDK-17, just by doing:

    msbuild -r -bl -t:SignAndroidPackage -p:JavaSdkDirectory="C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot" -p:LatestSupportedJavaVersion=17.99

I see log messages calling a JDK 17 `javac` like:

    _CompileJava:
    C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\jopepper\AppData\Local\Temp\tmp119C.tmp" -target 1.8 -source 1.8

Update `$(LatestSupportedJavaVersion)` to allow usage of JDK 17.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Aug 31, 2023
Context: dotnet#8309
Context: https://learn.microsoft.com/java/openjdk/download#openjdk-17

Classic Xamarin.Android apps appear to work with JDK-17, just by doing:

    msbuild -r -bl -t:SignAndroidPackage -p:JavaSdkDirectory="C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot" -p:LatestSupportedJavaVersion=17.99

I see log messages calling a JDK 17 `javac` like:

    _CompileJava:
    C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\jopepper\AppData\Local\Temp\tmp119C.tmp" -target 1.8 -source 1.8

Update `$(LatestSupportedJavaVersion)` to allow usage of JDK 17.
jonpryor pushed a commit that referenced this pull request Aug 31, 2023
Context: #8309
Context: https://learn.microsoft.com/java/openjdk/download#openjdk-17

Classic Xamarin.Android apps appear to work with JDK-17, just by doing:

	msbuild -r -bl -t:SignAndroidPackage ^
	  -p:JavaSdkDirectory="C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot" ^
	  -p:LatestSupportedJavaVersion=17.99

I see log messages calling a JDK 17 `javac` like:

	_CompileJava:
	C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\jopepper\AppData\Local\Temp\tmp119C.tmp" -target 1.8 -source 1.8

Update `$(LatestSupportedJavaVersion)` to allow usage of JDK 17.
jonathanpeppers added a commit that referenced this pull request Sep 1, 2023
Context: #8309
Context: https://learn.microsoft.com/java/openjdk/download#openjdk-17

Classic Xamarin.Android apps appear to work with JDK-17, just by doing:

	msbuild -r -bl -t:SignAndroidPackage ^
	  -p:JavaSdkDirectory="C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot" ^
	  -p:LatestSupportedJavaVersion=17.99

I see log messages calling a JDK 17 `javac` like:

	_CompileJava:
	C:\Program Files\Microsoft\jdk-17.0.8.101-hotspot\bin\javac.exe -J-Dfile.encoding=UTF8 "@C:\Users\jopepper\AppData\Local\Temp\tmp119C.tmp" -target 1.8 -source 1.8

Update `$(LatestSupportedJavaVersion)` to allow usage of JDK 17.
@jonpryor jonpryor marked this pull request as ready for review September 1, 2023 17:36
.gitmodules Outdated Show resolved Hide resolved
compile group: 'com.android.tools.build', name: 'manifest-merger', version: '30.3.1'
implementation 'com.android.tools.build:manifest-merger:30.3.1'
Copy link
Member

@jonathanpeppers jonathanpeppers Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right, like what Gradle (Short) shows here:

https://mvnrepository.com/artifact/com.android.tools.build/manifest-merger/30.3.1

Changes: dotnet/java-interop@5adb4d4...5bb0d24

  * dotnet/java-interop@5bb0d24b: [build] Add support for JDK 17 (dotnet/java-interop#1141)
  * dotnet/java-interop@7e3bd2f2: Revert "[build] Enable NuGet's Central Package Management (dotnet/java-interop#1114)" (dotnet/java-interop#1138)
  * dotnet/java-interop@7961b360: [build] set `$(DisableTransitiveFrameworkReferenceDownloads)`=true (dotnet/java-interop#1137)

Context: dotnet#8304
Context: dotnet#8029
Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17

> Starting from Android Studio Flamingo Canary 3, the Studio IDE is
> bundled with JDK 17.

Because of dotnet#8029 we know we *can* use JDK 17.

Because of dotnet#8304 we know we *should* use JDK 17.

Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned
for the build.  Note: `$(_JavacSourceVersion)` and
`$(_JavacTargetVersion)` are *not* changed, so that our built
`.jar` tooling can still *run* on JDK-11.

Update to use Gradle 8.1.1.  This is needed for JDK-17 support.

Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can
be used by .NET Android projects by default.
@jonpryor jonpryor merged commit 298da11 into dotnet:main Sep 2, 2023
45 of 47 checks passed
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 4, 2023
* main: (57 commits)
  Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317)
  [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309)
  [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310)
  Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305)
  [xaprepare] Improve dotnet-install script logging (dotnet#8312)
  [xaprepare] Fix dotnet-install script size check (dotnet#8311)
  [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307)
  [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293)
  Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291)
  [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289)
  [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185)
  [tests] Skip sign check when installing MAUI (dotnet#8288)
  Bump to xamarin/monodroid@057b17fe (dotnet#8286)
  [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172)
  Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281)
  Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276)
  [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern  (dotnet#8261)
  $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278)
  Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241)
  [build] set file extension for common `ToolExe` values (dotnet#8267)
  ...
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 4, 2023
* main: (102 commits)
  Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317)
  [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309)
  [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310)
  Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305)
  [xaprepare] Improve dotnet-install script logging (dotnet#8312)
  [xaprepare] Fix dotnet-install script size check (dotnet#8311)
  [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307)
  [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293)
  Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291)
  [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289)
  [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185)
  [tests] Skip sign check when installing MAUI (dotnet#8288)
  Bump to xamarin/monodroid@057b17fe (dotnet#8286)
  [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172)
  Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281)
  Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276)
  [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern  (dotnet#8261)
  $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278)
  Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241)
  [build] set file extension for common `ToolExe` values (dotnet#8267)
  ...
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 4, 2023
* main: (68 commits)
  Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317)
  [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309)
  [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310)
  Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305)
  [xaprepare] Improve dotnet-install script logging (dotnet#8312)
  [xaprepare] Fix dotnet-install script size check (dotnet#8311)
  [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307)
  [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293)
  Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291)
  [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289)
  [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185)
  [tests] Skip sign check when installing MAUI (dotnet#8288)
  Bump to xamarin/monodroid@057b17fe (dotnet#8286)
  [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172)
  Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281)
  Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276)
  [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern  (dotnet#8261)
  $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278)
  Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241)
  [build] set file extension for common `ToolExe` values (dotnet#8267)
  ...
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 4, 2023
* main: (53 commits)
  Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317)
  [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309)
  [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310)
  Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305)
  [xaprepare] Improve dotnet-install script logging (dotnet#8312)
  [xaprepare] Fix dotnet-install script size check (dotnet#8311)
  [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307)
  [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293)
  Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291)
  [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289)
  [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185)
  [tests] Skip sign check when installing MAUI (dotnet#8288)
  Bump to xamarin/monodroid@057b17fe (dotnet#8286)
  [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172)
  Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281)
  Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276)
  [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern  (dotnet#8261)
  $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278)
  Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241)
  [build] set file extension for common `ToolExe` values (dotnet#8267)
  ...
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 4, 2023
* main: (25 commits)
  Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317)
  [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309)
  [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310)
  Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305)
  [xaprepare] Improve dotnet-install script logging (dotnet#8312)
  [xaprepare] Fix dotnet-install script size check (dotnet#8311)
  [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307)
  [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293)
  Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291)
  [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289)
  [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185)
  [tests] Skip sign check when installing MAUI (dotnet#8288)
  Bump to xamarin/monodroid@057b17fe (dotnet#8286)
  [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172)
  Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281)
  Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276)
  [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern  (dotnet#8261)
  $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278)
  Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241)
  [build] set file extension for common `ToolExe` values (dotnet#8267)
  ...
grendello added a commit to grendello/xamarin-android that referenced this pull request Sep 4, 2023
* main: (38 commits)
  Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317)
  [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309)
  [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310)
  Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305)
  [xaprepare] Improve dotnet-install script logging (dotnet#8312)
  [xaprepare] Fix dotnet-install script size check (dotnet#8311)
  [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307)
  [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293)
  Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291)
  [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289)
  [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185)
  [tests] Skip sign check when installing MAUI (dotnet#8288)
  Bump to xamarin/monodroid@057b17fe (dotnet#8286)
  [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172)
  Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281)
  Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276)
  [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern  (dotnet#8261)
  $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278)
  Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241)
  [build] set file extension for common `ToolExe` values (dotnet#8267)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants