[Build] Move aapt2 download from xaprepare to MSBuild target#11399
Draft
jonathanpeppers wants to merge 3 commits into
Draft
[Build] Move aapt2 download from xaprepare to MSBuild target#11399jonathanpeppers wants to merge 3 commits into
jonathanpeppers wants to merge 3 commits into
Conversation
Remove Step_Get_Android_BuildTools from xaprepare and move the aapt2 download/extract logic into src/aapt2/aapt2.targets as a proper MSBuild target. The new _DownloadBuildTools target: - Downloads Google's repository2-3.xml manifest - Dynamically reads SHA-1 checksums via XmlPeek (no hardcoded hashes) - Downloads the 3 platform build-tools zips - Validates checksums and errors on mismatch - Uses Inputs/Outputs for incremental build skip This removes one more step from xaprepare, moving the logic to a standard MSBuild target that is easier to understand and maintain. Co-authored-by: Copilot <[email protected]>
Refactor _DownloadBuildTools to use target batching via Outputs="...%(_BuildTools.Identity)" so the target body runs once per item. This replaces repeated DownloadFile/GetFileHash/Delete/Error calls with single instances that operate on the batched item. Also separate manifest download into its own target with a Condition to skip when all zips already exist. Co-authored-by: Copilot <[email protected]>
These prefix properties were only used by Step_Get_Android_BuildTools which has been deleted. The property was always empty and served no purpose for current build-tools versions. Removed from: - KnownProperties.cs - Properties.Defaults.cs.in - xaprepare.targets - Configuration.props - AndroidToolchain.cs (inlined empty prefix away) Co-authored-by: Copilot <[email protected]>
2b8296c to
3a13b23
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.
Summary
Remove
Step_Get_Android_BuildToolsfrom xaprepare and move the aapt2 download/extract logic intosrc/aapt2/aapt2.targetsas a proper MSBuild target.Changes
The new
_DownloadBuildToolstarget inaapt2.targets:repository2-3.xmlmanifestXmlPeek(no hardcoded hashes — when the version is bumped, checksums are automatically resolved from the manifest)Inputs/Outputsfor incremental build skipAlso removes:
Step_Get_Android_BuildTools.csfrom xaprepareScenario_Standard.csBuildToolsArchiveDownloadedproperty fromContext.csContext
Part of the effort to eliminate xaprepare steps in favor of standard MSBuild targets. This makes the build logic easier to understand, debug, and maintain — no custom C# download infrastructure needed.