Skip to content

Commit 27ef26d

Browse files
authored
[net10.0] Add a test to verify that we can build .NET 9 apps. (#21788)
1 parent 9db9283 commit 27ef26d

File tree

13 files changed

+111
-0
lines changed

13 files changed

+111
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
4+
using Foundation;
5+
6+
namespace MySimpleApp {
7+
public class Program {
8+
static int Main (string [] args)
9+
{
10+
GC.KeepAlive (typeof (NSObject)); // prevent linking away the platform assembly
11+
12+
Console.WriteLine (Environment.GetEnvironmentVariable ("MAGIC_WORD"));
13+
14+
return args.Length;
15+
}
16+
}
17+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../shared.mk
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFramework>net9.0-maccatalyst</TargetFramework>
5+
<SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>
6+
</PropertyGroup>
7+
<Import Project="..\shared.csproj" />
8+
</Project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TOP=../../..
2+
include $(TOP)/tests/common/shared-dotnet-test.mk
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../shared.mk
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFramework>net9.0-ios</TargetFramework>
5+
<SupportedOSPlatformVersion>12.2</SupportedOSPlatformVersion>
6+
</PropertyGroup>
7+
<Import Project="..\shared.csproj" />
8+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../shared.mk
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFramework>net9.0-macos</TargetFramework>
5+
<SupportedOSPlatformVersion>12.0</SupportedOSPlatformVersion>
6+
</PropertyGroup>
7+
<Import Project="..\shared.csproj" />
8+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
6+
<ApplicationTitle>MySimpleApp</ApplicationTitle>
7+
<ApplicationId>com.xamarin.mysimpleapp</ApplicationId>
8+
<ApplicationVersion>9.0</ApplicationVersion>
9+
10+
<ExcludeNUnitLiteReference>true</ExcludeNUnitLiteReference>
11+
<ExcludeTouchUnitReference>true</ExcludeTouchUnitReference>
12+
13+
<!-- This is only to speed up the build -->
14+
<UseInterpreter Condition="!$(TargetFramework.EndsWith ('-macos'))">true</UseInterpreter>
15+
</PropertyGroup>
16+
17+
<Import Project="../../common/shared-dotnet.csproj" />
18+
19+
<ItemGroup>
20+
<Compile Include="../*.cs" />
21+
</ItemGroup>
22+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
TOP=../../../..
2+
TESTNAME=Net8_0SimpleApp
3+
TEST_TFM=net8.0
4+
include $(TOP)/tests/common/shared-dotnet.mk

0 commit comments

Comments
 (0)