Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Documentation/docs-mobile/building-apps/build-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,8 @@ This property is obsolete and should not be used.
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.
The default value is `trimmable` when `$(PublishAot)` is `true` and `llvm-ir`
otherwise.

## AndroidUseApkSigner

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<AndroidClassParser>class-parse</AndroidClassParser>
<AndroidCodegenTarget Condition=" '$(AndroidCodegenTarget)' == '' ">XAJavaInterop1</AndroidCodegenTarget>
<_AndroidJcwCodegenTarget Condition=" '$(_AndroidJcwCodegenTarget)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">XAJavaInterop1</_AndroidJcwCodegenTarget>
<AndroidTypeMapImplementation Condition=" '$(AndroidTypeMapImplementation)' == '' and '$(_AndroidRuntime)' != 'NativeAOT' ">llvm-ir</AndroidTypeMapImplementation>
<AndroidTypeMapImplementation Condition=" '$(AndroidTypeMapImplementation)' == '' and '$(PublishAot)' == 'true' ">trimmable</AndroidTypeMapImplementation>
<AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods Condition=" '$(AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods)' == '' ">true</AndroidBoundInterfacesContainStaticAndDefaultInterfaceMethods>
<AndroidBoundInterfacesContainTypes Condition=" '$(AndroidBoundInterfacesContainTypes)' == '' ">true</AndroidBoundInterfacesContainTypes>
<AndroidBoundInterfacesContainConstants Condition=" '$(AndroidBoundInterfacesContainConstants)' == '' ">true</AndroidBoundInterfacesContainConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,27 @@ public void Build_WithTrimmableTypeMap_Succeeds ([Values] bool isRelease, [Value
AssertTrimmableTypeMapOutputs (intermediateDir);
}

[Test]
public void Build_PublishAotProject_UsesTrimmableTypeMapForCoreClrDebug ()
{
if (IgnoreUnsupportedConfiguration (AndroidRuntime.CoreCLR, release: false)) {
return;
}

var proj = new XamarinAndroidApplicationProject {
IsRelease = false,
};
proj.SetRuntime (AndroidRuntime.CoreCLR);
proj.SetProperty (KnownProperties.PublishAot, "true");
proj.SetProperty ("NativeCompilationDuringPublish", "false");

using var builder = CreateApkBuilder ();
Assert.IsTrue (builder.Build (proj, parameters: [ "_AndroidRuntime=CoreCLR" ]), "Build should have succeeded.");

var intermediateDir = builder.Output.GetIntermediaryPath ("typemap");
AssertTrimmableTypeMapOutputs (intermediateDir);
}

[Test]
public void Build_WithTrimmableTypeMap_IncrementalBuild ([Values] bool isRelease, [Values (AndroidRuntime.CoreCLR, AndroidRuntime.NativeAOT)] AndroidRuntime runtime)
{
Expand Down
Loading