Skip to content

[TrimmableTypeMap] Update TrimmableTypeMapBuildTests to expect a full successful build #11020

Description

@simonrozsival

Parent issue: #11017

File: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs

Both existing tests currently use ThrowOnBuildFailure = false with a comment that the build fails downstream because manifest generation was not yet implemented. Now that the trimmable path is complete (manifest, JCW generation, etc.), these tests should be updated to:

  • Remove ThrowOnBuildFailure = false — expect a full successful build
  • Assert that both TypeMap DLLs were generated: _Microsoft.Android.TypeMaps.dll and _Mono.Android.TypeMap.dll
  • Assert that JCW .java files were generated in the typemap output directory
  • The incremental build test (Build_WithTrimmableTypeMap_IncrementalBuild) should already correctly assert that _GenerateJavaStubs is skipped on the second build — just remove the failure tolerance

Activity

  1. added this to the .NET 11 milestone on Mar 25, 2026
  2. simonrozsival commented on May 25, 2026

    @simonrozsival
    MemberAuthor

    I checked this against current origin/main.

    This is mostly done now:

    • ThrowOnBuildFailure = false is gone from the two original tests.
    • Build_WithTrimmableTypeMap_Succeeds now expects builder.Build (proj) to succeed.
    • Build_WithTrimmableTypeMap_IncrementalBuild expects both builds to succeed.
    • The incremental test still asserts _GenerateJavaStubs is skipped on the second build.

    What is still missing from this issue's exact checklist:

    • The original build tests only assert that the typemap intermediate directory exists.
    • They do not explicitly assert that _Microsoft.Android.TypeMaps.dll and _Mono.Android.TypeMap.dll were generated.
    • They do not explicitly assert that JCW .java files were generated under the typemap output directory.

    There is related coverage elsewhere: GenerateTrimmableTypeMapTests checks those DLL names at task level, and Build_WithExportAndExportField_GeneratesJcwAndTypeMap checks JCW output plus a user *.TypeMap.dll. But since this issue specifically asks to update the existing TrimmableTypeMapBuildTests build tests, I think we should keep it open until those direct assertions are added to Build_WithTrimmableTypeMap_Succeeds and likely reused by the incremental test after the first build.

  3. locked and limited conversation to collaborators on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions