Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net8.0] [dotnet] Add support for multi-targeting. #18931

Merged
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
9 changes: 5 additions & 4 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,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 @@ -839,10 +840,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
80 changes: 75 additions & 5 deletions Make.versions
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,81 @@ MACCATALYST_NUGET_OS_VERSION=16.4
# Basically: this should be the last OS version of the platform in question when the current major .NET version is first released to stable.
# Ref: https://github.com/dotnet/designs/blob/8e6394406d44f75f30ea2259a425cb9e38d75b69/accepted/2020/net5/net5.md#os-versions

DEFAULT_TARGET_PLATFORM_VERSION_IOS=16.1
DEFAULT_TARGET_PLATFORM_VERSION_TVOS=16.1
DEFAULT_TARGET_PLATFORM_VERSION_IOS=16.4
DEFAULT_TARGET_PLATFORM_VERSION_TVOS=16.4
DEFAULT_TARGET_PLATFORM_VERSION_WATCHOS=9.1
DEFAULT_TARGET_PLATFORM_VERSION_MACOS=13.0
DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST=16.1
DEFAULT_TARGET_PLATFORM_VERSION_MACOS=13.3
DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST=16.4

# .NET 7 versions are bumped using maestro.
DEFAULT_TARGET_PLATFORM_VERSIONS_IOS+=$(DOTNET_TFM)_$(DEFAULT_TARGET_PLATFORM_VERSION_IOS)
DEFAULT_TARGET_PLATFORM_VERSIONS_TVOS+=$(DOTNET_TFM)_$(DEFAULT_TARGET_PLATFORM_VERSION_TVOS)
DEFAULT_TARGET_PLATFORM_VERSIONS_MACOS+=$(DOTNET_TFM)_$(DEFAULT_TARGET_PLATFORM_VERSION_MACOS)
DEFAULT_TARGET_PLATFORM_VERSIONS_MACCATALYST+=$(DOTNET_TFM)_$(DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST)

# List the releases we support for each platform.
#
# Format: space-separated list of TargetFramework-OSVersion
#
# Example:
#
# SUPPORTED_API_VERSIONS_IOS=net7.0-16.1 net7.0-16.4
#
# This means the iOS workload shipped from the current branch supports projects with:
# <TargetFramework>net7.0-16.1</TargetFramework>
# and
# <TargetFramework>net7.0-16.4</TargetFramework>
# and even:
# <TargetFrameworks>net7.0-16.1;net7.0-16.4</TargetFrameworks>
#
# When shipping support for a preview Xcode, we might add entries here for a preview release into a stable release.
#
# Example:
#
# SUPPORTED_API_VERSIONS_IOS=net8.0-17.0
#
# If the current branch is stable .NET 8 using Xcode 14.3 (aka iOS 16.4), this
# would add support for trying the preview release by doing:
#
# <TargetFramework>net8.0-17.0</TargetFramework>
# <EnablePreviewFeatures>true</EnablePreviewFeatures>
#
# Note that any SUPPORTED_API_VERSIONS entry below for older OS versions need a corresponding entry in
# the eng/Version.Details.xml and eng/Versions.props files.
#
# We also need to list the default platform version for each .NET version.
# We use the DEFAULT_TARGET_PLATFORM_VERSIONS_<PLATFORM> variables for this
# purpose. The default platform version for the current branch is automatically
# added above, but we need to manually define this for older .NET versions we
# support below. The format is a space-separated list of DOTNET_TFM:DEFAULT_TARGET_PLATFORM_VERSION.
#


# First add the versions for the current branch. DO NOT TOUCH THIS. Add older branches below.

SUPPORTED_API_VERSIONS_IOS=$(DOTNET_TFM)-$(IOS_NUGET_OS_VERSION)
SUPPORTED_API_VERSIONS_TVOS=$(DOTNET_TFM)-$(TVOS_NUGET_OS_VERSION)
SUPPORTED_API_VERSIONS_MACOS=$(DOTNET_TFM)-$(MACOS_NUGET_OS_VERSION)
SUPPORTED_API_VERSIONS_MACCATALYST=$(DOTNET_TFM)-$(MACCATALYST_NUGET_OS_VERSION)

# Add older versions here!

## This is a subscription to the Xcode 13.3/14.0 version of our packages released with the initial release of .NET 7
## This also needs corresponding entries in eng/Version.Details.xml and eng/Versions.props
SUPPORTED_API_VERSIONS_IOS+=net7.0-16.0
SUPPORTED_API_VERSIONS_TVOS+=net7.0-16.0
SUPPORTED_API_VERSIONS_MACOS+=net7.0-12.3
SUPPORTED_API_VERSIONS_MACCATALYST+=net7.0-15.4

## This is a subscription to the Xcode 14.3 version of our packages
## This also needs corresponding entries in eng/Version.Details.xml and eng/Versions.props
SUPPORTED_API_VERSIONS_IOS+=net7.0-16.4
SUPPORTED_API_VERSIONS_TVOS+=net7.0-16.4
SUPPORTED_API_VERSIONS_MACOS+=net7.0-13.3
SUPPORTED_API_VERSIONS_MACCATALYST+=net7.0-16.4

# The default target platform version for each .NET version

