-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dotnet] Use net5.0-[ios|tvos|watchos|macos] TargetFrameworks. (#9532)
* [dotnet] Set TargetPlatformSupported when the right TargetPlatformIdentifier is used. * [dotnet] Generate a list of valid OS versions for each platform, and add it to the SupportedTargetPlatform item group. The generated files: https://gist.github.com/rolfbjarne/765c4e4b38b1b017380c9378d9666317 * [dotnet] Define and set the default platform version if it's not set in the TargetFramework variable. * [dotnet] Switch to using the new-style TargetFramework values. This includes bumping spouliot/Touch.Unit to get new-style TargetFramework values for Touch.Client. * xamarin/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92) * xamarin/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91) * xamarin/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90) * xamarin/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89) * xamarin/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88) * xamarin/Touch.Unit@b157cf4 Fix a few markdown issues found by markdownlint. (#87) Diff: https://github.com/spouliot/Touch.Unit/compare/d7f55a61673e18ae5a8f9628600081a54b4e074c..89afaf7e05a942c87231cf5601b3a5b59640e218 * [dotnet] Document the script that generates the lists of the target platform versions a little bit better. * [dotnet] Make the [Platform]SupportedTargetPlatform variables public. This matches how Android and Windows do it: * dotnet/android#5007 * https://github.com/dotnet/sdk/blob/18ee4eac8b3abe6d554d2e0c39d8952da0f23ce5/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props * [xharness] Update the TargetFramework value when creating project variations.
- Loading branch information
1 parent
3b1a771
commit 4846e28
Showing
58 changed files
with
563 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
nupkgs | ||
Microsoft.*.Sdk/targets/Microsoft.*.Sdk.SupportedTargetPlatforms.props | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp | ||
|
||
// arguments are: <platform> <outputPath> | ||
|
||
using System.IO; | ||
using System.Xml; | ||
|
||
var args = Environment.GetCommandLineArgs (); | ||
var expectedArgumentCount = 2; | ||
if (args.Length != expectedArgumentCount + 2 /* 2 default arguments (executable + script) + 'expectedArgumentCount' arguments we're interested in */) { | ||
// first arg is "/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/4.5/csharp.exe" | ||
// second arg the script itself | ||
// then comes the ones we care about | ||
Console.WriteLine ($"Need {expectedArgumentCount} arguments, got {args.Length - 2}"); | ||
Environment.Exit (1); | ||
return; | ||
} | ||
|
||
var platform = args [2]; | ||
var outputPath = args [3]; | ||
var plistPath = platform == "macOS" ? "../Versions-mac.plist.in" : "../Versions-ios.plist.in"; | ||
|
||
var doc = new XmlDocument (); | ||
doc.Load (plistPath); | ||
var nodes = doc.SelectNodes ($"/plist/dict/key[text()='KnownVersions']/following-sibling::dict[1]/key[text()='{platform}']/following-sibling::array[1]/string"); | ||
|
||
using (TextWriter writer = new StreamWriter (outputPath)) { | ||
writer.WriteLine ($"<!-- This file contains a generated list of the {platform} platform versions that are supported for this SDK -->"); | ||
writer.WriteLine ($"<!-- Generation script: https://github.com/xamarin/xamarin-macios/blob/main/dotnet/generate-target-platforms.csharp -->"); | ||
writer.WriteLine ("<Project>"); | ||
writer.WriteLine ("\t<ItemGroup>"); | ||
|
||
foreach (XmlNode n in nodes) | ||
writer.WriteLine ($"\t\t<{platform}SupportedTargetPlatform Include=\"{n.InnerText}\" />"); | ||
|
||
writer.WriteLine ("\t</ItemGroup>"); | ||
writer.WriteLine ("\t<ItemGroup>"); | ||
writer.WriteLine ($"\t\t<SupportedTargetPlatform Condition=\"'$(TargetPlatformIdentifier)' == '{platform}'\" Include=\"@({platform}SupportedTargetPlatform)\" />"); | ||
writer.WriteLine ("\t</ItemGroup>"); | ||
writer.WriteLine ("</Project>"); | ||
} | ||
|
||
Environment.Exit (0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Touch.Unit
updated
from 6c5bb9 to 89afaf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.iOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-ios</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnitLite" Version="3.12.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<BundleResource Include="..\..\..\monotouch-test\basn3p08.png"> | ||
<Link>basn3p08.png</Link> | ||
</BundleResource> | ||
<BundleResource Include="..\..\..\monotouch-test\xamvideotest.mp4"> | ||
<Link>xamvideotest.mp4</Link> | ||
</BundleResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\ResourcesTest.cs" /> | ||
</ItemGroup> | ||
</Project> |
23 changes: 23 additions & 0 deletions
23
tests/BundledResources/dotnet/macOS/BundledResources.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.macOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-macos</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnitLite" Version="3.12.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<BundleResource Include="..\..\..\monotouch-test\basn3p08.png"> | ||
<Link>basn3p08.png</Link> | ||
</BundleResource> | ||
<BundleResource Include="..\..\..\monotouch-test\xamvideotest.mp4"> | ||
<Link>xamvideotest.mp4</Link> | ||
</BundleResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\ResourcesTest.cs" /> | ||
</ItemGroup> | ||
</Project> |
23 changes: 23 additions & 0 deletions
23
tests/BundledResources/dotnet/tvOS/BundledResources.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.tvOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-tvos</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnitLite" Version="3.12.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<BundleResource Include="..\..\..\monotouch-test\basn3p08.png"> | ||
<Link>basn3p08.png</Link> | ||
</BundleResource> | ||
<BundleResource Include="..\..\..\monotouch-test\xamvideotest.mp4"> | ||
<Link>xamvideotest.mp4</Link> | ||
</BundleResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\ResourcesTest.cs" /> | ||
</ItemGroup> | ||
</Project> |
23 changes: 23 additions & 0 deletions
23
tests/BundledResources/dotnet/watchOS/BundledResources.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.watchOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-watchos</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnitLite" Version="3.12.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<BundleResource Include="..\..\..\monotouch-test\basn3p08.png"> | ||
<Link>basn3p08.png</Link> | ||
</BundleResource> | ||
<BundleResource Include="..\..\..\monotouch-test\xamvideotest.mp4"> | ||
<Link>xamvideotest.mp4</Link> | ||
</BundleResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\ResourcesTest.cs" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.iOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-ios</TargetFramework> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
tests/EmbeddedResources/dotnet/macOS/EmbeddedResources.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.macOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-macos</TargetFramework> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project> | ||
<PropertyGroup> | ||
<SignAssembly>true</SignAssembly> | ||
<LangVersion>latest</LangVersion> | ||
|
||
<RootTestsDirectory>$(MSBuildThisFileDirectory)\..\..</RootTestsDirectory> | ||
<EmbeddedResourcesTestDirectory>$(RootTestsDirectory)\EmbeddedResources</EmbeddedResourcesTestDirectory> | ||
|
||
<AssemblyOriginatorKeyFile>$(RootTestsDirectory)\..\product.snk</AssemblyOriginatorKeyFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="NUnitLite" Version="3.12.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="$(EmbeddedResourcesTestDirectory)\ResourcesTest.cs" /> | ||
<Compile Include="$(RootTestsDirectory)\common\TestRuntime.cs"> | ||
<Link>TestRuntime.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="$(EmbeddedResourcesTestDirectory)\Welcome.resx"> | ||
<LogicalName>EmbeddedResources.Welcome.resources</LogicalName> | ||
</EmbeddedResource> | ||
<EmbeddedResource Include="$(EmbeddedResourcesTestDirectory)\Welcome.en-AU.resx"> | ||
<LogicalName>EmbeddedResources.Welcome.en-AU.resources</LogicalName> | ||
</EmbeddedResource> | ||
<EmbeddedResource Include="$(EmbeddedResourcesTestDirectory)\Welcome.es.resx"> | ||
<LogicalName>EmbeddedResources.Welcome.es.resources</LogicalName> | ||
</EmbeddedResource> | ||
<EmbeddedResource Include="$(EmbeddedResourcesTestDirectory)\Welcome.de.resx"> | ||
<LogicalName>EmbeddedResources.Welcome.de.resources</LogicalName> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.tvOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-tvos</TargetFramework> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
tests/EmbeddedResources/dotnet/watchOS/EmbeddedResources.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.watchOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-watchos</TargetFramework> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.iOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-ios</TargetFramework> | ||
<NativeLibName>ios-fat</NativeLibName> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.macOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-macos</TargetFramework> | ||
<NativeLibName>macos</NativeLibName> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.tvOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-tvos</TargetFramework> | ||
<NativeLibName>tvos-fat</NativeLibName> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.watchOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0-watchos</TargetFramework> | ||
<NativeLibName>watchos-fat</NativeLibName> | ||
</PropertyGroup> | ||
<Import Project="..\shared.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.iOS.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<TargetFramework>net5.0-ios</TargetFramework> | ||
</PropertyGroup> | ||
</Project> |
Oops, something went wrong.