-
Notifications
You must be signed in to change notification settings - Fork 566
[TrimmableTypeMap] Add GenerateTrimmableTypeMap MSBuild task and targets #10924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simonrozsival
wants to merge
25
commits into
main
Choose a base branch
from
dev/simonrozsival/trimmable-typemap-05-msbuild-task
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
071efbd
[TrimmableTypeMap] Add GenerateTrimmableTypeMap MSBuild task and targets
simonrozsival aa3b259
Add unit tests for GenerateTrimmableTypeMap task
simonrozsival 046de51
Add integration tests for trimmable TypeMap build pipeline
simonrozsival 49b2322
Improve GenerateTrimmableTypeMap: extract methods, filter BCL, fail o…
simonrozsival 0739767
Fix task return types, Java output dir, remove TrimmerRootAssembly
simonrozsival 729f0d4
Add per-assembly timestamp check to skip up-to-date typemaps
simonrozsival 3395f63
Add thorough incrementality tests for GenerateTrimmableTypeMap
simonrozsival e026447
Document future scan optimization path in task
simonrozsival 5f462c6
Move TypeMappingEntryAssembly config to shared targets
simonrozsival 5eaee94
Make scanner/generator types public, fix invalid TFV test
simonrozsival a9bc05a
Skip writing unchanged JCW Java files for faster incremental builds
simonrozsival b3e0d9b
Revert "Skip writing unchanged JCW Java files for faster incremental …
simonrozsival ce586d2
Move UsingTask to Trimmable.targets — only needed in trimmable path
simonrozsival 48f739a
Sign TrimmableTypeMap assembly with product.snk
simonrozsival 18f333d
Address review: FileWrites, ->Count(), #nullable enable
simonrozsival 77a7739
Fix malformed <Touch> element in Trimmable.targets
simonrozsival f2e5558
Add test: no peers found with non-empty assembly input
simonrozsival 8c17189
Fix FindMonoAndroidDll to use TestEnvironment.MonoAndroidFrameworkDir…
simonrozsival 0825496
Address review: use MonoAndroidHelper, leave outputs null, drop LINQ
simonrozsival 5b99699
Fix UsingTask to use $(_XamarinAndroidBuildTasksAssembly)
simonrozsival 3e0d62f
Fix CI: package TrimmableTypeMap DLL and add metadata to test TaskItems
simonrozsival 72eb604
Make JavaFieldInfo record public for MSBuild task consumption
simonrozsival 06c6abe
Fix integration tests: target _GenerateJavaStubs only
simonrozsival 054dafc
Fix CI: ensure stamp directory exists for trimmable _GenerateJavaStubs
simonrozsival e4d743f
Fix CI: use full Build for trimmable typemap integration tests
simonrozsival File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
15 changes: 13 additions & 2 deletions
15
...sks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,16 @@ | ||
| <!-- Trimmable typemap targets for CoreCLR runtime (stub). | ||
| The actual implementation will be added in a follow-up. --> | ||
| <!-- Trimmable typemap targets for CoreCLR runtime. | ||
| Adds generated typemap assemblies to the linker inputs. --> | ||
| <Project> | ||
|
|
||
| <!-- After typemap generation, add generated assemblies to resolved assemblies for the linker. | ||
| NOT as TrimmerRootAssembly — the trimmer must process TypeMapAttributes and trim entries | ||
| whose trimTarget types were removed. --> | ||
| <Target Name="_AddTrimmableTypeMapAssembliesToLinker" | ||
| AfterTargets="_GenerateJavaStubs" | ||
| Condition=" '@(_GeneratedTypeMapAssemblies->Count())' != '0' "> | ||
| <ItemGroup> | ||
| <_ResolvedAssemblies Include="@(_GeneratedTypeMapAssemblies)" /> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| </Project> |
17 changes: 15 additions & 2 deletions
17
...s/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.NativeAOT.targets
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,17 @@ | ||
| <!-- Trimmable typemap targets for NativeAOT runtime (stub). | ||
| The actual implementation will be added in a follow-up. --> | ||
| <!-- Trimmable typemap targets for NativeAOT runtime. | ||
| Adds generated typemap assemblies to ILC inputs. --> | ||
| <Project> | ||
|
|
||
| <!-- After typemap generation, add generated assemblies to ILC inputs. | ||
| NOT as TrimmerRootAssembly — ILC must process TypeMapAttributes and trim entries | ||
| whose trimTarget types were removed. --> | ||
| <Target Name="_AddTrimmableTypeMapAssembliesToIlc" | ||
| AfterTargets="_GenerateJavaStubs" | ||
| Condition=" '@(_GeneratedTypeMapAssemblies->Count())' != '0' "> | ||
| <ItemGroup> | ||
| <IlcReference Include="@(_GeneratedTypeMapAssemblies)" /> | ||
| <UnmanagedEntryPointsAssembly Include="@(_GeneratedTypeMapAssemblies)" /> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| </Project> |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 💡 API design — This type (and
JavaPeerInfo,MarshalMethodInfo,JniParameterInfo,JavaConstructorInfo,ActivationCtorInfo,ActivationCtorStyle,JcwJavaSourceGenerator,RootTypeMapAssemblyGenerator,TypeMapAssemblyGenerator) were changed frominternaltopublic. These are only consumed by theGenerateTrimmableTypeMapMSBuild task inXamarin.Android.Build.Tasks. Making thempublicexposes them as API surface that customers could depend on.Consider keeping them
internaland adding[InternalsVisibleTo("Xamarin.Android.Build.Tasks")]in the TrimmableTypeMap csproj instead. This is consistent with the existingInternalsVisibleToentries for test projects.Rule: New helpers default to
internal(Code Organization#4)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentionally keeping these
public. The benchmark script in the PR description consumes them directly, and they'll also be useful for the pre-generation step in #10760 which runs outside ofXamarin.Android.Build.Tasks. This assembly isn't part of the public SDK surface shipped to customers — it's an internal build-time dependency.