Skip to content

Commit

Permalink
[release/8.0.1xx-xcode15.0] [dotnet] Rename packs to contain target f…
Browse files Browse the repository at this point in the history
…ramework. (#20171)

This is the first step towards [multi-targeting support][1]. In order to
support multi-targeting, it must be possible to install several versions of
our packs simultaneously, and that also means that it becomes a lot easier to
visualize and work with the version we want to support if the packs were named
in a helpful way.

In particular, this PR changes the sdk, ref and runtime pack names to contain
the target framework + target platform version.

This will be the new names:

* iOS

    * Microsoft.iOS.Sdk.net8.0_17.0
    * Microsoft.iOS.Ref.net8.0_17.0
    * Microsoft.iOS.Runtime.ios-arm64.net8.0_17.0
    * Microsoft.iOS.Runtime.iossimulator-arm64.net8.0_17.0
    * Microsoft.iOS.Runtime.iossimulator-x64.net8.0_17.0

* tvOS

    * Microsoft.tvOS.Sdk.net8.0_17.0
    * Microsoft.tvOS.Ref.net8.0_17.0
    * Microsoft.tvOS.Runtime.ios-arm64.net8.0_17.0
    * Microsoft.tvOS.Runtime.iossimulator-arm64.net8.0_17.0
    * Microsoft.tvOS.Runtime.iossimulator-x64.net8.0_17.0

* Mac Catalyst

    * Microsoft.MacCatalyst.Sdk.net8.0_17.0
    * Microsoft.MacCatalyst.Ref.net8.0_17.0
    * Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net8.0_17.0
    * Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net8.0_17.0

* macOS

    * Microsoft.macOS.Sdk.net8.0_14.0
    * Microsoft.macOS.Ref.net8.0_14.0
    * Microsoft.macOS.Runtime.osx-x64.net8.0_14.0
    * Microsoft.macOS.Runtime.osx-arm64.net8.0_14.0

There are two main benefits to renaming the packs:

* It becomes a lot easier to understand which versions we support when we
  support multi-targeting. For example, say we want to support:

	* net8.0-ios17.0
	* net8.0-ios17.0
	* net9.0-ios18.0

    In this case we'd ship packs for `Microsoft.iOS.Sdk.net8.0_17.0`,
    `Microsoft.iOS.Sdk.net8.0_17.0`, `Microsoft.iOS.Sdk.net9.0_18.0` (the
    exact version number for each pack wouldn't be important).

    If we didn't change the pack names, we'd need to track the exact versions
    of the Microsoft.iOS.Sdk pack, mapping them to the correct target
    framework + target platform version we want to support.

* It'll be possible to add maestro subscriptions between versions. Given the
  previous example:

	* net8.0-ios17.0
	* net8.0-ios17.0
	* net9.0-ios18.0

	The branch producing `net9.0-ios8.0` could have a maestro subscription on
	the branches producing `net7.0-ios17.0` and `net7.0-ios17.0`,
	automatically bumping the versions whenever those branches have any
	changes.

	This would be rather annoying to keep track of and bump manually.

[1]: https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

Backport of #19765.
  • Loading branch information
rolfbjarne committed Feb 22, 2024
1 parent 3abf5a2 commit 0c3c1ef
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 57 deletions.
9 changes: 5 additions & 4 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ endif

# Create variables prefixed with the correctly cased platform name from the upper-cased platform name. This simplifies code in a few areas (whenever we foreach over DOTNET_PLATFORMS).
$(foreach platform,$(DOTNET_PLATFORMS),$(eval DOTNET_$(platform)_RUNTIME_IDENTIFIERS:=$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS)))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(platform)_NUGET_OS_VERSION:=$($(shell echo $(platform) | tr a-z A-Z)_NUGET_OS_VERSION)))

# Create a variable with all the runtime identifiers
DOTNET_RUNTIME_IDENTIFIERS=$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS))
Expand Down Expand Up @@ -847,10 +848,10 @@ DOTNET_macOS_SDK_PLATFORMS=mac
DOTNET_MacCatalyst_SDK_PLATFORMS=maccatalyst

