Skip to content

[release/11.0.1xx] [Build.Tasks] Replace Dalvik collection with MSBuild items - #13690

Merged
jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-backport-dalvik-collection-xml
Nov 20, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-backport-dalvik-collection-xml

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

Backport of #13387.

Replace the two Dalvik collection task calls with MSBuild items and remove the unused task. This avoids a custom task call for a simple item transformation. Preserve file order, duplicate inputs, ApkName overrides, whitespace fallback, and the case-insensitive AAB dex/ prefix.

The conflict was in the <UsingTask> registrations. Keep the release branch's Xamarin.Android.Tasks.CollectAssemblyFilesToCompress registration and remove only CollectDalvikFilesForArchive. All release-only packaging content stays unchanged. The release BuildArchive consumer reads ArchivePath and JavaArchiveEntry in the same way as main; KeepMetadata="ArchivePath" prevents unrelated metadata from reaching it. No multithreaded task infrastructure is included.

Validation:

  • dotnet-local.cmd build Microsoft.Android.slnx -c Debug -nodeReuse:false -v:minimal -bl:<session-files>\product-build.binlog: passed, 0 errors.
  • Isolated MSBuild execution of both collection blocks: passed eight APK/AAB cases. Checked uppercase AAB, prefix reset, item order, non-adjacent duplicates, ApkName overrides, whitespace fallback, metadata isolation, unchanged source metadata, and temporary-item cleanup.
  • git diff origin/release/11.0.1xx HEAD --check: passed.
  • git grep -n CollectDalvikFilesForArchive: no remaining references.

Full packaging tests were not completed. Local workload setup required extra API-level builds; those builds were stopped at the user's request. Full validation will run in CI. The source PR did not change any tests.


Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

Backport the Dalvik archive item construction only. Preserve the release CollectAssemblyFilesToCompress registration and all release-only packaging content.

(cherry picked from commit 9535641)

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 17:12
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Closing: this PR was opened by an automated session in error. The backport commit is kept locally for review by the coordinating session.

@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-backport-dalvik-collection-xml branch November 20, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The Android dex-file collection backport has no active review issues.

No open issues 🎉

What changed in this PR

Backports #13387 to release/11.0.1xx, simplifying dex-file collection in Android packaging by replacing a custom task with MSBuild item operations.

Changes:

  • Replaces both collection calls while preserving ordering, duplicates, ApkName overrides, whitespace fallback, and case-insensitive AAB prefix handling.
  • Isolates archive metadata and clears temporary items after collection.
  • Removes the unused task and its registration, retaining release-specific packaging content.
File Description
src/​Xamarin.Android.Build.Tasks/​Xamarin.Android.Common.targets Replaces both task calls with item operations and removes the task registration.
src/​Xamarin.Android.Build.Tasks/​Tasks/​CollectDalvikFilesForArchive.cs Deletes the superseded collection task.

Review effort: Balanced

@jonathanpeppers
jonathanpeppers restored the jonathanpeppers-backport-dalvik-collection-xml branch November 20, 2026 17:20
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Reopened: this PR was closed in error.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) November 20, 2026 20:07

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed 16a498d5 against release/11.0.1xx at ea3a55f1. This is a static, read-only review.

LGTM. I checked this backport against the deleted CollectDalvikFilesForArchive at the merge base. The new item logic in Xamarin.Android.Common.targets (lines 2319–2332 and 2444–2457) gives the same results:

  • The dex/ prefix still applies only for aab (case-insensitive).
  • The file-name fallback still uses GetFileName, and ApkName overrides it unless it is empty or whitespace.
  • The in-place update keeps item order and duplicates, and KeepMetadata="ArchivePath" gives BuildArchive exactly the metadata the old task output (ArchivePath only, no JavaArchiveEntry).
  • The temporary _AndroidDalvikFiles items are removed in both targets, and the incremental build inputs are unchanged.

Both blocks are byte-identical to #13387 on main. The release-only CollectAssemblyFilesToCompress registration is kept, and nothing else in the tree references the removed task. The newer commits on release/11.0.1xx change a different part of Xamarin.Android.Common.targets (GetAppSettingsDirectory), and the just-merged #13683 only touches AndroidSdk EmulatorRunner/PublicAPI files, so this should merge cleanly.

@jonathanpeppers
jonathanpeppers merged commit cad3870 into release/11.0.1xx Nov 20, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-backport-dalvik-collection-xml branch November 20, 2026 20:57
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.

4 participants