xamarin-macios/dotnet/generate-target-platforms.c...

44 строки
1.9 KiB
Plaintext
Исходник Обычный вид История

[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. * spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92) * spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91) * spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90) * spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89) * spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88) * spouliot/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: * https://github.com/xamarin/xamarin-android/pull/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.
2020-08-31 10:27:19 +03:00
#!/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}SdkSupportedTargetPlatformVersion Include=\"{n.InnerText}\" />");
[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. * spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92) * spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91) * spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90) * spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89) * spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88) * spouliot/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: * https://github.com/xamarin/xamarin-android/pull/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.
2020-08-31 10:27:19 +03:00
writer.WriteLine ("\t</ItemGroup>");
writer.WriteLine ("\t<ItemGroup>");
writer.WriteLine ($"\t\t<SdkSupportedTargetPlatformVersion Condition=\"'$(TargetPlatformIdentifier)' == '{platform}'\" Include=\"@({platform}SdkSupportedTargetPlatformVersion)\" />");
[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. * spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92) * spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91) * spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90) * spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89) * spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88) * spouliot/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: * https://github.com/xamarin/xamarin-android/pull/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.
2020-08-31 10:27:19 +03:00
writer.WriteLine ("\t</ItemGroup>");
writer.WriteLine ("</Project>");
}
Environment.Exit (0);