From 3020a784954bba98343adb57efefdcbd9034e8d3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Aug 2026 16:23:17 +0000 Subject: [PATCH 1/2] Initial plan From 21d61a3b7c93f80d2bcfadf44f0d2cfeb13f9763 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 17 Aug 2026 16:48:22 +0000 Subject: [PATCH 2/2] Make typemap implementation property public Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com> --- .github/copilot-instructions.md | 4 +- .../building-apps/build-properties.md | 8 ++++ .../yaml-templates/stage-package-tests.yaml | 2 +- .../README.md | 2 +- ...soft.Android.Sdk.DefaultProperties.targets | 2 +- .../Microsoft.Android.Sdk.NativeAOT.targets | 2 +- ...crosoft.Android.Sdk.TypeMap.LlvmIr.targets | 2 +- ...roid.Sdk.TypeMap.Trimmable.CoreCLR.targets | 8 ++-- ...id.Sdk.TypeMap.Trimmable.NativeAOT.targets | 4 +- ...soft.Android.Sdk.TypeMap.Trimmable.targets | 10 ++--- .../PackagingTest.cs | 2 +- .../TrimmableTypeMapBuildTests.cs | 42 +++++++++---------- .../Xamarin.Android.Common.targets | 20 ++++----- .../Tests/InstallAndRunTests.cs | 4 +- .../Java.Interop-Tests.NET.csproj | 4 +- .../Java.Interop-Tests.targets | 12 +++--- .../Mono.Android.NET-Tests.csproj | 12 +++--- 17 files changed, 74 insertions(+), 66 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index cc04c968c20..2301347a0ec 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -222,13 +222,13 @@ When diagnosing runtime, build, or test failures, follow these practices. They e make prepare && make all CONFIGURATION=Release ./dotnet-local.sh build -t:Install -c Release \ tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj \ - -p:_AndroidTypeMapImplementation= \ + -p:AndroidTypeMapImplementation= \ -p:UseMonoRuntime= ( cd tests/Mono.Android-Tests/Mono.Android-Tests ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj --no-build -c Release \ --report-trx --results-directory ../../../bin/TestRelease/TestResults \ - -p:_AndroidTypeMapImplementation= \ + -p:AndroidTypeMapImplementation= \ -p:UseMonoRuntime= ) ``` diff --git a/Documentation/docs-mobile/building-apps/build-properties.md b/Documentation/docs-mobile/building-apps/build-properties.md index e521fb87e4f..31334e5ec7e 100644 --- a/Documentation/docs-mobile/building-apps/build-properties.md +++ b/Documentation/docs-mobile/building-apps/build-properties.md @@ -1243,6 +1243,14 @@ Supported values include: This property is obsolete and should not be used. +## AndroidTypeMapImplementation + +An enum-style property that selects the type map implementation. +Valid values are `llvm-ir` and `trimmable`. + +The default value is `llvm-ir` when using CoreCLR and `trimmable` when using +NativeAOT. + ## AndroidUseApkSigner A bool property that allows the developer to diff --git a/build-tools/automation/yaml-templates/stage-package-tests.yaml b/build-tools/automation/yaml-templates/stage-package-tests.yaml index 19292f41806..19bc0d5fbcd 100644 --- a/build-tools/automation/yaml-templates/stage-package-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-package-tests.yaml @@ -165,7 +165,7 @@ stages: testName: Mono.Android.NET_Tests-CoreCLRTrimmable project: tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)CoreCLRTrimmable.xml - extraBuildArgs: -p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false + extraBuildArgs: -p:AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab artifactFolder: $(DotNetTargetFramework)-CoreCLRTrimmable diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/README.md b/src/Microsoft.Android.Sdk.TrimmableTypeMap/README.md index 89905d108c9..7d1cefdef8b 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/README.md +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/README.md @@ -1,7 +1,7 @@ # Trimmable typemap build pipeline This document describes how the **trimmable** typemap implementation -(`_AndroidTypeMapImplementation=trimmable`) is produced during an Android app +(`AndroidTypeMapImplementation=trimmable`) is produced during an Android app build, and how the MSBuild targets are kept incremental. It is aimed at contributors working on the targets in `src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable*.targets` diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets index cf7167dcfd4..af654a3b23f 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets @@ -44,7 +44,7 @@ class-parse XAJavaInterop1 <_AndroidJcwCodegenTarget Condition=" '$(_AndroidJcwCodegenTarget)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">XAJavaInterop1 - <_AndroidTypeMapImplementation Condition=" '$(_AndroidTypeMapImplementation)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">llvm-ir + llvm-ir true true true diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index 21957db817e..9ec28273a23 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -17,7 +17,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. <_AndroidRuntimePackRuntime>NativeAOT <_AndroidUseWorkloadNativeLinker Condition=" '$(_AndroidUseWorkloadNativeLinker)' == '' ">true <_AndroidJcwCodegenTarget Condition=" '$(_AndroidJcwCodegenTarget)' == '' ">JavaInterop1 - <_AndroidTypeMapImplementation Condition=" '$(_AndroidTypeMapImplementation)' == '' ">trimmable + trimmable true diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets index 994a38cb374..7bb826023f8 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets @@ -98,7 +98,7 @@ ResolvedAssemblies="@(_ResolvedAssemblies)" SkipJniAddNativeMethodRegistrationAttributeScan="$(_SkipJniAddNativeMethodRegistrationAttributeScan)" SupportedAbis="@(_BuildTargetAbis)" - TypemapImplementation="$(_AndroidTypeMapImplementation)" + TypemapImplementation="$(AndroidTypeMapImplementation)" TypemapOutputDirectory="$(_NativeAssemblySourceDir)"> diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets index 5054346d8b5..85980d3cdbf 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets @@ -51,7 +51,7 @@ <_PostTrimTrimmableTypeMapInputAssemblies Remove="@(_PostTrimTrimmableTypeMapInputAssemblies)" /> @@ -70,7 +70,7 @@ a real output but leaves the stamp, invalidate the stamp so the producer restores the complete post-trim output set instead of letting _GenerateJavaStubs create an empty acw-map placeholder. --> + Condition=" '$(AndroidTypeMapImplementation)' == 'trimmable' and '$(PublishTrimmed)' == 'true' and '$(_ComputeFilesToPublishForRuntimeIdentifiers)' != 'true' "> <_ExpectedPostTrimJavaFile Remove="@(_ExpectedPostTrimJavaFile)" /> <_ActualPostTrimJavaFile Remove="@(_ActualPostTrimJavaFile)" /> @@ -99,7 +99,7 @@ @@ -138,7 +138,7 @@ @@ -117,7 +117,7 @@ deferred-registration propagation. --> @@ -306,7 +306,7 @@ the item groups empty for targets such as Install. --> diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs index 062c6672736..ee0ff31d17e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs @@ -482,7 +482,7 @@ public void MonoAndroidExportIsNotPackagedWithTrimmableTypeMap () }, }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); proj.Sources.Add (new BuildItem.Source ("ContainsExportedMethods.cs") { TextContent = () => @"using System; using Java.Interop; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs index d47da49d497..8c78fcdd32c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs @@ -27,7 +27,7 @@ public void Build_WithTrimmableTypeMap_Succeeds ([Values] bool isRelease, [Value IsRelease = isRelease, }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); @@ -46,7 +46,7 @@ public void Build_WithTrimmableTypeMap_IncrementalBuild ([Values] bool isRelease IsRelease = isRelease, }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -81,7 +81,7 @@ public void Build_WithTrimmableTypeMap_MissingJavaListPreservesGeneratedJava () var proj = new XamarinAndroidApplicationProject (); proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -115,7 +115,7 @@ public void Build_WithTrimmableTypeMap_PublishTrimmed_MissingLinkedJavaListRegen IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -153,7 +153,7 @@ public void Build_WithTrimmableTypeMap_KeepsNativeAotRuntimeHostAcws () LinkTool = "r8", }; proj.SetRuntime (AndroidRuntime.NativeAOT); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); @@ -181,7 +181,7 @@ public void Build_WithTrimmableTypeMap_DeletesStaleGeneratedJavaSources () var proj = new XamarinAndroidApplicationProject (); proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -219,7 +219,7 @@ public void Build_WithTrimmableTypeMap_RecompilesUpdatedGeneratedJavaSources () var proj = new XamarinAndroidApplicationProject (); proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -286,7 +286,7 @@ public void Build_WithTrimmableTypeMap_PublishTrimmed_CompilesLinkedJavaInPlace IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -309,7 +309,7 @@ public void Build_WithTrimmableTypeMap_PublishTrimmed_DeletesStaleLinkedJavaWhen IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -358,7 +358,7 @@ public void Build_WithTrimmableTypeMap_PublishTrimmed_PostTrimJavaGenerationIsIn IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -398,7 +398,7 @@ public void Build_WithTrimmableTypeMap_PublishTrimmed_IncrementalChangesAvoidUnn IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "First build should have succeeded."); @@ -472,7 +472,7 @@ public void Build_WithTrimmableTypeMap_DoesNotHitCopyIfChangedMismatch ([Values IsRelease = true, }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); @@ -492,7 +492,7 @@ public void Build_WithTrimmableTypeMap_AssemblyStoreMappingsStayInRange () IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); @@ -537,7 +537,7 @@ public void NativeAotTrimmableTypeMap_DoesNotExportFrameworkTypeMaps () IsRelease = true, }; proj.SetRuntime (AndroidRuntime.NativeAOT); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); @@ -565,7 +565,7 @@ public void CoreClrTrimmableTypeMap_PackagesJavaProxyThrowable () IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); @@ -588,7 +588,7 @@ public void CoreClrTrimmableTypeMap_PackagesReadyToRunTypeMap () IsRelease = true, }; proj.SetRuntime (AndroidRuntime.CoreCLR); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); proj.SetProperty ("RuntimeIdentifier", "android-arm64"); proj.SetProperty ("AndroidEnableAssemblyCompression", "false"); @@ -675,7 +675,7 @@ public void ReleaseCoreClrTrimmableTypeMap_SingleRuntimeIdentifier_PackagesLinke proj.SetProperty ("AndroidEnableAssemblyCompression", "false"); proj.SetProperty (KnownProperties.AndroidLinkTool, "r8"); proj.SetProperty ("TrimMode", "full"); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (Path.Combine ("temp", $"TypemapComparison_trimmable_single_rid_{Guid.NewGuid ():N}")); Assert.IsTrue (builder.Build (proj), "trimmable single-RID build should have succeeded."); @@ -787,7 +787,7 @@ public void Build_WithExportAndExportField_GeneratesJcwAndTypeMap () }, }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); proj.Sources.Add (new BuildItem.Source ("ExportShapes.cs") { TextContent = () => @"using System; using Java.Interop; @@ -879,7 +879,7 @@ public void Build_WithExport_ProducesNoTrimWarningsTargetingExportCodegen () }, }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); proj.SetProperty ("TrimMode", "full"); proj.SetProperty ("TrimmerSingleWarn", "false"); proj.Sources.Add (new BuildItem.Source ("ExportShapes.cs") { @@ -942,7 +942,7 @@ public void Build_WithTrimmableTypeMap_AbstractTypeWithProtectedCtor_Succeeds () IsRelease = true, }; proj.SetRuntime (AndroidRuntime.NativeAOT); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); proj.Sources.Add (new BuildItem.Source ("AbstractProvider.cs") { TextContent = () => @" namespace UnnamedProject { @@ -989,7 +989,7 @@ DynamicCodeSupportProfile BuildDynamicCodeSupportProfile (string typemapImplemen proj.SetProperty (KnownProperties.AndroidLinkTool, "r8"); proj.SetProperty ("TrimMode", "full"); proj.SetProperty ("PublishReadyToRun", "false"); - proj.SetProperty ("_AndroidTypeMapImplementation", typemapImplementation); + proj.SetProperty ("AndroidTypeMapImplementation", typemapImplementation); if (dynamicCodeSupport.HasValue) { proj.SetProperty ("DynamicCodeSupport", dynamicCodeSupport.Value.ToString ().ToLowerInvariant ()); } diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 6a180259a39..7ac42b3eeb8 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -981,7 +981,7 @@ because xbuild doesn't support framework reference assemblies. <_PropertyCacheItems Include="AndroidManifestPlaceholders=$(AndroidManifestPlaceholders)" /> <_PropertyCacheItems Include="ProjectFullPath=$(MSBuildProjectFullPath)" /> <_PropertyCacheItems Include="AndroidUseDesignerAssembly=$(AndroidUseDesignerAssembly)" /> - <_PropertyCacheItems Include="_AndroidTypeMapImplementation=$(_AndroidTypeMapImplementation)" /> + <_PropertyCacheItems Include="AndroidTypeMapImplementation=$(AndroidTypeMapImplementation)" /> <_PropertyCacheItems Include="_AndroidUseMarshalMethods=$(_AndroidUseMarshalMethods)" /> <_PropertyCacheItems Include="_AndroidJcwCodegenTarget=$(_AndroidJcwCodegenTarget)" /> <_PropertyCacheItems Include="_AndroidAssemblyStoreCompressionLevel=$(_AndroidAssemblyStoreCompressionLevel)" /> @@ -1385,15 +1385,15 @@ because xbuild doesn't support framework reference assemblies. - + <_RuntimeJar>$(MSBuildThisFileDirectory)\java_runtime.jar - + <_RuntimeJar>$(MSBuildThisFileDirectory)\java_runtime_trimmable.jar - + <_RuntimeJar>$(MSBuildThisFileDirectory)\java_runtime_clr.jar @@ -1463,7 +1463,7 @@ because xbuild doesn't support framework reference assemblies. write to afterlink/ so linked/ stays unchanged and IlcCompile incrementalism is preserved. --> @@ -1500,7 +1500,7 @@ because xbuild doesn't support framework reference assemblies. so no redirection is needed, but the target still runs to trigger _RunAfterILLinkAdditionalSteps. --> + Condition="'$(PublishTrimmed)' == 'true' and '$(AndroidTypeMapImplementation)' != 'trimmable'"> <_OrigResolvedAssemblies Include="@(ResolvedAssemblies)" /> @@ -3012,8 +3012,8 @@ because xbuild doesn't support framework reference assemblies. Condition=" '$(DesignTimeBuild)' != 'true' "/> - + + Condition=" '$(AndroidTypeMapImplementation)' == 'trimmable' " /> + Condition=" '$(AndroidTypeMapImplementation)' != 'trimmable' " /> diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index 1f4e1b8f922..013c8b444a1 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -82,7 +82,7 @@ public void DotNetRun (bool isRelease, string typemapImplementation, AndroidRunt IsRelease = isRelease }; proj.SetRuntime (runtime); - proj.SetProperty ("_AndroidTypeMapImplementation", typemapImplementation); + proj.SetProperty ("AndroidTypeMapImplementation", typemapImplementation); using var builder = CreateApkBuilder (); builder.Save (proj); @@ -176,7 +176,7 @@ public void TrimmableTypeMapInheritedVirtualOverrideUsesCorrectUco ([Values (And }; proj.SetRuntime (runtime); proj.SetRuntimeIdentifiers (new [] { DeviceAbi }); - proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); + proj.SetProperty ("AndroidTypeMapImplementation", "trimmable"); proj.SetDefaultTargetDevice (); proj.Sources.Add (new BuildItem.Source ("UcoOverrideTypes.cs") { TextContent = () => @"using System; diff --git a/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.NET.csproj b/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.NET.csproj index 27ce22ebea6..f1cb147c93c 100644 --- a/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.NET.csproj +++ b/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.NET.csproj @@ -37,7 +37,7 @@ compile through the generator. The matching NUnit test class is excluded by name in tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs. --> - + @@ -49,7 +49,7 @@ - + diff --git a/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.targets b/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.targets index 92fca4bef0a..813e443a09a 100644 --- a/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.targets +++ b/tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.targets @@ -2,7 +2,7 @@ <_JavaInteropTestsJarFile>Jars\Mono.Android-Test-classes.jar - <_JavaInteropTestsJarFile Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">Jars\Mono.Android-Test-classes-trimmable.jar + <_JavaInteropTestsJarFile Condition=" '$(AndroidTypeMapImplementation)' == 'trimmable' ">Jars\Mono.Android-Test-classes-trimmable.jar @@ -40,22 +40,22 @@ ManagedPeer.construct) that is only registered by the Java.Interop test JVM and throws UnsatisfiedLinkError on Android. Both files declare `public class net.dot.jni.test.GetThis`, so include exactly one based on - $(_AndroidTypeMapImplementation). The trimmable variant lives in this + $(AndroidTypeMapImplementation). The trimmable variant lives in this project (not the submodule) and in a parallel directory because javac requires the file name match the public class name. --> + Condition=" '$(AndroidTypeMapImplementation)' == 'trimmable' " /> + Condition=" '$(AndroidTypeMapImplementation)' != 'trimmable' " /> + Condition=" '$(AndroidTypeMapImplementation)' == 'trimmable' " /> - false - CoreCLRTrimmable + false + CoreCLRTrimmable @@ -87,14 +87,14 @@ - + - - + + - + <_AndroidRemapMembers Include="Remaps.xml" /> <_AndroidRemapMembers Include="IsAssignableFromRemaps.xml" Condition=" '$(_AndroidIsAssignableFromCheck)' == 'false' " />