Move OpenJDK installation from xaprepare to MSBuild NoTargets project#11348
Draft
jonathanpeppers wants to merge 2 commits into
Draft
Move OpenJDK installation from xaprepare to MSBuild NoTargets project#11348jonathanpeppers wants to merge 2 commits into
jonathanpeppers wants to merge 2 commits into
Conversation
Migrate the JDK download/install from the xaprepare bootstrapper (Step_InstallAdoptOpenJDK) to a new src/openjdk MSBuild NoTargets project, modeled after src/binutils. The new project: - Downloads the Microsoft OpenJDK archive (platform-specific) - Downloads and verifies hash of all downloads - Extracts and installs to $(AndroidToolchainDirectory)/jdk-21 - Supports incremental builds via MSBuild Inputs/Outputs - Validates root directory and key JDK files after install - Handles Windows (.zip via Unzip task) and Linux/macOS (.tar.gz via tar) - Handles macOS Contents/Home subdirectory structure Projects that depend on the JDK now have a ProjectReference to src/openjdk, ensuring correct build ordering: - src/manifestmerger (gradle + JAVA_HOME) - src/r8 (gradle + JAVA_HOME) - src/proguard-android (gradle + JAVA_HOME) - src/bundletool (uses jar to extract/repack) - src/java-runtime (uses javac, jar, java) Also removes all JI_JAVA_HOME usage, which was a redundant alias for JAVA_HOME set in CI pipelines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ts project Create a new src/androidsdk MSBuild NoTargets project that runs sdkmanager --licenses with JAVA_HOME set correctly. This project depends on src/openjdk via ProjectReference, ensuring the JDK is installed before sdkmanager runs. The gradle/JDK-dependent projects now reference androidsdk instead of openjdk directly, since androidsdk transitively depends on openjdk. Remove the AcceptLicenses method from xaprepare Step_Android_SDK_NDK, which was failing in CI because it ran before the JDK was installed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0381336 to
e1571c5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the JDK download/install from the xaprepare bootstrapper (
Step_InstallAdoptOpenJDK) to a newsrc/openjdkMSBuild NoTargets project, modeled aftersrc/binutils.New
src/openjdkproject$(AndroidToolchainDirectory)/jdk-21Inputs/Outputs.zipviaUnziptask) and Linux/macOS (.tar.gzviatar)Contents/Homesubdirectory structureProjectReferences
Projects that depend on the JDK now have a
ProjectReferencetosrc/openjdk, ensuring correct build ordering:src/manifestmerger(gradle + JAVA_HOME)src/r8(gradle + JAVA_HOME)src/proguard-android(gradle + JAVA_HOME)src/bundletool(uses jar to extract/repack)src/java-runtime(uses javac, jar, java)Cleanup
Step_InstallAdoptOpenJDK*.csfilesConfigurablespartial filesJI_JAVA_HOMEusage (redundant alias forJAVA_HOMEset in CI)