diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index f20e4a4e5cda..4425655fe534 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -267,6 +267,11 @@ true + + <_PreviousPublishTrimmedValue>$(PublishTrimmed) + + + @@ -754,7 +759,7 @@ - + diff --git a/tests/dotnet/UnitTests/ProjectTest.cs b/tests/dotnet/UnitTests/ProjectTest.cs index bb5ddd20eb3c..6468d3f37a93 100644 --- a/tests/dotnet/UnitTests/ProjectTest.cs +++ b/tests/dotnet/UnitTests/ProjectTest.cs @@ -418,7 +418,8 @@ public void InvalidRuntimeIdentifiers (ApplePlatform platform, string runtimeIde [Test] [TestCase ("iossimulator-x64", false)] [TestCase ("ios-arm64", true)] - public void IsNotMacBuild (string runtimeIdentifier, bool isDeviceBuild) + [TestCase ("ios-arm64", true, "PublishTrimmed=true;UseInterpreter=true")] + public void IsNotMacBuild (string runtimeIdentifier, bool isDeviceBuild, string extraProperties = null) { if (isDeviceBuild) Configuration.AssertDeviceAvailable (); @@ -429,6 +430,12 @@ public void IsNotMacBuild (string runtimeIdentifier, bool isDeviceBuild) Clean (project_path); var properties = GetDefaultProperties (runtimeIdentifier); properties ["IsMacEnabled"] = "false"; + if (extraProperties is not null) { + foreach (var assignment in extraProperties.Split (';')) { + var split = assignment.Split ('='); + properties [split [0]] = split [1]; + } + } var result = DotNet.AssertBuild (project_path, properties); AssertThatLinkerDidNotExecute (result); var appExecutable = Path.Combine (appPath, Path.GetFileName (project_path));