# Misc other computed variables
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_SDK_NAME=Microsoft.$(platform).Sdk))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_REF_NAME=Microsoft.$(platform).Ref))
$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS),$(eval $(rid)_NUGET_RUNTIME_NAME=Microsoft.$(platform).Runtime.$(rid))))
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_WINDOWS_SDK_NAME=Microsoft.$(platform).Windows.Sdk))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_SDK_NAME=Microsoft.$(platform).Sdk.$(DOTNET_TFM)_$($(platform)_NUGET_OS_VERSION)))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_REF_NAME=Microsoft.$(platform).Ref.$(DOTNET_TFM)_$($(platform)_NUGET_OS_VERSION)))
$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(shell echo $(platform) | tr a-z A-Z)_RUNTIME_IDENTIFIERS),$(eval $(rid)_NUGET_RUNTIME_NAME=Microsoft.$(platform).Runtime.$(rid).$(DOTNET_TFM)_$($(platform)_NUGET_OS_VERSION))))
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_WINDOWS_SDK_NAME=Microsoft.$(platform).Windows.Sdk.$(DOTNET_TFM)_$($(platform)_NUGET_OS_VERSION)))

# Create variables prefixed with the correctly cased platform name from the upper-cased platform name. This simplifies code in a few areas (whenever we foreach over DOTNET_PLATFORMS).
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(platform)_NUGET_SDK_NAME:=$($(shell echo $(platform) | tr a-z A-Z)_NUGET_SDK_NAME)))
Expand Down
45 changes: 26 additions & 19 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ targets/Microsoft.$(1).Sdk.Versions.props: targets/Microsoft.Sdk.Versions.templa
-e 's/@DOTNET_TFM@/$(DOTNET_TFM)/g' \
-e 's/@RUNTIME_PACK_RUNTIME_IDENTIFIERS@/$(4)/g' \
-e 's/@XCODE_IS_PREVIEW@/$(XCODE_IS_PREVIEW)/g' \
-e 's/@NUGET_OS_VERSION@/$$($(2)_NUGET_OS_VERSION)/g' \
$$< > $$@.tmp
$$(Q) mv $$@.tmp $$@

Expand All @@ -144,6 +145,7 @@ Microsoft.$1.Sdk/targets/Microsoft.$1.Sdk.DefaultItems.props: targets/Microsoft.
$$(Q_GEN) sed \
-e "s/@PLATFORM@/$1/g" \
-e "s/@TARGET_FRAMEWORK_VERSION@/$(subst net,,$(DOTNET_TFM))/g" \
-e "s/@CURRENT_HASH_LONG@/$$(CURRENT_HASH_LONG)/g" \
$$< > $$@
endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call DefaultItems,$(platform))))
Expand All @@ -169,14 +171,12 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SupportedTargetPlatforms,$(
define WorkloadTargets
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q) rm -f $$@.tmp
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(5)" "$$(DOTNET_$(4)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)"
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(5)" "$$(DOTNET_$(4)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$(DOTNET_TFM)_$$($(4)_NUGET_OS_VERSION)"
$$(Q) mv $$@.tmp $$@

Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q) rm -f $$@.tmp
$$(Q_GEN) sed \
-e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \
$$< > $$@.tmp
$$(Q_GEN) ./generate-workloadmanifest-targets.csharp "$(1)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$(DOTNET_TFM)_$$($(4)_NUGET_OS_VERSION)" "net7.0" "$(DEFAULT_TARGET_PLATFORM_VERSION_$(4))"
$$(Q) mv $$@.tmp $$@

Workloads/Microsoft.NET.Sdk.$(1)/LICENSE: $(TOP)/LICENSE | Workloads/Microsoft.NET.Sdk.$(1)
Expand Down Expand Up @@ -226,6 +226,13 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call NupkgDefinition,$(platform)

# Create the nuget in a temporary directory (nupkgs/)
define CreateNuGetTemplate
nupkgs/$(1)$(4).$(DOTNET_TFM)_$($(6)_NUGET_OS_VERSION).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) .stamp-workaround-for-maccore-issue-2427
@# Delete any versions of the nuget we're building
$$(Q) rm -f nupkgs/$(1).*.nupkg
$$(Q_PACK) $(DOTNET) pack package/$(1)/package.csproj -p:VersionBand=$(5) --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog" /p:PackageOSTargetVersion=$(DOTNET_TFM)_$($(6)_NUGET_OS_VERSION)
endef

define CreateNuGetTemplateNoTargetFramework
nupkgs/$(1)$(4).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) .stamp-workaround-for-maccore-issue-2427
@# Delete any versions of the nuget we're building
$$(Q) rm -f nupkgs/$(1).*.nupkg
Expand All @@ -236,16 +243,16 @@ define CreateWindowsNuGetTemplate
nupkgs/$$($(6)_NUGET_WINDOWS_SDK_NAME).$(2).nupkg: $(3) $(WORKLOAD_TARGETS) package/$(1)/package.csproj $(wildcard package/*.csproj) $(wildcard $(DOTNET_DESTDIR)/$(1)/* $(DOTNET_DESTDIR)/$(1)/*/* $(DOTNET_DESTDIR)/$(1)/*/*/* $(DOTNET_DESTDIR)/$(1)/*/*/*/*) .stamp-workaround-for-maccore-issue-2427
@# Delete any versions of the nuget we're building
$$(Q) rm -f nupkgs/$(1).*.nupkg
$$(Q_PACK) $(DOTNET) pack package/$(1)/package.csproj --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog"
$$(Q_PACK) $(DOTNET) pack package/$(1)/package.csproj --output "$$(dir $$@)" $(DOTNET_PACK_VERBOSITY) "/bl:$$@.binlog" /p:PackageOSTargetVersion=$(DOTNET_TFM)_$($(6)_NUGET_OS_VERSION)
endef

# Create the NuGet packaging targets. It's amazing what make allows you to do...
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Sdk,$($(platform)_NUGET_VERSION_NO_METADATA),$($(platform)_NUGET_TARGETS),,$(DOTNET_VERSION_BAND))))
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call CreateWindowsNuGetTemplate,Microsoft.$(platform).Windows.Sdk,$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA),$($(platform)_WINDOWS_NUGET_TARGETS),,$(DOTNET_VERSION_BAND),$(platform))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Ref,$($(platform)_NUGET_VERSION_NO_METADATA),,,$(DOTNET_VERSION_BAND))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Templates,$($(platform)_NUGET_VERSION_NO_METADATA),,,$(DOTNET_VERSION_BAND))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.NET.Sdk.$(platform),$($(platform)_NUGET_VERSION_NO_METADATA),,.Manifest-$(MACIOS_MANIFEST_VERSION_BAND),$(MACIOS_MANIFEST_VERSION_BAND))))
$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Runtime.$(rid),$($(platform)_NUGET_VERSION_NO_METADATA),,,$(DOTNET_VERSION_BAND)))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Sdk,$($(platform)_NUGET_VERSION_NO_METADATA),$($(platform)_NUGET_TARGETS),,$(DOTNET_VERSION_BAND),$(platform))))
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call CreateWindowsNuGetTemplate,Microsoft.$(platform).Windows.Sdk,$($(shell echo $(platform) | tr '[:lower:]' '[:upper:]')_WINDOWS_NUGET_VERSION_NO_METADATA),$($(platform)_WINDOWS_NUGET_TARGETS),,$(DOTNET_VERSION_BAND),$(platform))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Ref,$($(platform)_NUGET_VERSION_NO_METADATA),,,$(DOTNET_VERSION_BAND),$(platform))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplateNoTargetFramework,Microsoft.$(platform).Templates,$($(platform)_NUGET_VERSION_NO_METADATA),,,$(DOTNET_VERSION_BAND),$(platform))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CreateNuGetTemplateNoTargetFramework,Microsoft.NET.Sdk.$(platform),$($(platform)_NUGET_VERSION_NO_METADATA),,.Manifest-$(MACIOS_MANIFEST_VERSION_BAND),$(MACIOS_MANIFEST_VERSION_BAND),$(platform))))
$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call CreateNuGetTemplate,Microsoft.$(platform).Runtime.$(rid),$($(platform)_NUGET_VERSION_NO_METADATA),,,$(DOTNET_VERSION_BAND),$(platform)))))

# Copy the nuget from the temporary directory into the final directory
$(DOTNET_NUPKG_DIR)/%.nupkg: nupkgs/%.nupkg | $(DOTNET_NUPKG_DIR)
Expand Down Expand Up @@ -319,27 +326,27 @@ define CreatePackage
$(TMP_PKG_DIR)/Microsoft.$1.Workload.$2.pkg: $($(1)_NUGET_TARGETS) $(WORKLOAD_TARGETS) Makefile | $(TMP_PKG_DIR)
$$(Q) rm -f $$@
$$(Q) rm -rf tmpdir/Microsoft.NET.Sdk.$1.$2/
$$(Q) mkdir -p tmpdir/Microsoft.NET.Sdk.$1.$2/usr/local/share/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/
$$(Q) $$(CP) -r Workloads/Microsoft.NET.Sdk.$1 tmpdir/Microsoft.NET.Sdk.$1.$2/usr/local/share/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3
$$(Q) mkdir -p tmpdir/Microsoft.NET.Sdk.$1.$2/usr/local/share/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3
$$(Q) $$(CP) -r Workloads/Microsoft.NET.Sdk.$1 tmpdir/Microsoft.NET.Sdk.$1.$2/usr/local/share/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3/$2
$$(Q_GEN) pkgbuild --quiet --version '$2' --root tmpdir/Microsoft.NET.Sdk.$1.$2 --component-plist PackageInfo.plist --install-location / --identifier com.microsoft.net.$3.workload.pkg $$@.tmp
$$(Q) mv $$@.tmp $$@

# The sdk package
$(TMP_PKG_DIR)/$($(1)_NUGET_SDK_NAME).$2.pkg: $(SDK_PACKS_$(4)) | $(TMP_PKG_DIR)
$$(Q) rm -f $$@
$$(Q) rm -rf tmpdir/Microsoft.$1.Sdk.$2/
$$(Q) mkdir -p tmpdir/Microsoft.$1.Sdk.$2/usr/local/share/dotnet/packs/Microsoft.$1.Sdk/$2/
$$(Q) $$(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/ tmpdir/Microsoft.$1.Sdk.$2/usr/local/share/dotnet/packs/Microsoft.$1.Sdk/$2/
$$(Q_GEN) pkgbuild --quiet --version '$2' --root tmpdir/Microsoft.$1.Sdk.$2 --component-plist PackageInfo.plist --install-location / --identifier com.microsoft.net.$3.sdk.pkg $$@.tmp
$$(Q) mkdir -p tmpdir/Microsoft.$1.Sdk.$2/usr/local/share/dotnet/packs/$($(1)_NUGET_SDK_NAME)/$2/
$$(Q) $$(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/ tmpdir/Microsoft.$1.Sdk.$2/usr/local/share/dotnet/packs/$($(1)_NUGET_SDK_NAME)/$2/
$$(Q_GEN) pkgbuild --quiet --version '$2' --root tmpdir/Microsoft.$1.Sdk.$2 --component-plist PackageInfo.plist --install-location / --identifier com.microsoft.net.$3.sdk.$(DOTNET_TFM)_$$($(1)_NUGET_OS_VERSION).pkg $$@.tmp
$$(Q) mv $$@.tmp $$@

# The ref package
$(TMP_PKG_DIR)/$($(1)_NUGET_REF_NAME).$2.pkg: $(REF_PACKS_$(4)) | $(TMP_PKG_DIR)
$$(Q) rm -f $$@
$$(Q) rm -rf tmpdir/Microsoft.$1.Ref.$2/
$$(Q) mkdir -p tmpdir/Microsoft.$1.Ref.$2/usr/local/share/dotnet/packs/Microsoft.$1.Ref/$2/
$$(Q_GEN) pkgbuild --quiet --version '$2' --root tmpdir/Microsoft.$1.Ref.$2 --component-plist PackageInfo.plist --install-location / --identifier com.microsoft.net.$3.ref.pkg $$@.tmp
$$(Q) $$(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_REF_NAME)/ tmpdir/Microsoft.$1.Ref.$2/usr/local/share/dotnet/packs/Microsoft.$1.Ref/$2/
$$(Q) mkdir -p tmpdir/Microsoft.$1.Ref.$2/usr/local/share/dotnet/packs/$($(1)_NUGET_REF_NAME)/$2/
$$(Q) $$(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_REF_NAME)/ tmpdir/Microsoft.$1.Ref.$2/usr/local/share/dotnet/packs/$($(1)_NUGET_REF_NAME)/$2/
$$(Q_GEN) pkgbuild --quiet --version '$2' --root tmpdir/Microsoft.$1.Ref.$2 --component-plist PackageInfo.plist --install-location / --identifier com.microsoft.net.$3.ref.$(DOTNET_TFM)_$$($(1)_NUGET_OS_VERSION).pkg $$@.tmp
$$(Q) mv $$@.tmp $$@

# The templates package
Expand Down
40 changes: 18 additions & 22 deletions dotnet/generate-workloadmanifest-json.csharp
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,43 @@
using System.IO;
using System.Xml;

var args = Environment.GetCommandLineArgs ();
var expectedArgumentCount = 6;
if (args.Length != expectedArgumentCount + 3 /* 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 - 3}");
var args = Args;
var expectedArgumentCount = 7;
if (args.Length != expectedArgumentCount) {
Console.WriteLine ($"Need {expectedArgumentCount} arguments, got {args.Length}");
Environment.Exit (1);
return;
}

var argumentIndex = 3;
var argumentIndex = 0;
var platform = args [argumentIndex++];
var version = args [argumentIndex++];
var net7Version = args [argumentIndex++];
var runtimeIdentifiers = args [argumentIndex++].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
var outputPath = args [argumentIndex++];
var windowsPlatforms = args [argumentIndex++].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
var hasWindows = Array.IndexOf (windowsPlatforms, platform) >= 0;
var currentApiVersion = args [argumentIndex++];

var platformLowerCase = platform.ToLowerInvariant ();

var tfm = currentApiVersion;
using (TextWriter writer = new StreamWriter (outputPath)) {
writer.WriteLine ($"{{");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"workloads\": {{");
writer.WriteLine ($" \"{platformLowerCase}\": {{");
writer.WriteLine ($" \"description\": \".NET SDK Workload for building {platform} applications.\",");
writer.WriteLine ($" \"packs\": [");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net8\",");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.{tfm}\",");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net7\",");
if (hasWindows) {
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net8\",");
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.{tfm}\",");
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net7\",");
}
writer.WriteLine ($" \"Microsoft.{platform}.Ref\",");
writer.WriteLine ($" \"Microsoft.{platform}.Ref.{tfm}\",");
foreach (var rid in runtimeIdentifiers) {
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}\",");
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}.{tfm}\",");
}
writer.WriteLine ($" \"Microsoft.{platform}.Templates.net8\"");
writer.WriteLine ($" ],");
Expand All @@ -58,12 +57,9 @@ using (TextWriter writer = new StreamWriter (outputPath)) {
writer.WriteLine ($" }},");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"packs\": {{");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net8\": {{");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.{tfm}\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Sdk\"");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net7\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
Expand All @@ -73,13 +69,13 @@ using (TextWriter writer = new StreamWriter (outputPath)) {
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
if (hasWindows) {
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net8\": {{");
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.{tfm}\": {{");
writer.WriteLine ($" \"kind\": \"sdk\",");
writer.WriteLine ($" \"version\": \"{version}\",");
writer.WriteLine ($" \"alias-to\": {{");
writer.WriteLine ($" \"win-x64\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-x86\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-arm64\": \"Microsoft.{platform}.Windows.Sdk\",");
writer.WriteLine ($" \"win-x64\": \"Microsoft.{platform}.Windows.Sdk.{tfm}\",");
writer.WriteLine ($" \"win-x86\": \"Microsoft.{platform}.Windows.Sdk.{tfm}\",");
writer.WriteLine ($" \"win-arm64\": \"Microsoft.{platform}.Windows.Sdk.{tfm}\",");
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net7\": {{");
Expand All @@ -92,12 +88,12 @@ using (TextWriter writer = new StreamWriter (outputPath)) {
writer.WriteLine ($" }}");
writer.WriteLine ($" }},");
}
writer.WriteLine ($" \"Microsoft.{platform}.Ref\": {{");
writer.WriteLine ($" \"Microsoft.{platform}.Ref.{tfm}\": {{");
writer.WriteLine ($" \"kind\": \"framework\",");
writer.WriteLine ($" \"version\": \"{version}\"");
writer.WriteLine ($" }},");
foreach (var rid in runtimeIdentifiers) {
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}\": {{");
writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}.{tfm}\": {{");
writer.WriteLine ($" \"kind\": \"framework\",");
writer.WriteLine ($" \"version\": \"{version}\"");
writer.WriteLine ($" }},");
Expand Down
Loading

6 comments on commit 0c3c1ef

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: 0c3c1efdc7e5ed6f89a6fb473d8d9049a021ac84 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Failed to compare API and create generator diff 🔥

Failed to update apidiff references

Pipeline on Agent
Hash: 0c3c1efdc7e5ed6f89a6fb473d8d9049a021ac84 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 1 tests failed, 234 tests passed.

Failures

❌ monotouch tests

1 tests failed, 40 tests passed.
  • monotouch-test/Mac Catalyst [dotnet]/Release (NativeAOT, x64) [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 0c3c1efdc7e5ed6f89a6fb473d8d9049a021ac84 [CI build]

Please sign in to comment.