Skip to content

[release/11.0.1xx] Keep generated AAPT2 rules in R8 inputs on incremental builds - #12974

Merged
jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
backport/pr-12950-to-release/11.0.1xx
Oct 1, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
backport/pr-12950-to-release/11.0.1xx

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Backport of #12950 to release/11.0.1xx

/cc @jonathanpeppers

## Summary
- Register the merged `aapt_rules.txt` as `ProguardConfiguration` and `FileWrites` in `_CreateBaseApk`, whose item groups are evaluated even when the target is up to date. Previously `_CreateBaseApkWithAapt2` was not invoked on an incremental build, dropping AAPT2 keep rules from R8's configuration.
- Compute the rules path in `_CreateBaseApkInputs` so the AAPT2 link task and the consuming target use the same path.
- Add an integration test with `AndroidLinkTool=r8` and `TrimMode=full` that failed before the fix and passes on an initial build and two successive incremental builds that rerun R8 without relinking resources. It also verifies incremental cleanup preserves the rules file.

## Validation
- Full `Microsoft.Android.slnx` build succeeded with the repository's pinned SDK.
- Targeted regression test: 1 passed after the change (failed before it).
- Existing AAPT2 link tests: 2 passed.
- Rebuilt SDK package contains the updated targets.

This reproduces and fixes the dropped-rules incremental path; the issue's intermittent clean-CI trigger was not independently reproduced.

Related to #12942

Co-authored-by: Copilot App <[email protected]>
@jonathanpeppers
jonathanpeppers merged commit c49b996 into release/11.0.1xx Oct 1, 2026
44 checks passed
@jonathanpeppers
jonathanpeppers deleted the backport/pr-12950-to-release/11.0.1xx branch October 1, 2026 19:42
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.

1 participant