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] Support JDK-21 #9672

Merged
merged 2 commits into from
Jan 13, 2025
Merged

[build] Support JDK-21 #9672

merged 2 commits into from
Jan 13, 2025

Conversation

jonpryor
Copy link
Member

Context: #9651

PR #9651 demonstrated that it was fairly straightforward to use JDK-21 on CI. We don't want to fully bump to JDK-21, because we still support building with JDK-17, so we at minimum need to run tests on both JDK-17 and JDK-21.

As a "minimal introductory step", add support for JDK-21:

  • Update to Gradle 8.12, for harmony with dotnet/java-interop.

  • Update the <Javac/> task to use javac --release N when using JDK-17 and later. JDK-11 doesn't support javac --release. (Why care about JDK-11? Because .NET 8 still supports it, and this will make future cherry-picking easier.)

  • Set $(LatestSupportedJavaVersion)=21.0.99, which removes the XA0030 error which would result from using JDK-21.

  • Update tools/workload-dependencies to use $(LatestSupportedJavaVersion) property, instead of always using $(JavaSdkVersion)+1.

Context: #9651

PR #9651 demonstrated that it was fairly straightforward to use
JDK-21 on CI.  We don't want to fully bump to JDK-21, because we
still support building with JDK-17, so we *at minimum* need to run
tests on both JDK-17 and JDK-21.

As a "minimal introductory step", add support for JDK-21:

  * Update to Gradle 8.12, for harmony with dotnet/java-interop.

  * Update the `<Javac/>` task to use `javac --release N` when using
    JDK-17 and later.  JDK-11 doesn't support `javac --release`.
    (Why care about JDK-11?  Because .NET 8 still supports it, and
    this will make future cherry-picking easier.)

  * Set `$(LatestSupportedJavaVersion)`=21.0.99, which removes the
    XA0030 error which would result from using JDK-21.

  * Update `tools/workload-dependencies` to use
    `$(LatestSupportedJavaVersion)` property, instead of always using
    `$(JavaSdkVersion)+1`.

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • build-tools/gradle/gradle/wrapper/gradle-wrapper.properties: Language not supported
  • src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.props.in: Language not supported
  • tools/workload-dependencies/WorkloadDependencies.proj: Language not supported
@jonathanpeppers
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonpryor
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonpryor
Copy link
Member Author

MAUI Integration tests are expected to fail at present; see 37014d1.

@dellis1972 dellis1972 merged commit 14a6bfb into main Jan 13, 2025
59 of 61 checks passed
@dellis1972 dellis1972 deleted the dev/jonp/jonp-support-jdk-21 branch January 13, 2025 15:41
grendello added a commit that referenced this pull request Jan 14, 2025
* main:
  [ci] Add template for setting JAVA_HOME vars (#9671)
  Bump com.android.tools.build:manifest-merger from 31.7.3 to 31.8.0 (#9678)
  Bump to dotnet/sdk@2dd591056f 10.0.100-alpha.1.25062.16 (#9679)
  Bump com.android.tools:r8 from 8.5.35 to 8.7.18 (#9677)
  Bump to dotnet/java-interop@4f06201 (#9676)
  Bump to dotnet/android-api-docs@492e524d (#9668)
  [build] Support JDK-21 (#9672)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants