[TrimmableTypeMap] Preserve trimmable typemap outputs on no-op builds#11472
Open
simonrozsival wants to merge 1 commit into
Open
[TrimmableTypeMap] Preserve trimmable typemap outputs on no-op builds#11472simonrozsival wants to merge 1 commit into
simonrozsival wants to merge 1 commit into
Conversation
Generated trimmable typemap outputs are dynamic, so no-op builds can skip the targets that normally add them to FileWrites. Replay the prior generated outputs before IncrementalClean so they are not treated as orphaned and removed before packaging evaluates its inputs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a trimmable typemap incremental-build issue where MSBuild’s IncrementalClean could delete previously generated typemap DLLs / Java outputs on no-op builds (because skipped targets don’t re-populate @(FileWrites)). It replays the prior dynamic outputs into @(FileWrites) early in the build and strengthens the incremental test to ensure the generated typemap assemblies survive a no-op rebuild.
Changes:
- Add a
_RecordTrimmableTypeMapFileWritestarget that re-emits typemap-generated DLL/Java outputs into@(FileWrites)before_CleanGetCurrentAndPriorFileWritesruns. - Refactor typemap assembly item construction via a dedicated
@(_TrimmableTypeMapResolvedAssemblies)item list and then feed it into both@(_ResolvedAssemblies)and@(_ShrunkAssemblies). - Extend
Build_WithTrimmableTypeMap_IncrementalBuildto assert typemap DLLs from the first build still exist after a no-op second build.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs | Adds an assertion that typemap DLL outputs persist across a no-op rebuild where _GenerateJavaStubs is skipped. |
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets | Replays prior dynamic typemap outputs into @(FileWrites) before IncrementalClean and slightly restructures typemap DLL item population for packaging/native config. |
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
Related to #10958.
Relevant sub-issues:
Validation