Repository navigation
[TrimmableTypeMap] Use separate trimmable Java.Interop test jar - #11336
Merged
jonathanpeppers merged 1 commit intoMay 13, 2026
Merged
jonathanpeppers merged 1 commit into
jonathanpeppers merged 1 commit into
Conversation
Avoid reusing the non-trimmable Java.Interop test jar when building the Mono.Android device tests with the trimmable typemap. The shared jar output could leave the desktop GetThis fixture in place, causing DisposeAccessesThis to hit legacy native-member registration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents stale Java.Interop test JAR reuse when switching the Mono.Android device-test project between trimmable and non-trimmable typemap lanes by producing a distinct output JAR for the trimmable configuration.
Changes:
- Introduces a
_JavaInteropTestsJarFileproperty that selects a differentJars\*.jaroutput when$(_AndroidTypeMapImplementation)istrimmable. - Updates the
AndroidJavaLibraryinput andTestJarEntry.OutputFileto use the selected JAR path, ensuring MSBuild up-to-date checks donβt reuse the non-trimmable JAR. - Adjusts the explanatory comment to reflect the new βseparate output jarβ behavior rather than requiring a clean rebuild.
jonathanpeppers
approved these changes
May 13, 2026
jonathanpeppers
deleted the
dev/simonrozsival/fix-javaobjecttest-disposeaccessesthis
branch
May 13, 2026 15:29
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Use a distinct Java.Interop test jar for the trimmable typemap device-test lane.
The trimmable lane swaps in an Android-specific
GetThis.javafixture that omits the desktop JVMManagedPeer.registerNativeMembers()static initializer. Because both trimmable and non-trimmable builds previously wroteJars/Mono.Android-Test-classes.jar, MSBuild could reuse a stale non-trimmable jar and package the desktopGetThisclass, causingJavaObjectTest.DisposeAccessesThisto hit legacy native-member registration under the trimmable typemap.Testing
make prepare && make alldotnet test tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests.csproj -v minimal./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "FullyQualifiedName~TrimmableTypeMapBuildTests"./dotnet-local.sh test tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests.csproj -v minimal --no-build./dotnet-local.sh build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -t:RunTestApp -p:_AndroidTypeMapImplementation=llvm-ir -nr:false./dotnet-local.sh build tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -t:RunTestApp -p:_AndroidTypeMapImplementation=trimmable -nr:falseAlso attempted
-p:_AndroidTypeMapImplementation=managed; it failed during build with existingXAGTM7009: Internal error: set of unique assemblies must be provided.