[build] Replace custom <DownloadUri/> task with built-in <DownloadFile/>#11330
Merged
Conversation
…File/>` Delete the custom `DownloadUri` MSBuild task and use the standard `<DownloadFile/>` task instead, which has built-in support for retries and skip-unchanged behavior. The custom task was only used in `bundletool.targets` (and declared but unused in `aapt2.targets`), so the migration is straightforward. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the custom Xamarin.Android.BuildTools.PrepTasks.DownloadUri MSBuild task and switches the bundletool download flow to MSBuild’s <DownloadFile/> task, while also adding an integrity check for the downloaded bundletool JAR.
Changes:
- Replaced
<DownloadUri/>usage inbundletool.targetswith<DownloadFile/>, including retry configuration. - Added a SHA256 verification step for the downloaded
bundletool-all-$(XABundleToolVersion).jar, backed by a new$(XABundleToolHash)property. - Removed unused
<UsingTask/>declarations forDownloadUriand deleted theDownloadUritask implementation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/bundletool/bundletool.targets | Use <DownloadFile/> to fetch bundletool and verify the downloaded JAR via SHA256. |
| src/aapt2/aapt2.targets | Remove the unused <UsingTask/> declaration for the deleted DownloadUri task. |
| Configuration.props | Add default XABundleToolHash value used for bundletool integrity verification. |
| build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/DownloadUri.cs | Delete the custom download task implementation now replaced by <DownloadFile/>. |
simonrozsival
approved these changes
May 13, 2026
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.
Delete the custom
DownloadUriMSBuild task and use the standard<DownloadFile/>task instead, which has built-in support for retries and skip-unchanged behavior.The custom task was only used in
bundletool.targets(and declared but unused inaapt2.targets), so the migration is straightforward.