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
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ This file contains the .NET 5-specific targets to customize ILLink

<Target Name="_FixRootAssembly" AfterTargets="PrepareForILLink">
<ItemGroup>
<TrimmerRootAssembly Update="@(TrimmerRootAssembly)" Condition=" '%(RootMode)' == 'EntryPoint' " RootMode="All" />
<TrimmerRootAssembly Update="@(TrimmerRootAssembly)" Condition=" '%(TrimmerRootAssembly.RootMode)' == 'EntryPoint' " RootMode="All" />
</ItemGroup>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2299,5 +2299,22 @@ public CustomView (Context context) : base (context) { }
using var builder = CreateApkBuilder ();
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
}

[Test]
public void TrimmerRootAssemblyWithoutRootMode ()
{
// Verifies that user-defined TrimmerRootAssembly items without RootMode metadata
// don't cause MSB4096 error in _FixRootAssembly target
var proj = new XamarinAndroidApplicationProject {
IsRelease = true,
};

// Add TrimmerRootAssembly items without RootMode metadata
proj.OtherBuildItems.Add (new BuildItem ("TrimmerRootAssembly", "Mono.Android"));
proj.OtherBuildItems.Add (new BuildItem ("TrimmerRootAssembly", "System.Runtime"));

using var builder = CreateApkBuilder ();
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
}
}
}
Loading