DEFAULT_TARGET_PLATFORM_VERSIONS_IOS+=net7.0_16.4
DEFAULT_TARGET_PLATFORM_VERSIONS_TVOS+=net7.0_16.4
DEFAULT_TARGET_PLATFORM_VERSIONS_MACOS+=net7.0_13.3
DEFAULT_TARGET_PLATFORM_VERSIONS_MACCATALYST+=net7.0_16.4
42 changes: 26 additions & 16 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ $(1)_NUGET_TARGETS = \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/data/UnixFilePermissions.xml \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Sdk/AutoImport.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Sdk/Sdk.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Sdk/Sdk-error.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Sdk/Sdk-eol.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.ImplicitNamespaceImports.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.SupportedTargetPlatforms.props \
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.DefaultItems.props \
Expand Down Expand Up @@ -119,6 +121,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 +147,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 @@ -161,21 +165,20 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call ImplicitNamespaceImports,$(
define SupportedTargetPlatforms
Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.SupportedTargetPlatforms.props: $(TOP)/Versions-ios.plist.in $(TOP)/Versions-mac.plist.in Makefile ./generate-target-platforms.csharp Makefile
$(Q) rm -f $$@.tmp
$(Q) ./generate-target-platforms.csharp $(1) $$@.tmp
$(Q) ./generate-target-platforms.csharp $(1) "$(DOTNET_TFM)" "$$(SUPPORTED_API_VERSIONS_$(2))" $$@.tmp
$(Q) mv $$@.tmp $$@
endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SupportedTargetPlatforms,$(platform))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SupportedTargetPlatforms,$(platform),$(shell echo $(platform) | tr a-z A-Z))))

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)" "$$(DOTNET_$(4)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$(DOTNET_TFM)_$$($(4)_NUGET_OS_VERSION)" "$$(SUPPORTED_API_VERSIONS_$(4))" $(TOP)/eng/Versions.props
$$(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_GEN) sed \
-e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \
$$< > $$@.tmp
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-targets.csharp | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q) rm -f $$@.tmp
$$(Q_GEN) ./generate-workloadmanifest-targets.csharp "$(1)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$$(SUPPORTED_API_VERSIONS_$(4))" "$$(DEFAULT_TARGET_PLATFORM_VERSIONS_$(4))"
$$(Q) mv $$@.tmp $$@

Workloads/Microsoft.NET.Sdk.$(1)/LICENSE: $(TOP)/LICENSE | Workloads/Microsoft.NET.Sdk.$(1)
Expand Down Expand Up @@ -225,6 +228,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 @@ -235,16 +245,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 @@ -329,16 +339,16 @@ $(TMP_PKG_DIR)/$($(1)_NUGET_SDK_NAME).$2.pkg: $(SDK_PACKS_$(4)) | $(TMP_PKG_DIR)
$$(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_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_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
48 changes: 48 additions & 0 deletions dotnet/Microsoft.MacCatalyst.Sdk/Sdk/Sdk-eol.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
Sdk-eol.props

Imported only by .NET projects whose .NET version we don't support anymore (currently .NET 6), contains settings to force the error:

error NETSDK1202: The workload 'net6.0-maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

Things to note:

* $(WarningsAsErrors) includes NETSDK1202
* Force $(TargetPlatformVersion) to just be 1.0, to make it past early error messages
* _ClearMissingWorkloads prevents undesired extra error messages

-->

<Project InitialTargets="_ClearMissingWorkloads">
<PropertyGroup>
<!-- Force NETSDK1202 to be an error -->
<WarningsAsErrors>$(WarningsAsErrors);NETSDK1202</WarningsAsErrors>
<!--
Setting TargetPlatformSupported avoids this error:
error NETSDK1139: The target platform identifier maccatalyst was not recognized.
-->
<TargetPlatformSupported>true</TargetPlatformSupported>
<!--
Setting TargetPlatformVersion avoids this error:
error NU1012: Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-maccatalyst
it doesn't seem to matter which version it's set to
-->
<TargetPlatformVersion>1.0</TargetPlatformVersion>
<!-- This simplifies the logic to figure out which SDK to load in WorkloadManifest.targets -->
<_AppleSdkLoaded>true</_AppleSdkLoaded>
</PropertyGroup>
<ItemGroup>
<EolWorkload Include="net$([MSBuild]::GetTargetFrameworkVersion('$(TargetFramework)'))-$(TargetPlatformIdentifier)" Url="https://aka.ms/maui-support-policy" />
</ItemGroup>
<Target Name="_ClearMissingWorkloads">
<!--
Prevents the error:
Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147:
To build this project, the following workloads must be installed: wasm-tools-net6
To install these workloads, run the following command: dotnet workload restore
-->
<ItemGroup>
<MissingWorkloadPack Remove="@(MissingWorkloadPack)" />
</ItemGroup>
</Target>
</Project>
6 changes: 6 additions & 0 deletions dotnet/Microsoft.MacCatalyst.Sdk/Sdk/Sdk-error.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_TargetPlatformVersionNotRecognized Condition="'$(_TargetPlatformVersionNotRecognized)' == ''">true</_TargetPlatformVersionNotRecognized>
</PropertyGroup>
<Import Project="Sdk.props" />
</Project>
Loading
Loading