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
6 changes: 6 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@

</PropertyGroup>

<!-- Set the default RuntimeIdentifier when publishing -->
<PropertyGroup Condition="'$(PublishRuntimeIdentifier)' == ''">
<PublishRuntimeIdentifier Condition="'$(_PlatformName)' == 'iOS'">ios-arm64</PublishRuntimeIdentifier>
<PublishRuntimeIdentifier Condition="'$(_PlatformName)' == 'tvOS'">tvos-arm64</PublishRuntimeIdentifier>
Comment thread
rolfbjarne marked this conversation as resolved.
</PropertyGroup>

<!-- Now that we know the runtime identifier, we can determine if we're building for a simulator -->
<PropertyGroup>
<_SdkIsSimulator Condition="$(RuntimeIdentifier.Contains('simulator')) Or $(RuntimeIdentifiers.Contains('simulator'))">true</_SdkIsSimulator>
Expand Down
17 changes: 17 additions & 0 deletions tests/dotnet/UnitTests/PostBuildTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,22 @@ public void PublishFailureTest (ApplePlatform platform, string runtimeIdentifier

Assert.That (pkgPath, Does.Not.Exist, "ipa/pkg creation");
}

[TestCase (ApplePlatform.iOS, "ios-arm64")]
[TestCase (ApplePlatform.TVOS, "tvos-arm64")]
public void DefaultPublishRid (ApplePlatform platform, string expectedRuntimeIdentifier)
{
var project = "MySimpleApp";
var configuration = "Release";
Configuration.IgnoreIfIgnoredPlatform (platform);
Configuration.AssertRuntimeIdentifiersAvailable (platform, expectedRuntimeIdentifier);

var project_path = GetProjectPath (project, expectedRuntimeIdentifier, platform: platform, out var appPath, configuration: configuration);
Clean (project_path);

var properties = GetDefaultProperties ();
var rv = DotNet.AssertPublish (project_path, properties);
Assert.That (appPath, Does.Exist, "App existence");
}
}
}
2 changes: 2 additions & 0 deletions tests/xharness/Jenkins/TestVariationsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public IEnumerable<T> CreateTestVariations<T> (IEnumerable<T> tests, Func<MSBuil
if (publishaot) {
clone.Xml.SetProperty ("PublishAot", "true", last: false);
clone.Xml.SetProperty ("_IsPublishing", "true", last: false); // quack like "dotnet publish", otherwise PublishAot=true has no effect.
if (!string.IsNullOrEmpty (runtime_identifer))
clone.Xml.SetProperty ("PublishRuntimeIdentifier", runtime_identifer);
}
if (!string.IsNullOrEmpty (test_variation)) {
clone.Xml.SetProperty ("TestVariation", test_variation);
Expand Down
Loading