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: 4 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ Use these attributes to specify platform availability:

It's typically `make run-tests` in the directory with the test project.

### Adding Test Cases

When adding new test cases that require a runtime identifier, prefer `-arm64` over `-x64` unless there's a specific reason to use `-x64`.

## Apple Platform Integration

### Xcode Requirements
Expand Down
6 changes: 6 additions & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,12 @@
<Error Text=".NET for $(_PlatformName) does not support server garbage collection. Please don't set the 'ServerGarbageCollection' property." />
</Target>

<Target Name="_ValidatePublishSingleFile"
Condition="'$(PublishSingleFile)' == 'true'"
BeforeTargets="Build;Publish">
<Error Text=".NET for $(_PlatformName) does not support publishing to a single file. Please don't set the 'PublishSingleFile' property." />
</Target>

<Target Name="_ValidateXcodeVersion"
AfterTargets="_DetectSdkLocations"
Condition="'$(ValidateXcodeVersion)' != 'false' And '$(_CanOutputAppBundle)' == 'true' And '$(IsMacEnabled)' == 'true'">
Expand Down
20 changes: 20 additions & 0 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,26 @@ public void BuildFatMonoTouchTest (ApplePlatform platform, string runtimeIdentif
Assert.That (infoPlist.GetString ("CFBundleDisplayName").Value, Is.EqualTo ("MonoTouchTest"), "CFBundleDisplayName");
}

[Test]
[TestCase (ApplePlatform.iOS, "iossimulator-arm64")]
[TestCase (ApplePlatform.TVOS, "tvossimulator-arm64")]
[TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64")]
[TestCase (ApplePlatform.MacOSX, "osx-arm64")]
public void PublishSingleFile_IsNotSupported (ApplePlatform platform, string runtimeIdentifiers)
{
var project = "MySimpleApp";
Configuration.IgnoreIfIgnoredPlatform (platform);

var project_path = GetProjectPath (project, platform: platform);
Clean (project_path);
var properties = GetDefaultProperties (runtimeIdentifiers);
properties ["PublishSingleFile"] = "true";
var rv = DotNet.AssertBuildFailure (project_path, properties);
var errors = BinLog.GetBuildLogErrors (rv.BinLogPath).ToArray ();
Assert.That (errors.Length, Is.GreaterThanOrEqualTo (1), "Error count");
Assert.That (errors.Select (e => e.Message), Has.Some.Contains ("does not support publishing to a single file"), "Error message");
}

[Test]
[TestCase (ApplePlatform.iOS, "ios-arm64;iossimulator-x64")]
[TestCase (ApplePlatform.iOS, "ios-arm64;iossimulator-arm64")]
Expand Down