From c7095a9b0ad394064f4b29b2eb0375c393f5d03a Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 29 Aug 2023 10:06:46 +0200 Subject: [PATCH 1/5] [release/7.0.3xx] [dotnet] Parameterize the pack names. We're going to change the pack names to support multi-targeting, so ahead of the pack name change I'm changing the existing logic to use a variable for the pack name in most places (this will make the rename much easier and simpler). These changes should have no effect by themselves. Backport of #18732. --- Make.config | 11 ++ builds/Makefile | 23 +-- dotnet/Makefile | 149 ++++++++++-------- msbuild/Makefile | 60 +++---- msbuild/Xamarin.HotRestart.PreBuilt/Makefile | 6 +- runtime/Makefile | 36 ++--- src/Makefile | 22 +-- src/Makefile.generator | 31 ++-- tests/Makefile | 6 + tests/common/Configuration.cs | 48 +----- tests/xharness/Harness.cs | 20 ++- tests/xtro-sharpie/Makefile | 4 +- tools/apidiff/Makefile | 10 +- .../devops/automation/scripts/VSTS.Tests.ps1 | 30 ++++ tools/devops/automation/scripts/VSTS.psm1 | 46 ++++++ .../scripts/bash/configure-platforms.sh | 28 ++++ tools/dotnet-linker/Makefile | 8 +- tools/mlaunch/Makefile | 24 +-- tools/mmp/Makefile | 20 +-- tools/mtouch/Makefile | 6 +- 20 files changed, 351 insertions(+), 237 deletions(-) diff --git a/Make.config b/Make.config index 68e91b86de32..3a145bf0aa2d 100644 --- a/Make.config +++ b/Make.config @@ -781,6 +781,17 @@ DOTNET_tvOS_SDK_PLATFORMS=tvsimulator tvos 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)) + +# 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))) +$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(platform)_NUGET_REF_NAME:=$($(shell echo $(platform) | tr a-z A-Z)_NUGET_REF_NAME))) +$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(platform)_NUGET_WINDOWS_SDK_NAME:=$($(shell echo $(platform) | tr a-z A-Z)_NUGET_WINDOWS_SDK_NAME))) + # A local feed to place test nugets. NUGET_TEST_FEED=$(abspath $(TOP)/tests/.nuget/packages) diff --git a/builds/Makefile b/builds/Makefile index 6a3dc90928f3..c25a5db40b26 100644 --- a/builds/Makefile +++ b/builds/Makefile @@ -787,10 +787,10 @@ $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist: $(TOP)/Versions-mac. $(Q) $(TOP)/versions-check.csharp $< "$(MIN_IOS_SDK_VERSION)" "$(MAX_IOS_DEPLOYMENT_TARGET)" "$(MIN_TVOS_SDK_VERSION)" "$(MAX_TVOS_DEPLOYMENT_TARGET)" "$(MIN_WATCH_OS_VERSION)" "$(MAX_WATCH_DEPLOYMENT_TARGET)" "$(MIN_MACOS_SDK_VERSION)" "$(MACOS_SDK_VERSION)" "$(MIN_MACCATALYST_SDK_VERSION)" "$(MACCATALYST_SDK_VERSION)" $(Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(shell cat $(MONO_MAC_SDK_DESTDIR)/mac-mono-version.txt)/g" -e "s/@MIN_XM_MONO_VERSION@/$(MIN_XM_MONO_VERSION)/g" $< > $@ -$(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk/Versions.plist: $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist | $(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk +$(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME)/Versions.plist: $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/Versions.plist | $(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME) $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk/tools/buildinfo: $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo | $(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk/tools +$(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME)/tools/buildinfo: $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo | $(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME)/tools $(Q) $(CP) $< $@ $(MAC_COMMON_DIRECTORIES): @@ -889,11 +889,14 @@ $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Versions.plist: $(TOP)/Versions-ios.plist.in $(Q) $(TOP)/versions-check.csharp $< "$(MIN_IOS_SDK_VERSION)" "$(MAX_IOS_DEPLOYMENT_TARGET)" "$(MIN_TVOS_SDK_VERSION)" "$(MAX_TVOS_DEPLOYMENT_TARGET)" "$(MIN_WATCH_OS_VERSION)" "$(MAX_WATCH_DEPLOYMENT_TARGET)" "$(MIN_MACOS_SDK_VERSION)" "$(MACOS_SDK_VERSION)" "$(MIN_MACCATALYST_SDK_VERSION)" "$(MACCATALYST_SDK_VERSION)" $(Q_GEN) sed -e 's/@XCODE_VERSION@/$(XCODE_VERSION)/g' -e "s/@MONO_VERSION@/$(shell cat $(MONO_IOS_SDK_DESTDIR)/ios-mono-version.txt)/g" $< > $@ -$(DOTNET_DESTDIR)/%.Sdk/Versions.plist: $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Versions.plist | $(DOTNET_DESTDIR)/%.Sdk - $(Q) $(CP) $< $@ +define BuildInfo +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Versions.plist: $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/Versions.plist | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME) + $(Q) $(CP) $$< $$@ -$(DOTNET_DESTDIR)/%.Sdk/tools/buildinfo: $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo | $(DOTNET_DESTDIR)/%.Sdk/tools - $(Q) $(CP) $< $@ +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/buildinfo: $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools + $(Q) $(CP) $$< $$@ +endef +$(foreach platform,$(filter-out macOS,$(DOTNET_PLATFORMS)),$(eval $(call BuildInfo,$(platform)))) $(IOS_COMMON_DIRECTORIES): $(Q) mkdir -p $@ @@ -1152,12 +1155,12 @@ install-tvos: $(TVOS_TARGETS) DOTNET_COMMON_DIRECTORIES += \ - $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET).Sdk) \ - $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET).Sdk/tools) \ + $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)) \ + $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools) \ DOTNET_COMMON_TARGETS = \ - $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET).Sdk/Versions.plist) \ - $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET).Sdk/tools/buildinfo) \ + $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/Versions.plist) \ + $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/buildinfo) \ $(DOTNET_COMMON_DIRECTORIES): $(Q) mkdir -p $@ diff --git a/dotnet/Makefile b/dotnet/Makefile index 548eb13c4947..16e173dd57c7 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -21,30 +21,30 @@ DOTNET_macOS_GLOBAL_USINGS=AppKit CoreGraphics Foundation define DefineTargets $(1)_NUGET_TARGETS = \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/data/UnixFilePermissions.xml \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/Sdk/AutoImport.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/Sdk/Sdk.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.ImplicitNamespaceImports.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.SupportedTargetPlatforms.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.DefaultItems.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.Versions.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Microsoft.$(1).Sdk.targets \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Xamarin.Shared.Sdk.DefaultItems.targets \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Xamarin.Shared.Sdk.MultiTarget.targets \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Xamarin.Shared.Sdk.Publish.targets \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Xamarin.Shared.Sdk.TargetFrameworkInference.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Xamarin.Shared.Sdk.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/Xamarin.Shared.Sdk.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)/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 \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.props \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.Versions.props \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.targets \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.DefaultItems.targets \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.MultiTarget.targets \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.Publish.targets \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.TargetFrameworkInference.props \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.props \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.targets \ endef $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call DefineTargets,$(platform)))) define DefineWindowsTargets $(1)_WINDOWS_NUGET_TARGETS = \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Windows.Sdk/Sdk/Sdk.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Windows.Sdk/targets/Microsoft.$(1).Windows.Sdk.props \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Windows.Sdk/targets/Microsoft.$(1).Windows.Sdk.targets \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME)/Sdk/Sdk.props \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME)/targets/Microsoft.$(1).Windows.Sdk.props \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME)/targets/Microsoft.$(1).Windows.Sdk.targets \ endef $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call DefineWindowsTargets,$(platform)))) @@ -52,28 +52,28 @@ $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call DefineWindowsTarget ifdef INCLUDE_HOTRESTART iOS_WINDOWS_NUGET_TARGETS += \ - $(DOTNET_DESTDIR)/Microsoft.iOS.Windows.Sdk/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip \ + $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip \ endif DIRECTORIES += \ $(DOTNET_NUPKG_DIR) \ $(DOTNET_PKG_DIR) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/data) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/Sdk) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/targets) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/data) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/Sdk) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/targets) \ $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Templates) \ $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.NET.Sdk.$(platform)) \ $(DOTNET_SDK_MANIFESTS_PATH)/$(MACIOS_MANIFEST_VERSION_BAND) \ $(DOTNET_PACKS_PATH) \ $(DOTNET_TEMPLATE_PACKS_PATH) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_PACKS_PATH)/Microsoft.$(platform).Sdk) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_PACKS_PATH)/Microsoft.$(platform).Ref) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_PACKS_PATH)/Microsoft.$(platform).Runtime.$(rid))) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_PACKS_PATH)/$($(platform)_NUGET_SDK_NAME)) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_PACKS_PATH)/$($(platform)_NUGET_REF_NAME)) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_PACKS_PATH)/$($(rid)_NUGET_RUNTIME_NAME))) \ $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_TEMPLATE_PACKS_PATH)/Microsoft.$(platform).Templates) \ $(TMP_PKG_DIR) \ - $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/Sdk) \ - $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/targets) \ + $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_WINDOWS_SDK_NAME)/Sdk) \ + $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_WINDOWS_SDK_NAME)/targets) \ $(foreach platform,$(DOTNET_PLATFORMS),Workloads/Microsoft.NET.Sdk.$(platform)) \ $(DIRECTORIES): @@ -81,16 +81,32 @@ $(DIRECTORIES): CURRENT_HASH_LONG:=$(shell git log -1 --pretty=%H) -$(DOTNET_DESTDIR)/Microsoft.%: Microsoft.% | $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/data $(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/Sdk $(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/targets $(DOTNET_DESTDIR)/Microsoft.$(platform).Templates) \ - $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/Sdk $(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/targets) + +$(DOTNET_DESTDIR)/Microsoft.%: Microsoft.% | \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/data $(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/Sdk $(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/targets $(DOTNET_DESTDIR)/Microsoft.$(platform).Templates) \ + $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_WINDOWS_SDK_NAME)/Sdk $(DOTNET_DESTDIR)/$($(platform)_NUGET_WINDOWS_SDK_NAME)/targets) $(Q) $(CP) $< $@ define CopyTargets -$$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets/%: targets/% | $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/targets +$$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/%: targets/% | $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets $$(Q) $$(CP) $$< $$@ + +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/%: Microsoft.$(1).Sdk/% | \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/data \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/Sdk \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets + $(Q) $(CP) $$< $$@ endef $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call CopyTargets,$(platform)))) +define CopyTargetsWindows +$(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME)/%: Microsoft.$(1).Windows.Sdk/% | \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME)/Sdk \ + $(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME)/targets + $(Q) $(CP) $$< $$@ +endef +$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call CopyTargetsWindows,$(platform)))) + define VersionsTemplate targets/Microsoft.$(1).Sdk.Versions.props: targets/Microsoft.Sdk.Versions.template.props Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index $$(Q_GEN) sed \ @@ -211,8 +227,11 @@ TEMPLATED_FILES = \ $(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Microsoft.$(platform).Sdk.SupportedTargetPlatforms.props) \ $(foreach platform,$(DOTNET_PLATFORMS),Microsoft.$(platform).Sdk/targets/Xamarin.Shared.Sdk.MultiTarget.targets) \ -nupkgs/$(IOS_WINDOWS_NUGET).%.nupkg: CURRENT_VERSION_NO_METADATA=$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA) -nupkgs/$(IOS_WINDOWS_NUGET).%.nupkg: CURRENT_VERSION_FULL=$(IOS_WINDOWS_NUGET_VERSION_FULL) +ifdef NupkgWindowsDefinition +nupkgs/$($(1)_NUGET_WINDOWS_SDK_NAME).%.nupkg: CURRENT_VERSION_NO_METADATA=$($(2)_WINDOWS_NUGET_VERSION_NO_METADATA) +nupkgs/$($(1)_NUGET_WINDOWS_SDK_NAME).%.nupkg: CURRENT_VERSION_FULL=$($(2)_WINDOWS_NUGET_VERSION_FULL) +endif +$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call NupkgWindowsDefinition,$(platform),$(shell echo $(platform) | tr '[:lower:]' '[:upper:]')))) define NupkgDefinition nupkgs/$($(1)_NUGET).%.nupkg: CURRENT_VERSION_NO_METADATA=$($(1)_NUGET_VERSION_NO_METADATA) @@ -229,7 +248,7 @@ nupkgs/$(1)$(4).$(2).nupkg: $(TEMPLATED_FILES) $(WORKLOAD_TARGETS) $(3) package/ endef define CreateWindowsNuGetTemplate -nupkgs/$(1).$(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 +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" @@ -237,7 +256,7 @@ 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)))) +$(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)))) @@ -248,18 +267,18 @@ $(DOTNET_NUPKG_DIR)/%.nupkg: nupkgs/%.nupkg | $(DOTNET_NUPKG_DIR) $(Q) $(CP) $< $@ ifdef INCLUDE_IOS -SDK_PACKS_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_WINDOWS_NUGET).Sdk.$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA).nupkg +SDK_PACKS_IOS_WINDOWS = $(DOTNET_NUPKG_DIR)/$(IOS_NUGET_WINDOWS_SDK_NAME).$(IOS_WINDOWS_NUGET_VERSION_NO_METADATA).nupkg SDK_PACKS_WINDOWS += $(SDK_PACKS_IOS_WINDOWS) endif pack-ios-windows: $(SDK_PACKS_IOS_WINDOWS) define PacksDefinitions -RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Runtime.$$(rid).$($(1)_NUGET_VERSION_NO_METADATA).nupkg) +RUNTIME_PACKS_$(1) = $$(foreach rid,$$(DOTNET_$(1)_RUNTIME_IDENTIFIERS),$(DOTNET_NUPKG_DIR)/$$($$(rid)_NUGET_RUNTIME_NAME).$($(1)_NUGET_VERSION_NO_METADATA).nupkg) RUNTIME_PACKS += $$(RUNTIME_PACKS_$(1)) -REF_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Ref.$($(1)_NUGET_VERSION_NO_METADATA).nupkg +REF_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET_REF_NAME).$($(1)_NUGET_VERSION_NO_METADATA).nupkg REF_PACKS += $$(REF_PACKS_$(1)) -SDK_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Sdk.$($(1)_NUGET_VERSION_NO_METADATA).nupkg +SDK_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET_SDK_NAME).$($(1)_NUGET_VERSION_NO_METADATA).nupkg SDK_PACKS += $$(SDK_PACKS_$(1)) TEMPLATE_PACKS_$(1) = $(DOTNET_NUPKG_DIR)/$($(1)_NUGET).Templates.$($(1)_NUGET_VERSION_NO_METADATA).nupkg TEMPLATE_PACKS += $$(TEMPLATE_PACKS_$(1)) @@ -281,11 +300,11 @@ define InstallWorkload $(DOTNET_SDK_MANIFESTS_PATH)/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3: .stamp-workload-replace-$1-$(DOTNET_VERSION) | $(DOTNET_SDK_MANIFESTS_PATH)/$(MACIOS_MANIFEST_VERSION_BAND) $$(Q_LN) ln -Fhs $$(abspath Workloads/Microsoft.NET.Sdk.$1) $$(abspath $$@) -$(DOTNET_PACKS_PATH)/Microsoft.$1.Sdk/$2: | $(DOTNET_PACKS_PATH)/Microsoft.$1.Sdk - $$(Q_LN) ln -Fhs $$(abspath $(DOTNET_DESTDIR)/Microsoft.$1.Sdk) $$(abspath $$@) +$(DOTNET_PACKS_PATH)/$($(1)_NUGET_SDK_NAME)/$2: | $(DOTNET_PACKS_PATH)/$($(1)_NUGET_SDK_NAME) + $$(Q_LN) ln -Fhs $$(abspath $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)) $$(abspath $$@) -$(DOTNET_PACKS_PATH)/Microsoft.$1.Ref/$2: | $(DOTNET_PACKS_PATH)/Microsoft.$1.Ref - $$(Q_LN) ln -Fhs $$(abspath $(DOTNET_DESTDIR)/Microsoft.$1.Ref) $$(abspath $$@) +$(DOTNET_PACKS_PATH)/$($(1)_NUGET_REF_NAME)/$2: | $(DOTNET_PACKS_PATH)/$($(1)_NUGET_REF_NAME) + $$(Q_LN) ln -Fhs $$(abspath $(DOTNET_DESTDIR)/$($(1)_NUGET_REF_NAME)) $$(abspath $$@) $(DOTNET_TEMPLATE_PACKS_PATH)/Microsoft.$1.Templates.$(2).nupkg: $(TEMPLATE_PACKS_$(shell echo $(1) | tr a-z A-Z)) | $(DOTNET_TEMPLATE_PACKS_PATH) $$(Q) $$(CP) $$< $$@ @@ -293,17 +312,17 @@ $(DOTNET_TEMPLATE_PACKS_PATH)/Microsoft.$1.Templates.$(2).nupkg: $(TEMPLATE_PACK WORKLOAD_TARGETS += \ $(DOTNET_TEMPLATE_PACKS_PATH)/Microsoft.$1.Templates.$(2).nupkg \ $(DOTNET_SDK_MANIFESTS_PATH)/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3 \ - $(DOTNET_PACKS_PATH)/Microsoft.$1.Sdk/$2 \ - $(DOTNET_PACKS_PATH)/Microsoft.$1.Ref/$2 + $(DOTNET_PACKS_PATH)/$($(1)_NUGET_SDK_NAME)/$2 \ + $(DOTNET_PACKS_PATH)/$($(1)_NUGET_REF_NAME)/$2 endef $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call InstallWorkload,$(platform),$($(platform)_NUGET_VERSION_NO_METADATA),$(shell echo $(platform) | tr A-Z a-z)))) define InstallRuntimeWorkload -$(DOTNET_PACKS_PATH)/Microsoft.$1.Runtime.$2/$3: | $(DOTNET_PACKS_PATH)/Microsoft.$1.Runtime.$2 - $$(Q_LN) ln -Fhs $$(abspath $(DOTNET_DESTDIR)/Microsoft.$1.Runtime.$2) $$(abspath $$@) +$(DOTNET_PACKS_PATH)/$$($(2)_NUGET_RUNTIME_NAME)/$3: | $(DOTNET_PACKS_PATH)/$$($(2)_NUGET_RUNTIME_NAME) + $$(Q_LN) ln -Fhs $$(abspath $(DOTNET_DESTDIR)/$$($(2)_NUGET_RUNTIME_NAME)) $$(abspath $$@) WORKLOAD_TARGETS += \ - $(DOTNET_PACKS_PATH)/Microsoft.$1.Runtime.$2/$3 + $(DOTNET_PACKS_PATH)/$$($(2)_NUGET_RUNTIME_NAME)/$3 endef $(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call InstallRuntimeWorkload,$(platform),$(rid),$($(platform)_NUGET_VERSION_NO_METADATA))))) @@ -321,21 +340,21 @@ $(TMP_PKG_DIR)/Microsoft.$1.Workload.$2.pkg: $($(1)_NUGET_TARGETS) $(WORKLOAD_TA $$(Q) mv $$@.tmp $$@ # The sdk package -$(TMP_PKG_DIR)/Microsoft.$1.Sdk.$2.pkg: $(SDK_PACKS_$(4)) | $(TMP_PKG_DIR) +$(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)/Microsoft.$1.Sdk/ 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) mv $$@.tmp $$@ # The ref package -$(TMP_PKG_DIR)/Microsoft.$1.Ref.$2.pkg: $(REF_PACKS_$(4)) | $(TMP_PKG_DIR) +$(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) $$(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Ref/ 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) mv $$@.tmp $$@ # The templates package @@ -348,15 +367,15 @@ $(TMP_PKG_DIR)/Microsoft.$1.Templates.$2.pkg: $(TEMPLATE_PACKS_$(4)) | $(TMP_PKG $$(Q) mv $$@.tmp $$@ # The final bundle package for distribution -$(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.pkg: $(TMP_PKG_DIR)/Microsoft.$1.Workload.$2.pkg $(TMP_PKG_DIR)/Microsoft.$1.Sdk.$2.pkg $(TMP_PKG_DIR)/Microsoft.$1.Ref.$2.pkg $(TMP_PKG_DIR)/Microsoft.$1.Templates.$2.pkg +$(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.pkg: $(TMP_PKG_DIR)/Microsoft.$1.Workload.$2.pkg $(TMP_PKG_DIR)/$($(1)_NUGET_SDK_NAME).$2.pkg $(TMP_PKG_DIR)/$($(1)_NUGET_REF_NAME).$2.pkg $(TMP_PKG_DIR)/Microsoft.$1.Templates.$2.pkg $$(Q) rm -f $$@ $$(Q_GEN) productbuild \ --quiet \ --identifier com.microsoft.net.$3.pkg \ --version '$2' \ --package $(TMP_PKG_DIR)/Microsoft.$1.Workload.$2.pkg \ - --package $(TMP_PKG_DIR)/Microsoft.$1.Sdk.$2.pkg \ - --package $(TMP_PKG_DIR)/Microsoft.$1.Ref.$2.pkg \ + --package $(TMP_PKG_DIR)/$($(1)_NUGET_SDK_NAME).$2.pkg \ + --package $(TMP_PKG_DIR)/$($(1)_NUGET_REF_NAME).$2.pkg \ --package $(TMP_PKG_DIR)/Microsoft.$1.Templates.$2.pkg \ $$@.tmp $$(Q) mv $$@.tmp $$@ @@ -370,12 +389,12 @@ PACKAGE_TARGETS += $(DOTNET_PKG_DIR)/Microsoft.$1.Bundle.$2.pkg $(TMP_PKG_DIR)/Microsoft.$1.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $(WORKLOAD_TARGETS) Makefile $(REF_PACKS_$(4)) $(SDK_PACKs_$(4)) $(TEMPLATE_PACKS_$(4)) | $(TMP_PKG_DIR) $$(Q) rm -rf $$@ $$@.tmpdir $$@.tmp $$(Q) mkdir -p $$@.tmpdir/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/ - $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk - $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref + $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/$($(1)_NUGET_SDK_NAME) + $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/$($(1)_NUGET_REF_NAME) $$(Q) mkdir -p $$@.tmpdir/dotnet/template-packs $$(Q) $(CP) -r Workloads/Microsoft.NET.Sdk.$1 $$@.tmpdir/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3 - $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk/$2 - $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Ref $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref/$2 + $$(Q) $(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME) $$@.tmpdir/dotnet/packs/$($(1)_NUGET_SDK_NAME)/$2 + $$(Q) $(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_REF_NAME) $$@.tmpdir/dotnet/packs/$($(1)_NUGET_REF_NAME)/$2 $$(Q) $(CP) $(TEMPLATE_PACKS_$(4)) $$@.tmpdir/dotnet/template-packs/$(subst +$(NUGET_BUILD_METADATA),,$(notdir $(TEMPLATE_PACKS_$(4)))) $$(Q_GEN) cd $$@.tmpdir && zip -9rq $$(abspath $$@.tmp) . $$(Q) mv $$@.tmp $$@ @@ -398,14 +417,14 @@ define CreateWindowsBundle $(TMP_PKG_DIR)/Microsoft.$1.Windows.Bundle.$2.zip: $($(1)_NUGET_TARGETS) $($(1)_WINDOWS_NUGET_TARGETS) $(WORKLOAD_TARGETS) Makefile $(REF_PACKS_$(4)) $(SDK_PACKS_$(4)) $(SDK_PACKS_$(4)_WINDOWS) $(TEMPLATE_PACKS_$(4)) | $(TMP_PKG_DIR) $$(Q) rm -rf $$@ $$@.tmpdir $$@.tmp $$(Q) mkdir -p $$@.tmpdir/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/ - $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk - $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Windows.Sdk - $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref + $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/$($(1)_NUGET_SDK_NAME) + $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/$($(1)_NUGET_WINDOWS_SDK_NAME) + $$(Q) mkdir -p $$@.tmpdir/dotnet/packs/$($(1)_NUGET_REF_NAME) $$(Q) mkdir -p $$@.tmpdir/dotnet/template-packs $$(Q) $(CP) -r Workloads/Microsoft.NET.Sdk.$1 $$@.tmpdir/dotnet/sdk-manifests/$(MACIOS_MANIFEST_VERSION_BAND)/microsoft.net.sdk.$3 - $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Sdk/$2 - $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Windows.Sdk $$@.tmpdir/dotnet/packs/Microsoft.$1.Windows.Sdk/$2 - $$(Q) $(CP) -r $(DOTNET_DESTDIR)/Microsoft.$1.Ref $$@.tmpdir/dotnet/packs/Microsoft.$1.Ref/$2 + $$(Q) $(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME) $$@.tmpdir/dotnet/packs/$($(1)_NUGET_SDK_NAME)/$2 + $$(Q) $(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_WINDOWS_SDK_NAME) $$@.tmpdir/dotnet/packs/$($(1)_NUGET_WINDOWS_SDK_NAME)/$2 + $$(Q) $(CP) -r $(DOTNET_DESTDIR)/$($(1)_NUGET_REF_NAME) $$@.tmpdir/dotnet/packs/$($(1)_NUGET_REF_NAME)/$2 $$(Q) $(CP) $(TEMPLATE_PACKS_$(4)) $$@.tmpdir/dotnet/template-packs/$(subst +$(NUGET_BUILD_METADATA),,$(notdir $(TEMPLATE_PACKS_$(4)))) $$(Q_GEN) cd $$@.tmpdir && zip -9rq $$(abspath $$@.tmp) . $$(Q) mv $$@.tmp $$@ @@ -512,7 +531,7 @@ clean-local:: $(Q) $(DOTNET) restore package/workaround-for-maccore-issue-2427/restore.csproj /bl:package/workaround-for-maccore-issue-2427/restore.binlog $(MSBUILD_VERBOSITY) $(Q) touch $@ -$(DOTNET_DESTDIR)/Microsoft.iOS.Windows.Sdk/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip: .stamp-install-workloads +$(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip: .stamp-install-workloads $(Q) $(MAKE) -C $(TOP)/msbuild/Xamarin.HotRestart.PreBuilt all $(Q) touch $@ diff --git a/msbuild/Makefile b/msbuild/Makefile index 1cbf7d8ab8a0..b7364f9026f6 100644 --- a/msbuild/Makefile +++ b/msbuild/Makefile @@ -422,15 +422,15 @@ DOTNET_MACCATALYST_FILES = $(MACCATALYST_TARGETS) FrameworkList.xml # iOS ifdef INCLUDE_IOS DOTNET_TARGETS += \ - $(foreach target,$(DOTNET_IOS_FILES) ,$(DOTNET_DESTDIR)/$(IOS_NUGET).Sdk/tools/msbuild/iOS/$(notdir $(target))) \ + $(foreach target,$(DOTNET_IOS_FILES) ,$(DOTNET_DESTDIR)/$(IOS_NUGET_SDK_NAME)/tools/msbuild/iOS/$(notdir $(target))) \ endif # tvOS: contains all of the files for iOS as well (for now, we don't need all of them, so this is optimizable) ifdef INCLUDE_TVOS DOTNET_TARGETS += \ - $(foreach target,$(DOTNET_SHARED_FILES) ,$(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/iOS/$(notdir $(target))) \ - $(foreach target,$(DOTNET_TVOS_FILES) ,$(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/tvOS/$(notdir $(target))) \ + $(foreach target,$(DOTNET_SHARED_FILES) ,$(DOTNET_DESTDIR)/$(TVOS_NUGET_SDK_NAME)/tools/msbuild/iOS/$(notdir $(target))) \ + $(foreach target,$(DOTNET_TVOS_FILES) ,$(DOTNET_DESTDIR)/$(TVOS_NUGET_SDK_NAME)/tools/msbuild/tvOS/$(notdir $(target))) \ endif @@ -445,51 +445,43 @@ endif # macOS ifdef INCLUDE_MAC DOTNET_TARGETS += \ - $(foreach target,$(DOTNET_MACOS_FILES) ,$(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk/tools/msbuild/macOS/$(notdir $(target))) \ + $(foreach target,$(DOTNET_MACOS_FILES) ,$(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME)/tools/msbuild/macOS/$(notdir $(target))) \ endif # Mac Catalyst ifdef INCLUDE_MACCATALYST DOTNET_TARGETS += \ - $(foreach target,$(DOTNET_SHARED_FILES) ,$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET).Sdk/tools/msbuild/iOS/$(notdir $(target))) \ - $(foreach target,$(DOTNET_MACCATALYST_FILES) ,$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET).Sdk/tools/msbuild/MacCatalyst/$(notdir $(target))) \ + $(foreach target,$(DOTNET_SHARED_FILES) ,$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/iOS/$(notdir $(target))) \ + $(foreach target,$(DOTNET_MACCATALYST_FILES) ,$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/MacCatalyst/$(notdir $(target))) \ endif DOTNET_DIRECTORIES += \ - $(DOTNET_DESTDIR)/$(IOS_NUGET).Sdk/tools/msbuild/iOS \ - $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS \ - $(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/iOS \ - $(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/tvOS \ - $(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/iOS \ - $(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/watchOS \ - $(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk/tools/msbuild/macOS \ - $(DOTNET_DESTDIR)/$(MACCATALYST_NUGET).Sdk/tools/msbuild/iOS \ - $(DOTNET_DESTDIR)/$(MACCATALYST_NUGET).Sdk/tools/msbuild/MacCatalyst \ - -$(DOTNET_DESTDIR)/$(MACOS_NUGET).Sdk/tools/msbuild/macOS/%: $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/msbuild/% | $(DOTNET_DIRECTORIES) + $(DOTNET_DESTDIR)/$(IOS_NUGET_SDK_NAME)/tools/msbuild/iOS \ + $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS \ + $(DOTNET_DESTDIR)/$(TVOS_NUGET_SDK_NAME)/tools/msbuild/iOS \ + $(DOTNET_DESTDIR)/$(TVOS_NUGET_SDK_NAME)/tools/msbuild/tvOS \ + $(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME)/tools/msbuild/macOS \ + $(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/iOS \ + $(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/MacCatalyst \ + +$(DOTNET_DESTDIR)/$(MACOS_NUGET_SDK_NAME)/tools/msbuild/macOS/%: $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/msbuild/% | $(DOTNET_DIRECTORIES) $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/$(IOS_NUGET).Sdk/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) +$(DOTNET_DESTDIR)/$(IOS_NUGET_SDK_NAME)/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) +$(DOTNET_DESTDIR)/$(TVOS_NUGET_SDK_NAME)/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/$(TVOS_NUGET).Sdk/tools/msbuild/tvOS/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/TVOS/% | $(DOTNET_DIRECTORIES) +$(DOTNET_DESTDIR)/$(TVOS_NUGET_SDK_NAME)/tools/msbuild/tvOS/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/TVOS/% | $(DOTNET_DIRECTORIES) $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) +$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/watchOS/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/WatchOS/% | $(DOTNET_DIRECTORIES) - $(Q) $(CP) $< $@ - -$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET).Sdk/tools/msbuild/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/% | $(DOTNET_DIRECTORIES) - $(Q) $(CP) $< $@ - -$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET).Sdk/tools/msbuild/MacCatalyst/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/MacCatalyst/% | $(DOTNET_DIRECTORIES) +$(DOTNET_DESTDIR)/$(MACCATALYST_NUGET_SDK_NAME)/tools/msbuild/MacCatalyst/%: $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/msbuild/MacCatalyst/% | $(DOTNET_DIRECTORIES) $(Q) $(CP) $< $@ MSBUILD_DIRECTORIES += $(DOTNET_DIRECTORIES) @@ -511,12 +503,12 @@ DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X86 = $(foreach file,$(IOS_WINDOWS_MOBILED DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X64 = $(foreach file,$(IOS_WINDOWS_MOBILEDEVICE_TOOLS),Xamarin.iOS.Tasks.Windows/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(WINDOWSRUNTIMEIDENTIFIER)/imobiledevice-x64/$(file).*) .copy-windows-files: .build-stamp - $(Q) mkdir -p $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS - $(Q) $(CP) $(DOTNET_IOS_WINDOWS_FILES) $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/ - $(Q) mkdir -p $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/imobiledevice-x86 - $(Q) $(CP) $(DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X86) $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/imobiledevice-x86/ - $(Q) mkdir -p $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/imobiledevice-x64 - $(Q) $(CP) $(DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X64) $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/imobiledevice-x64/ + $(Q) mkdir -p $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS + $(Q) $(CP) $(DOTNET_IOS_WINDOWS_FILES) $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/ + $(Q) mkdir -p $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/imobiledevice-x86 + $(Q) $(CP) $(DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X86) $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/imobiledevice-x86/ + $(Q) mkdir -p $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/imobiledevice-x64 + $(Q) $(CP) $(DOTNET_IOS_WINDOWS_MOBILEDEVICE_TOOLS_X64) $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/imobiledevice-x64/ .dotnet-windows: .build-stamp .copy-windows-files diff --git a/msbuild/Xamarin.HotRestart.PreBuilt/Makefile b/msbuild/Xamarin.HotRestart.PreBuilt/Makefile index 7aa162d193a5..0022a24aa322 100644 --- a/msbuild/Xamarin.HotRestart.PreBuilt/Makefile +++ b/msbuild/Xamarin.HotRestart.PreBuilt/Makefile @@ -16,10 +16,10 @@ $(TOP)/tests/dotnet/%: $(Q_GEN) $(DOTNET) build Xamarin.PreBuilt.iOS/Xamarin.PreBuilt.iOS.csproj "/bl:$(abspath ./msbuild.binlog)" $(DOTNET_BUILD_VERBOSITY) $(Q) touch $@ -$(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip: Xamarin.PreBuilt.iOS.app.zip +$(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip: Xamarin.PreBuilt.iOS.app.zip $(Q) mkdir -p $(dir $@) $(Q) $(CP) $< $@ -all-local:: $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip +all-local:: $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip -install-local:: $(DOTNET_DESTDIR)/$(IOS_WINDOWS_NUGET).Sdk/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip +install-local:: $(DOTNET_DESTDIR)/$(IOS_NUGET_WINDOWS_SDK_NAME)/tools/msbuild/iOS/Xamarin.PreBuilt.iOS.app.zip diff --git a/runtime/Makefile b/runtime/Makefile index 88a03a4e0c92..d9c231370ba5 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -586,18 +586,18 @@ DOTNET_MacCatalyst_LIBRARIES = define DotNetLibTemplate DOTNET_TARGETS += \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet.dylib \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet-debug.dylib \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet.a \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet-debug.a \ - $$(foreach lib,$$(DOTNET_$(1)_LIBRARIES),$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/$$(lib)) \ - $$(foreach header,$$(SHIPPED_HEADERS),$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/$$(header)) \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet.dylib \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet-debug.dylib \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet.a \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet-debug.a \ + $$(foreach lib,$$(DOTNET_$(1)_LIBRARIES),$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/$$(lib)) \ + $$(foreach header,$$(SHIPPED_HEADERS),$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/$$(header)) \ DOTNET_TARGET_DIRS += \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/xamarin \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/xamarin \ -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/xamarin/%.h: xamarin/%.h | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/xamarin +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/xamarin/%.h: xamarin/%.h | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/xamarin $$(Q) $$(CP) $$< $$@ endef @@ -605,10 +605,10 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIM define DotNetCoreClrLibTemplate DOTNET_TARGETS += \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet-coreclr.a \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet-coreclr-debug.a \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet-coreclr.dylib \ - $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-dotnet-coreclr-debug.dylib \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet-coreclr.a \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet-coreclr-debug.a \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet-coreclr.dylib \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-dotnet-coreclr-debug.dylib \ endef @@ -627,7 +627,7 @@ DOTNET_mac_DYLIB_FLAGS=-lcoreclr # define DotNetInstallLibTemplate -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-%.dylib: $$(foreach arch,$(3),.libs/$(4)/libxamarin-%.$$(arch).dylib) | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-%.dylib: $$(foreach arch,$(3),.libs/$(4)/libxamarin-%.$$(arch).dylib) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native ifeq (1,$$(words $(3))) $(Q) $(CP) $$^ $$@ else @@ -635,28 +635,28 @@ else endif $(Q) install_name_tool -id @rpath/libxamarin-$$*.dylib $$@ -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libxamarin-%.a: $$(foreach arch,$(3),.libs/$(4)/libxamarin-%.$$(arch).a) | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-%.a: $$(foreach arch,$(3),.libs/$(4)/libxamarin-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native ifeq (1,$$(words $(3))) $(Q) $(CP) $$^ $$@ else $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ endif -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libapp-%.a: $$(foreach arch,$(3),.libs/$(4)/libapp-%.$$(arch).a) | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libapp-%.a: $$(foreach arch,$(3),.libs/$(4)/libapp-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native ifeq (1,$$(words $(3))) $(Q) $(CP) $$^ $$@ else $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ endif -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libextension-%.a: $$(foreach arch,$(3),.libs/$(4)/libextension-%.$$(arch).a) | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libextension-%.a: $$(foreach arch,$(3),.libs/$(4)/libextension-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native ifeq (1,$$(words $(3))) $(Q) $(CP) $$^ $$@ else $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ endif -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/libtvextension-%.a: $$(foreach arch,$(3),.libs/$(4)/libtvextension-%.$$(arch).a) | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libtvextension-%.a: $$(foreach arch,$(3),.libs/$(4)/libtvextension-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native ifeq (1,$$(words $(3))) $(Q) $(CP) $$^ $$@ else diff --git a/src/Makefile b/src/Makefile index c33b676f42f5..6816264456da 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1189,16 +1189,16 @@ $($(2)_DOTNET_BUILD_DIR)/$(3).rsp: Makefile Makefile.generator frameworks.source DOTNET_TARGETS += \ $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll \ - $(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM)/Microsoft.$(1).dll \ - $(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM)/Microsoft.$(1).xml \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).dll \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).xml \ DOTNET_TARGETS_DIRS += \ $($(2)_DOTNET_BUILD_DIR) \ $($(2)_DOTNET_BUILD_DIR)/generated-sources \ $($(2)_DOTNET_BUILD_DIR)/ref \ $($(2)_DOTNET_BUILD_DIR)/doc \ - $(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM) \ - $(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/doc/$(DOTNET_TFM) \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM) \ + $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/doc/$(DOTNET_TFM) \ dotnet-gen-$(3):: $($(2)_DOTNET_BUILD_DIR)/$(3)-generated-sources dotnet-gen:: dotnet-gen-$(3) @@ -1209,10 +1209,10 @@ $($(2)_DOTNET_BUILD_DIR)/ILLink.LinkAttributes.xml: $(TOP)/src/ILLink.LinkAttrib $($(2)_DOTNET_BUILD_DIR)/ILLink.Substitutions.xml: $(TOP)/src/ILLink.Substitutions.$(1).xml | $($(2)_DOTNET_BUILD_DIR) $(Q) $(CP) $$< $$@ -$(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM)/Microsoft.$(1).dll: $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll | $(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM) +$(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).dll: $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll | $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM) $(Q) $(CP) $$< $$@ -$(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM)/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml | $(DOTNET_DESTDIR)/$($(2)_NUGET).Ref/ref/$(DOTNET_TFM) +$(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml | $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM) $(Q) $(CP) $$< $$@ $($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll | $($(2)_DOTNET_BUILD_DIR)/doc @@ -1274,17 +1274,17 @@ dotnet-$(3):: $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).dll DOTNET_TARGETS += \ $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).dll \ - $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).dll) \ - $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).pdb) \ + $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).dll) \ + $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).pdb) \ DOTNET_TARGETS_DIRS += \ $($(2)_DOTNET_BUILD_DIR)/$(4) \ - $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)) \ + $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)) \ -$(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).dll): $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).dll | $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)) +$(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).dll): $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).dll | $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)) $(Q) $(CP) $$< $$@ -$(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).pdb): $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).pdb | $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(2)_NUGET).Runtime.$(rid)/runtimes/$(rid)/lib/$(DOTNET_TFM)) +$(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)/Microsoft.$(1).pdb): $($(2)_DOTNET_BUILD_DIR)/$(4)/Microsoft.$(1).pdb | $(foreach rid,$(DOTNET_$(2)_RUNTIME_IDENTIFIERS_$(4)),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/lib/$(DOTNET_TFM)) $(Q) $(CP) $$< $$@ endef diff --git a/src/Makefile.generator b/src/Makefile.generator index 09b9ad99314f..38dae5ff3650 100644 --- a/src/Makefile.generator +++ b/src/Makefile.generator @@ -21,29 +21,32 @@ $(DOTNET_BUILD_DIR)/bgen/bgen: $(generator_dependencies) Makefile.generator $(B $(Q) chmod +x $@ -$(DOTNET_DESTDIR)/%.Sdk/tools/lib/bgen/bgen: $(DOTNET_BUILD_DIR)/bgen/bgen | $(DOTNET_DESTDIR)/%.Sdk/tools/lib/bgen - $(Q) rm -Rf "$(dir $@)" - $(Q) $(CP) -r "$(dir $<)" "$(dir $@)" +define BGenTargets +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib/bgen/bgen: $(DOTNET_BUILD_DIR)/bgen/bgen | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib/bgen + $$(Q) rm -Rf "$$(dir $$@)" + $$(Q) $$(CP) -r "$$(dir $$<)" "$$(dir $$@)" -$(DOTNET_DESTDIR)/%.Sdk/tools/bin/bgen: bgen/bgen.dotnet | $(DOTNET_DESTDIR)/%.Sdk/tools/bin - $(Q) $(CP) $< $@ +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin/bgen: bgen/bgen.dotnet | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin + $$(Q) $$(CP) $$< $$@ -$(DOTNET_DESTDIR)/%.Sdk/tools/lib/Xamarin.Apple.BindingAttributes.dll: $(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dll | $(DOTNET_DESTDIR)/%.Sdk/tools/lib - $(Q) $(CP) $< $@ - $(Q) $(CP) $(<:.dll=.pdb) $(@:.dll=.pdb) +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib/Xamarin.Apple.BindingAttributes.dll: $(DOTNET_BUILD_DIR)/Xamarin.Apple.BindingAttributes.dll | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib + $$(Q) $$(CP) $$< $$@ + $$(Q) $$(CP) $$(<:.dll=.pdb) $$(@:.dll=.pdb) +endef +$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call BGenTargets,$(platform)))) DOTNET_TARGETS += \ $(DOTNET_BUILD_DIR)/bgen/bgen \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/bin/bgen) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib/bgen/bgen) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib/Xamarin.Apple.BindingAttributes.dll) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/bin/bgen) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/lib/bgen/bgen) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/lib/Xamarin.Apple.BindingAttributes.dll) \ DOTNET_TARGETS_DIRS += \ $(DOTNET_BUILD_DIR) \ $(DOTNET_BUILD_DIR)/bgen \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/bin) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/lib/bgen) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/bin) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/lib) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/lib/bgen) \ # # Common diff --git a/tests/Makefile b/tests/Makefile index 6c199ea4dbd5..01fe7c57847b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -80,6 +80,9 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De @echo "INCLUDE_MAC=$(INCLUDE_MAC)" >> $@ @echo "INCLUDE_MACCATALYST=$(INCLUDE_MACCATALYST)" >> $@ @echo "IOS_SUPPORTS_32BIT_ARCHITECTURES=$(IOS_SUPPORTS_32BIT_ARCHITECTURES)" >> $@ + @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_SDK_NAME=$($(platform)_NUGET_SDK_NAME)\\n)" | sed 's/^ //' >> $@ + @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME)\\n)" | sed 's/^ //' >> $@ + @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.Details.xml @rm -f $@ @@ -108,6 +111,9 @@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Ver @echo "INCLUDE_MAC=$(INCLUDE_MAC)" >> $@ @echo "INCLUDE_MACCATALYST=$(INCLUDE_MACCATALYST)" >> $@ @echo "IOS_SUPPORTS_32BIT_ARCHITECTURES=$(IOS_SUPPORTS_32BIT_ARCHITECTURES)" >> $@ + @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_SDK_NAME=$($(platform)_NUGET_SDK_NAME)\\n)" | sed 's/^ //' >> $@ + @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME)\\n)" | sed 's/^ //' >> $@ + @printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@ clean-local:: $(Q) $(SYSTEM_XBUILD) /t:Clean /p:Platform=iPhoneSimulator /p:Configuration=$(CONFIG) $(XBUILD_VERBOSITY) tests.sln diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index d1aa7ed56bc9..debd1743001b 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -452,36 +452,14 @@ public static string SdkRoot { static string GetRefNuGetName (ApplePlatform platform) { - switch (platform) { - case ApplePlatform.iOS: - return "Microsoft.iOS.Ref"; - case ApplePlatform.MacCatalyst: - return "Microsoft.MacCatalyst.Ref"; - case ApplePlatform.TVOS: - return "Microsoft.tvOS.Ref"; - case ApplePlatform.WatchOS: - return "Microsoft.watchOS.Ref"; - case ApplePlatform.MacOSX: - return "Microsoft.macOS.Ref"; - default: - throw new InvalidOperationException (platform.ToString ()); - } + var variableName = platform.AsString ().ToUpper () + "_NUGET_REF_NAME"; + return GetVariable (variableName, variableName + " not found"); } static string GetRuntimeNuGetName (ApplePlatform platform, string runtimeIdentifier) { - switch (platform) { - case ApplePlatform.iOS: - return "Microsoft.iOS.Runtime." + runtimeIdentifier; - case ApplePlatform.TVOS: - return "Microsoft.tvOS.Runtime." + runtimeIdentifier; - case ApplePlatform.MacCatalyst: - return "Microsoft.MacCatalyst.Runtime." + runtimeIdentifier; - case ApplePlatform.MacOSX: - return "Microsoft.macOS.Runtime." + runtimeIdentifier; - default: - throw new InvalidOperationException (platform.ToString ()); - } + var variableName = runtimeIdentifier + "_NUGET_RUNTIME_NAME"; + return GetVariable (variableName, variableName + " not found"); } static string GetSdkNuGetName (TargetFramework targetFramework) @@ -489,22 +467,10 @@ static string GetSdkNuGetName (TargetFramework targetFramework) return GetSdkNuGetName (targetFramework.Platform); } - static string GetSdkNuGetName (ApplePlatform platform) + public static string GetSdkNuGetName (ApplePlatform platform) { - switch (platform) { - case ApplePlatform.iOS: - return "Microsoft.iOS.Sdk"; - case ApplePlatform.TVOS: - return "Microsoft.tvOS.Sdk"; - case ApplePlatform.WatchOS: - return "Microsoft.watchOS.Sdk"; - case ApplePlatform.MacOSX: - return "Microsoft.macOS.Sdk"; - case ApplePlatform.MacCatalyst: - return "Microsoft.MacCatalyst.Sdk"; - default: - throw new InvalidOperationException (platform.ToString ()); - } + var variableName = platform.AsString ().ToUpper () + "_NUGET_SDK_NAME"; + return GetVariable (variableName, variableName + " not found"); } public static string GetDotNetRoot () diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index e510f5c60283..0bc412be058e 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -14,6 +14,8 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; using Xharness.Targets; +using Xamarin.Utils; + namespace Xharness { public enum HarnessAction { None, @@ -106,18 +108,22 @@ string SdkRoot { string MlaunchPath { get { if (ENABLE_DOTNET) { - string platform; + ApplePlatform platform; if (INCLUDE_IOS) { - platform = "iOS"; + platform = ApplePlatform.iOS; } else if (INCLUDE_TVOS) { - platform = "tvOS"; + platform = ApplePlatform.TVOS; } else { return $"Not building any mobile platform, so can't provide a location to mlaunch."; } - var mlaunchPath = Path.Combine (DOTNET_DIR, "packs"); - mlaunchPath = Path.Combine (mlaunchPath, $"Microsoft.{platform}.Sdk", config [$"{platform.ToUpperInvariant ()}_NUGET_VERSION_NO_METADATA"]); - mlaunchPath = Path.Combine (mlaunchPath, "tools", "bin", "mlaunch"); - return mlaunchPath; + var sdkPlatform = platform.AsString ().ToUpperInvariant (); + var sdkName = GetVariable ($"{sdkPlatform}_NUGET_SDK_NAME"); + // there is a diff between getting the path for the current platform when running on CI or off CI. The config files in the CI do not + // contain the correct workload version, the reason for this is that the workload is built in a different machine which means that + // the Make.config will use the wrong version. The CI set the version in the environment variable {platform}_WORKLOAD_VERSION via a script. + var workloadVersion = GetVariable ($"{sdkPlatform}_WORKLOAD_VERSION"); + var sdkVersion = GetVariable ($"{sdkPlatform}_NUGET_VERSION_NO_METADATA"); + return Path.Combine (DOTNET_DIR, "packs", sdkName, string.IsNullOrEmpty (workloadVersion) ? sdkVersion : workloadVersion, "tools", "bin", "mlaunch"); } else if (INCLUDE_XAMARIN_LEGACY && INCLUDE_IOS) { return Path.Combine (IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current", "bin", "mlaunch"); } diff --git a/tests/xtro-sharpie/Makefile b/tests/xtro-sharpie/Makefile index d73a367ee204..6adb54769194 100644 --- a/tests/xtro-sharpie/Makefile +++ b/tests/xtro-sharpie/Makefile @@ -118,9 +118,9 @@ $(XMACCATALYST_PCH): .stamp-check-sharpie define DotNetAssembly ifdef TESTS_USE_SYSTEM -X$(2)_DOTNET ?= $(DOTNET_DIR)/packs/Microsoft.$(1).Runtime.$(X$(2)_RID)/$($(2)_WORKLOAD_VERSION)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll +X$(2)_DOTNET ?= $(DOTNET_DIR)/packs/$($(X$(2)_RID)_NUGET_RUNTIME_NAME)/$($(2)_WORKLOAD_VERSION)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll else -X$(2)_DOTNET ?= $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(X$(2)_RID)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll +X$(2)_DOTNET ?= $(DOTNET_DESTDIR)/$($(X$(2)_RID)_NUGET_RUNTIME_NAME)/runtimes/$(X$(2)_RID)/lib/$(DOTNET_TFM)/$(DOTNET_$(2)_ASSEMBLY_NAME).dll endif dotnet-$(1)-$($(2)_SDK_VERSION).g.cs: .stamp-check-sharpie diff --git a/tools/apidiff/Makefile b/tools/apidiff/Makefile index b5e860555d1e..a38ed148a542 100644 --- a/tools/apidiff/Makefile +++ b/tools/apidiff/Makefile @@ -118,9 +118,13 @@ $(APIDIFF_DIR)/temp/dotnet/legacy-diff/%.xml: $(DOTNET_DESTDIR)/%.dll $(MONO_API $(Q) mkdir -p $(dir $@) $(QF_GEN) $(MONO_API_INFO_EXEC) $(abspath $<) -o $(abspath $@) -$(APIDIFF_DIR)/temp/dotnet/%.xml: $(DOTNET_DESTDIR)/%.dll $(MONO_API_INFO) - $(Q) mkdir -p $(dir $@) - $(QF_GEN) $(MONO_API_INFO_EXEC) $(abspath $<) -o $(abspath $@) +define DotNetApiInfo +$(APIDIFF_DIR)/temp/dotnet/Microsoft.$(1).Ref/ref/$(DOTNET_TFM)/Microsoft.$(1).xml: $(DOTNET_DESTDIR)/$($(1)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).dll $(MONO_API_INFO) + $$(Q) mkdir -p $$(dir $$@) + $$(QF_GEN) $(MONO_API_INFO_EXEC) $$(abspath $$<) -o $$(abspath $$@) +endef + +$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call DotNetApiInfo,$(platform)))) # create diff from api info and reference info # note that we create an empty file (the 'touch' command) diff --git a/tools/devops/automation/scripts/VSTS.Tests.ps1 b/tools/devops/automation/scripts/VSTS.Tests.ps1 index 718ab418919c..8bd1090a66e6 100644 --- a/tools/devops/automation/scripts/VSTS.Tests.ps1 +++ b/tools/devops/automation/scripts/VSTS.Tests.ps1 @@ -192,6 +192,11 @@ Describe 'New-BuildConfiguration' { "BUILD_SOURCEVERSION" = "BUILD_SOURCEVERSION" "CONFIGURE_PLATFORMS_DOTNET_PLATFORMS" = "iOS tvOS" "CONFIGURE_PLATFORMS_INCLUDE_DOTNET_TVOS" = "true" + "CONFIGURE_PLATFORMS_DOTNET_IOS_RUNTIME_IDENTIFIERS" = "ios-arm64"; + "CONFIGURE_PLATFORMS_DOTNET_TVOS_RUNTIME_IDENTIFIERS" = "tvos-arm64"; + "CONFIGURE_PLATFORMS_IOS_NUGET_SDK_NAME" = "iOSNuGetSdkName"; + "CONFIGURE_PLATFORMS_TVOS_NUGET_REF_NAME" = "tvOSNuGetRefName"; + "CONFIGURE_PLATFORMS_ios-arm64_NUGET_RUNTIME_NAME" = "iOSNuGetRuntimeName"; "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI" = "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"; "SYSTEM_TEAMPROJECT" = "SYSTEM_TEAMPROJECT"; } @@ -212,7 +217,17 @@ Describe 'New-BuildConfiguration' { ""BuildId"": ""BUILD_BUILDID"", ""DOTNET_PLATFORMS"": ""iOS tvOS"", ""INCLUDE_DOTNET_IOS"": null, + ""IOS_NUGET_VERSION_NO_METADATA"": null, + ""IOS_NUGET_SDK_NAME"": ""iOSNuGetSdkName"", + ""IOS_NUGET_REF_NAME"": null, + ""DOTNET_IOS_RUNTIME_IDENTIFIERS"": ""ios-arm64"", + ""ios-arm64_NUGET_RUNTIME_NAME"": ""iOSNuGetRuntimeName"", ""INCLUDE_DOTNET_TVOS"": ""true"", + ""TVOS_NUGET_VERSION_NO_METADATA"": null, + ""TVOS_NUGET_SDK_NAME"": null, + ""TVOS_NUGET_REF_NAME"": ""tvOSNuGetRefName"", + ""DOTNET_TVOS_RUNTIME_IDENTIFIERS"": ""tvos-arm64"", + ""tvos-arm64_NUGET_RUNTIME_NAME"": null, ""Commit"": ""BUILD_SOURCEVERSION"", ""Tags"": [ ""ciBuild"", @@ -238,7 +253,17 @@ Describe 'New-BuildConfiguration' { ""BuildId"": ""BUILD_BUILDID"", ""DOTNET_PLATFORMS"": ""iOS tvOS"", ""INCLUDE_DOTNET_IOS"": null, + ""IOS_NUGET_VERSION_NO_METADATA"": null, + ""IOS_NUGET_SDK_NAME"": ""iOSNuGetSdkName"", + ""IOS_NUGET_REF_NAME"": null, + ""DOTNET_IOS_RUNTIME_IDENTIFIERS"": ""ios-arm64"", + ""ios-arm64_NUGET_RUNTIME_NAME"": ""iOSNuGetRuntimeName"", ""INCLUDE_DOTNET_TVOS"": ""true"", + ""TVOS_NUGET_VERSION_NO_METADATA"": null, + ""TVOS_NUGET_SDK_NAME"": null, + ""TVOS_NUGET_REF_NAME"": ""tvOSNuGetRefName"", + ""DOTNET_TVOS_RUNTIME_IDENTIFIERS"": ""tvos-arm64"", + ""tvos-arm64_NUGET_RUNTIME_NAME"": null, ""Commit"": ""BUILD_SOURCEVERSION"", ""Tags"": [ ""ciBuild"", @@ -261,6 +286,11 @@ Describe 'Import-BuildConfiguration' { ""DOTNET_PLATFORMS"": ""iOS tvOS"", ""INCLUDE_DOTNET_IOS"": null, ""INCLUDE_DOTNET_TVOS"": ""true"", + ""DOTNET_IOS_RUNTIME_IDENTIFIERS"": ""ios-arm64"", + ""DOTNET_TVOS_RUNTIME_IDENTIFIERS"": ""tvos-arm64"", + ""IOS_NUGET_SDK_NAME"": ""iOSNuGetSdkName"", + ""TVOS_NUGET_REF_NAME"": ""tvOSNuGetRefName"", + ""ios-arm64_NUGET_RUNTIME_NAME"": ""iOSNuGetRuntimeName"", ""Commit"": ""BUILD_SOURCEVERSION"", ""Tags"": [ ""ciBuild"", diff --git a/tools/devops/automation/scripts/VSTS.psm1 b/tools/devops/automation/scripts/VSTS.psm1 index 37cef4d381b1..5ac12a033f32 100644 --- a/tools/devops/automation/scripts/VSTS.psm1 +++ b/tools/devops/automation/scripts/VSTS.psm1 @@ -259,6 +259,29 @@ class BuildConfiguration { $variableName = "INCLUDE_DOTNET_$($platform.ToUpper())" $variableValue = $config.$variableName Write-Host "##vso[task.setvariable variable=$variableName;isOutput=true]$variableValue" + + $variableName = "$($platform.ToUpper())_NUGET_VERSION_NO_METADATA" + $variableValue = $config.$variableName + Write-Host "##vso[task.setvariable variable=$variableName;isOutput=true]$variableValue" + + $variableName = "$($platform.ToUpper())_NUGET_SDK_NAME" + $variableValue = $config.$variableName + Write-Host "##vso[task.setvariable variable=$variableName;isOutput=true]$variableValue" + + $variableName = "$($platform.ToUpper())_NUGET_REF_NAME" + $variableValue = $config.$variableName + Write-Host "##vso[task.setvariable variable=$variableName;isOutput=true]$variableValue" + + $variableName = "DOTNET_$($platform.ToUpper())_RUNTIME_IDENTIFIERS" + $variableValue = $config.$variableName + Write-Host "##vso[task.setvariable variable=$variableName;isOutput=true]$variableValue" + + $rids = $variableValue.Split(' ', [StringSplitOptions]::RemoveEmptyEntries) + foreach ($rid in $rids) { + $variableName = "$($rid)_NUGET_RUNTIME_NAME" + $variableValue = $config.$variableName + Write-Host "##vso[task.setvariable variable=$variableName;isOutput=true]$variableValue" + } } return $config @@ -281,6 +304,29 @@ class BuildConfiguration { $variableName = "INCLUDE_DOTNET_$($platform.ToUpper())" $variableValue = [Environment]::GetEnvironmentVariable("CONFIGURE_PLATFORMS_$variableName") $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue + + $variableName = "$($platform.ToUpper())_NUGET_VERSION_NO_METADATA" + $variableValue = [Environment]::GetEnvironmentVariable("CONFIGURE_PLATFORMS_$variableName") + $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue + + $variableName = "$($platform.ToUpper())_NUGET_SDK_NAME" + $variableValue = [Environment]::GetEnvironmentVariable("CONFIGURE_PLATFORMS_$variableName") + $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue + + $variableName = "$($platform.ToUpper())_NUGET_REF_NAME" + $variableValue = [Environment]::GetEnvironmentVariable("CONFIGURE_PLATFORMS_$variableName") + $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue + + $variableName = "DOTNET_$($platform.ToUpper())_RUNTIME_IDENTIFIERS" + $variableValue = [Environment]::GetEnvironmentVariable("CONFIGURE_PLATFORMS_$variableName") + $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue + + $rids = $variableValue.Split(' ', [StringSplitOptions]::RemoveEmptyEntries) + foreach ($rid in $rids) { + $variableName = "$($rid)_NUGET_RUNTIME_NAME" + $variableValue = [Environment]::GetEnvironmentVariable("CONFIGURE_PLATFORMS_$variableName") + $configuration | Add-Member -NotePropertyName $variableName -NotePropertyValue $variableValue + } } # calculate the commit to later share it with the cascade pipelines diff --git a/tools/devops/automation/scripts/bash/configure-platforms.sh b/tools/devops/automation/scripts/bash/configure-platforms.sh index 7cce4e2491bd..d90dac8e2001 100755 --- a/tools/devops/automation/scripts/bash/configure-platforms.sh +++ b/tools/devops/automation/scripts/bash/configure-platforms.sh @@ -42,6 +42,34 @@ for platform in $DOTNET_PLATFORMS; do PLATFORM_UPPER=$(echo "$platform" | tr '[:lower:]' '[:upper:]') echo "##vso[task.setvariable variable=INCLUDE_DOTNET_$PLATFORM_UPPER;isOutput=true]1" DISABLED_DOTNET_PLATFORMS=${DISABLED_DOTNET_PLATFORMS/ $platform / } + + VARIABLE="${PLATFORM_UPPER}_NUGET_VERSION_NO_METADATA" + make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE="$VARIABLE" + VALUE=$(cat "$FILE") + echo "##vso[task.setvariable variable=$VARIABLE;isOutput=true]$VALUE" + + VARIABLE="${PLATFORM_UPPER}_NUGET_SDK_NAME" + make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE="$VARIABLE" + VALUE=$(cat "$FILE") + echo "##vso[task.setvariable variable=$VARIABLE;isOutput=true]$VALUE" + + VARIABLE="${PLATFORM_UPPER}_NUGET_REF_NAME" + make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE="$VARIABLE" + VALUE=$(cat "$FILE") + echo "##vso[task.setvariable variable=$VARIABLE;isOutput=true]$VALUE" + + VARIABLE="DOTNET_${PLATFORM_UPPER}_RUNTIME_IDENTIFIERS" + make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE="$VARIABLE" + VALUE=$(cat "$FILE") + echo "##vso[task.setvariable variable=$VARIABLE;isOutput=true]$VALUE" + + RIDS=$VALUE + for rid in $RIDS; do + VARIABLE="${rid}_NUGET_RUNTIME_NAME" + make -C "$BUILD_SOURCESDIRECTORY/xamarin-macios/tools/devops" print-variable-value-to-file FILE="$FILE" VARIABLE="$VARIABLE" + VALUE=$(cat "$FILE") + echo "##vso[task.setvariable variable=$VARIABLE;isOutput=true]$VALUE" + done done for platform in $DISABLED_DOTNET_PLATFORMS; do PLATFORM_UPPER=$(echo "$platform" | tr '[:lower:]' '[:upper:]') diff --git a/tools/dotnet-linker/Makefile b/tools/dotnet-linker/Makefile index 87b240fac102..6d47d1e9b4c3 100644 --- a/tools/dotnet-linker/Makefile +++ b/tools/dotnet-linker/Makefile @@ -7,11 +7,11 @@ BUILD_DIR=bin/Debug/net7.0 DOTNET_TARGETS += \ $(BUILD_DIR)/dotnet-linker.dll \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/dotnet-linker/dotnet-linker.dll) \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/dotnet-linker/dotnet-linker.pdb) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/dotnet-linker/dotnet-linker.dll) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/dotnet-linker/dotnet-linker.pdb) \ DOTNET_DIRECTORIES += \ - $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Sdk/tools/dotnet-linker) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/dotnet-linker) \ # dotnet-linker.csproj.inc contains the dotnet_linker_dependencies variable used to determine if mtouch needs to be rebuilt or not. dotnet-linker.csproj.inc: export BUILD_EXECUTABLE=$(DOTNET) build @@ -24,7 +24,7 @@ $(BUILD_DIR)/dotnet-linker%dll $(BUILD_DIR)/dotnet-linker%pdb: Makefile $(dotnet $(Q) touch $(BUILD_DIR)/dotnet-linker.dll $(BUILD_DIR)/dotnet-linker.pdb define InstallTemplate -$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/dotnet-linker/%: $(BUILD_DIR)/% | $(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/dotnet-linker +$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/dotnet-linker/%: $(BUILD_DIR)/% | $(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/dotnet-linker $$(Q) $$(CP) $$< $$@ endef $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call InstallTemplate,$(platform)))) diff --git a/tools/mlaunch/Makefile b/tools/mlaunch/Makefile index aaa4aa5a1454..f5ffbec0e404 100644 --- a/tools/mlaunch/Makefile +++ b/tools/mlaunch/Makefile @@ -31,14 +31,14 @@ $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mla define DotNetInstall $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/bin/mlaunch: $$(DOWNLOAD_STAMP_FILE) - $$(Q) rm -rf $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/bin/mlaunch - $$(Q) rm -rf $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/lib/mlaunch - $$(Q) mkdir -p $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/bin - $$(Q) mkdir -p $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/lib - $$(Q) $$(CP) -R $(TOP)/packages/microsoft.tools.mlaunch/$$(MLAUNCH_NUGET_VERSION)/mlaunch/bin/mlaunch $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/bin/mlaunch - $$(Q) $$(CP) -R $(TOP)/packages/microsoft.tools.mlaunch/$$(MLAUNCH_NUGET_VERSION)/mlaunch/lib/mlaunch $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/lib - $$(Q) chmod a+x $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/bin/mlaunch - $$(Q) chmod a+x $$(DOTNET_DESTDIR)/Microsoft.$(1).Sdk/tools/lib/mlaunch/mlaunch.app/Contents/MacOS/mlaunch + $$(Q) rm -rf $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin/mlaunch + $$(Q) rm -rf $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib/mlaunch + $$(Q) mkdir -p $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin + $$(Q) mkdir -p $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib + $$(Q) $$(CP) -R $(TOP)/packages/microsoft.tools.mlaunch/$$(MLAUNCH_NUGET_VERSION)/mlaunch/bin/mlaunch $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin/mlaunch + $$(Q) $$(CP) -R $(TOP)/packages/microsoft.tools.mlaunch/$$(MLAUNCH_NUGET_VERSION)/mlaunch/lib/mlaunch $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib + $$(Q) chmod a+x $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/bin/mlaunch + $$(Q) chmod a+x $$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/tools/lib/mlaunch/mlaunch.app/Contents/MacOS/mlaunch endef $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(eval $(call DotNetInstall,$(platform)))) @@ -50,10 +50,10 @@ ifdef INCLUDE_IOS $(Q) rm -rf $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mlaunch endif endif - $(Q) for platform in $(DOTNET_PLATFORMS_MOBILE); do \ - rm -rf $(DOTNET_DESTDIR)/Microsoft.$$platform.Sdk/tools/bin/mlaunch; \ - rm -rf $(DOTNET_DESTDIR)/Microsoft.$$platform.Sdk/tools/lib/mlaunch; \ - done +ifdef ENABLE_DOTNET + $(Q) rm -rf $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/bin/mlaunch) + $(Q) rm -rf $(foreach platform,$(DOTNET_PLATFORMS_MOBILE),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/lib/mlaunch) +endif $(Q) rm -rf .*.stamp obj .*.binlog all-local:: $(TARGETS) diff --git a/tools/mmp/Makefile b/tools/mmp/Makefile index 2f15e9120084..11305eba4de2 100644 --- a/tools/mmp/Makefile +++ b/tools/mmp/Makefile @@ -20,10 +20,10 @@ $(MMP_DIR)/mmp.exe: $(mmp_dependencies) $(Q_GEN) $(SYSTEM_MSBUILD) "/bl:$@.binlog" $(TOP)/Xamarin.Mac.sln "/t:mmp" $(XBUILD_VERBOSITY) /p:Configuration=$(MMP_CONF) MMP_TARGETS_DOTNET = \ - $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native/Microsoft.macOS.registrar.a \ - $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native/Microsoft.macOS.registrar.a \ - $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native/Microsoft.macOS.registrar.coreclr.a \ - $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native/Microsoft.macOS.registrar.coreclr.a \ + $(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native/Microsoft.macOS.registrar.a \ + $(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native/Microsoft.macOS.registrar.a \ + $(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native/Microsoft.macOS.registrar.coreclr.a \ + $(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native/Microsoft.macOS.registrar.coreclr.a \ MMP_TARGETS = \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin/mmp \ @@ -32,8 +32,8 @@ MMP_TARGETS = \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/Xamarin.Mac.registrar.full.a \ MMP_DIRECTORIES_DOTNET = \ - $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native \ - $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native \ + $(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native \ + $(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native \ MMP_DIRECTORIES = \ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/bin \ @@ -51,16 +51,16 @@ $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/mmp.exe: $(MMP_DIR)/mmp.exe | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp/Xamarin.Mac.registrar.%.a: Xamarin.Mac.registrar.%.a | $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mmp $(Q) $(CP) $<* $(dir $@) -$(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native/Microsoft.macOS.registrar.a: Microsoft.macOS.registrar.x86_64.a | $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native +$(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native/Microsoft.macOS.registrar.a: Microsoft.macOS.registrar.x86_64.a | $(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native/Microsoft.macOS.registrar.coreclr.a: Microsoft.macOS.registrar.coreclr.x86_64.a | $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-x64/runtimes/osx-x64/native +$(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native/Microsoft.macOS.registrar.coreclr.a: Microsoft.macOS.registrar.coreclr.x86_64.a | $(DOTNET_DESTDIR)/$(osx-x64_NUGET_RUNTIME_NAME)/runtimes/osx-x64/native $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native/Microsoft.macOS.registrar.a: Microsoft.macOS.registrar.arm64.a | $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native +$(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native/Microsoft.macOS.registrar.a: Microsoft.macOS.registrar.arm64.a | $(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native $(Q) $(CP) $< $@ -$(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native/Microsoft.macOS.registrar.coreclr.a: Microsoft.macOS.registrar.coreclr.arm64.a | $(DOTNET_DESTDIR)/Microsoft.macOS.Runtime.osx-arm64/runtimes/osx-arm64/native +$(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native/Microsoft.macOS.registrar.coreclr.a: Microsoft.macOS.registrar.coreclr.arm64.a | $(DOTNET_DESTDIR)/$(osx-arm64_NUGET_RUNTIME_NAME)/runtimes/osx-arm64/native $(Q) $(CP) $< $@ $(MMP_DIRECTORIES): diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile index 79d86d61c8ee..71837ed78c83 100644 --- a/tools/mtouch/Makefile +++ b/tools/mtouch/Makefile @@ -309,7 +309,7 @@ endif $(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^ TARGETS_DOTNET = \ - $(foreach platform,$(DOTNET_PLATFORMS_MTOUCH),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Runtime.$(rid)/runtimes/$(rid)/native/Microsoft.$(platform).registrar.a)) \ + $(foreach platform,$(DOTNET_PLATFORMS_MTOUCH),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/native/Microsoft.$(platform).registrar.a)) \ TARGETS = \ $(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/bin/mtouch \ @@ -341,7 +341,7 @@ endif endif TARGET_DIRS_DOTNET = \ - $(foreach platform,$(DOTNET_PLATFORMS_MTOUCH),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Runtime.$(rid)/runtimes/$(rid)/native)) \ + $(foreach platform,$(DOTNET_PLATFORMS_MTOUCH),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/native)) \ TARGET_DIRS = \ .libs \ @@ -394,7 +394,7 @@ $(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib/%.registrar.a: %.registrar.tvos.arm64.a | $(Q) $(CP) $< $@ define InstallRegistrar -$(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native/Microsoft.$(1).registrar.a: .libs/Microsoft.$(1).registrar.$(rid).a | $(DOTNET_DESTDIR)/Microsoft.$(1).Runtime.$(2)/runtimes/$(2)/native +$(DOTNET_DESTDIR)/$$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/Microsoft.$(1).registrar.a: .libs/Microsoft.$(1).registrar.$(rid).a | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native $(Q) $(CP) $$< $$@ endef From 3bfad42a2dc47b79d77467b50a107a6619193dab Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 9 Aug 2023 17:58:40 +0200 Subject: [PATCH 2/5] [release/7.0.3xx] [dotnet] Rename packs to contain target framework. --- Make.config | 9 +-- dotnet/Makefile | 36 ++++++---- ...kloadManifest.MacCatalyst.template.targets | 15 ----- .../WorkloadManifest.iOS.template.targets | 17 ----- .../WorkloadManifest.macOS.template.targets | 15 ----- .../WorkloadManifest.tvOS.template.targets | 15 ----- dotnet/generate-workloadmanifest-json.csharp | 47 +++++++++----- .../generate-workloadmanifest-targets.csharp | 65 +++++++++++++++++++ dotnet/package/microsoft.ref.csproj | 2 +- dotnet/package/microsoft.runtime.csproj | 2 +- dotnet/package/microsoft.sdk.csproj | 4 +- .../Microsoft.Sdk.DefaultItems.template.props | 2 +- .../Microsoft.Sdk.Versions.template.props | 5 +- dotnet/targets/Xamarin.Shared.Sdk.targets | 2 +- msbuild/Makefile | 8 --- release/Makefile | 12 +++- 16 files changed, 142 insertions(+), 114 deletions(-) delete mode 100644 dotnet/Workloads/WorkloadManifest.MacCatalyst.template.targets delete mode 100644 dotnet/Workloads/WorkloadManifest.iOS.template.targets delete mode 100644 dotnet/Workloads/WorkloadManifest.macOS.template.targets delete mode 100644 dotnet/Workloads/WorkloadManifest.tvOS.template.targets create mode 100755 dotnet/generate-workloadmanifest-targets.csharp diff --git a/Make.config b/Make.config index 3a145bf0aa2d..7c2fa0c08fb9 100644 --- a/Make.config +++ b/Make.config @@ -736,6 +736,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)) @@ -782,10 +783,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))) diff --git a/dotnet/Makefile b/dotnet/Makefile index 16e173dd57c7..e8bbe754ac61 100644 --- a/dotnet/Makefile +++ b/dotnet/Makefile @@ -119,6 +119,7 @@ targets/Microsoft.$(1).Sdk.Versions.props: targets/Microsoft.Sdk.Versions.templa -e 's*@VALID_RUNTIME_IDENTIFIERS@*$(foreach rid,$(3),\n\t\t<_XamarinValidRuntimeIdentifier Include="$(rid)" Platform="$(1)" />)*' \ -e 's/@DOTNET_TFM@/$(DOTNET_TFM)/g' \ -e 's/@RUNTIME_PACK_RUNTIME_IDENTIFIERS@/$(4)/g' \ + -e 's/@NUGET_OS_VERSION@/$$($(2)_NUGET_OS_VERSION)/g' \ $$< > $$@.tmp $$(Q) mv $$@.tmp $$@ @@ -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)))) @@ -178,13 +180,12 @@ $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SharedAfterTargetsTemplate, 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)" "$(4)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" + $$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(4)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)" "$(DOTNET_TFM)_$$($(5)_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_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)" "$(DOTNET_TFM)_$$($(5)_NUGET_OS_VERSION)" "$(DEFAULT_TARGET_PLATFORM_VERSION_$(5))" $$(Q) mv $$@.tmp $$@ Workloads/Microsoft.NET.Sdk.$(1)/LICENSE: $(TOP)/LICENSE | Workloads/Microsoft.NET.Sdk.$(1) @@ -241,6 +242,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 @@ -251,16 +259,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) @@ -345,7 +353,7 @@ $(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 @@ -353,8 +361,8 @@ $(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 diff --git a/dotnet/Workloads/WorkloadManifest.MacCatalyst.template.targets b/dotnet/Workloads/WorkloadManifest.MacCatalyst.template.targets deleted file mode 100644 index 5aa2c8bcfdc3..000000000000 --- a/dotnet/Workloads/WorkloadManifest.MacCatalyst.template.targets +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - <_MultiTargetTargetsFile>$(_XamarinSdkRootDirectory)..\@NUGET_VERSION_NO_METADATA@\targets\Xamarin.Shared.Sdk.MultiTarget.targets - $(AfterMicrosoftNETSdkTargets);$(_MultiTargetTargetsFile) - - diff --git a/dotnet/Workloads/WorkloadManifest.iOS.template.targets b/dotnet/Workloads/WorkloadManifest.iOS.template.targets deleted file mode 100644 index e9a6de0b142d..000000000000 --- a/dotnet/Workloads/WorkloadManifest.iOS.template.targets +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - <_MultiTargetTargetsFile>$(_XamarinSdkRootDirectory)..\@NUGET_VERSION_NO_METADATA@\targets\Xamarin.Shared.Sdk.MultiTarget.targets - $(AfterMicrosoftNETSdkTargets);$(_MultiTargetTargetsFile) - - diff --git a/dotnet/Workloads/WorkloadManifest.macOS.template.targets b/dotnet/Workloads/WorkloadManifest.macOS.template.targets deleted file mode 100644 index c4165792c6cc..000000000000 --- a/dotnet/Workloads/WorkloadManifest.macOS.template.targets +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - <_MultiTargetTargetsFile>$(_XamarinSdkRootDirectory)..\@NUGET_VERSION_NO_METADATA@\targets\Xamarin.Shared.Sdk.MultiTarget.targets - $(AfterMicrosoftNETSdkTargets);$(_MultiTargetTargetsFile) - - diff --git a/dotnet/Workloads/WorkloadManifest.tvOS.template.targets b/dotnet/Workloads/WorkloadManifest.tvOS.template.targets deleted file mode 100644 index 4ec9ccf92890..000000000000 --- a/dotnet/Workloads/WorkloadManifest.tvOS.template.targets +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - <_MultiTargetTargetsFile>$(_XamarinSdkRootDirectory)..\@NUGET_VERSION_NO_METADATA@\targets\Xamarin.Shared.Sdk.MultiTarget.targets - $(AfterMicrosoftNETSdkTargets);$(_MultiTargetTargetsFile) - - diff --git a/dotnet/generate-workloadmanifest-json.csharp b/dotnet/generate-workloadmanifest-json.csharp index 4bc37e10ce05..b9be0bc3d374 100755 --- a/dotnet/generate-workloadmanifest-json.csharp +++ b/dotnet/generate-workloadmanifest-json.csharp @@ -1,4 +1,4 @@ -#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp +#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp -s // arguments are: @@ -6,7 +6,7 @@ using System.IO; using System.Xml; var args = Environment.GetCommandLineArgs (); -var expectedArgumentCount = 6; +var expectedArgumentCount = 8; 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 @@ -16,7 +16,7 @@ if (args.Length != expectedArgumentCount + 2 /* 2 default arguments (executable return; } -var argumentIndex = 2; +var argumentIndex = 3; var platform = args [argumentIndex++]; var version = args [argumentIndex++]; var net6Version = args [argumentIndex++]; @@ -24,9 +24,11 @@ var runtimeIdentifiers = args [argumentIndex++].Split (new char [] { ' ' }, Stri 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}\","); @@ -34,15 +36,19 @@ using (TextWriter writer = new StreamWriter (outputPath)) { writer.WriteLine ($" \"{platformLowerCase}\": {{"); writer.WriteLine ($" \"description\": \".NET SDK Workload for building {platform} applications.\","); writer.WriteLine ($" \"packs\": ["); - writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net7\","); + writer.WriteLine ($" \"Microsoft.{platform}.Sdk.{tfm}\","); writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net6\","); + writer.WriteLine ($" \"Microsoft.{platform}.Ref\", // The .NET 6 SDK pack (Microsoft.{platform}.Sdk.net6) references the Microsoft.{platform}.Ref pack from the workload using **FromWorkloads**, so we must provide said pack as long as we reference Microsoft.{platform}.Sdk.net6"); if (hasWindows) { - writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net7\","); + writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.{tfm}\","); writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net6\","); } - 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}\","); + } + foreach (var rid in runtimeIdentifiers) { + writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}\", // The .NET 6 SDK pack (Microsoft.{platform}.Sdk.net6) references the Microsoft.{platform}.Runtime.{rid} pack from the workload using **FromWorkloads**, so we must provide said pack as long as we reference Microsoft.{platform}.Sdk.net6"); } writer.WriteLine ($" \"Microsoft.{platform}.Templates.net7\""); writer.WriteLine ($" ],"); @@ -58,12 +64,9 @@ using (TextWriter writer = new StreamWriter (outputPath)) { writer.WriteLine ($" }},"); writer.WriteLine ($" }},"); writer.WriteLine ($" \"packs\": {{"); - writer.WriteLine ($" \"Microsoft.{platform}.Sdk.net7\": {{"); + 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.net6\": {{"); writer.WriteLine ($" \"kind\": \"sdk\","); @@ -72,14 +75,18 @@ using (TextWriter writer = new StreamWriter (outputPath)) { writer.WriteLine ($" \"any\": \"Microsoft.{platform}.Sdk\""); writer.WriteLine ($" }}"); writer.WriteLine ($" }},"); + writer.WriteLine ($" \"Microsoft.{platform}.Ref\": {{ // See comment further up about why we need Microsoft.{platform}.Ref"); + writer.WriteLine ($" \"kind\": \"sdk\","); + writer.WriteLine ($" \"version\": \"{net6Version}\","); + writer.WriteLine ($" }},"); if (hasWindows) { - writer.WriteLine ($" \"Microsoft.{platform}.Windows.Sdk.Aliased.net7\": {{"); + 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.net6\": {{"); @@ -92,16 +99,22 @@ 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 ($" }},"); } + foreach (var rid in runtimeIdentifiers) { + writer.WriteLine ($" \"Microsoft.{platform}.Runtime.{rid}\": {{ // See comment further up about why we need Microsoft.{platform}.Runtime.{rid}"); + writer.WriteLine ($" \"kind\": \"framework\","); + writer.WriteLine ($" \"version\": \"{net6Version}\""); + writer.WriteLine ($" }},"); + } writer.WriteLine ($" \"Microsoft.{platform}.Templates.net7\": {{"); writer.WriteLine ($" \"kind\": \"template\","); writer.WriteLine ($" \"version\": \"{version}\","); diff --git a/dotnet/generate-workloadmanifest-targets.csharp b/dotnet/generate-workloadmanifest-targets.csharp new file mode 100755 index 000000000000..642e3fcbcee0 --- /dev/null +++ b/dotnet/generate-workloadmanifest-targets.csharp @@ -0,0 +1,65 @@ +#!/usr/bin/env /Library/Frameworks/Mono.framework/Commands/csharp -s + +// arguments are: + +using System.IO; +using System.Xml; + +var args = Environment.GetCommandLineArgs (); +var expectedArgumentCount = 5; +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}"); + Environment.Exit (1); + return; +} + +var argumentIndex = 3; +var platform = args [argumentIndex++]; +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 defaultApiVersion = args [argumentIndex++]; + +var platformLowerCase = platform.ToLowerInvariant (); +var tfm = currentApiVersion; + +using (var writer = new StreamWriter (outputPath)) { + writer.WriteLine ($""); + writer.WriteLine ($" "); + { + var tfv = tfm.Replace ("net", ""); + tfv = tfv.Substring (0, tfv.IndexOfAny (new char [] { '-', '_' })); + var tpv = tfm.Substring (tfm.IndexOfAny (new char [] { '-', '_' }) + 1); + writer.WriteLine ($" "); + } + writer.WriteLine ($" "); + if (hasWindows) { + writer.WriteLine (); + { + var tfv = tfm.Replace ("net", ""); + tfv = tfv.Substring (0, tfv.IndexOfAny (new char [] { '-', '_' })); + var tpv = tfm.Substring (tfm.IndexOfAny (new char [] { '-', '_' }) + 1); + writer.WriteLine ($" "); + } + writer.WriteLine ($" "); + } + writer.WriteLine ($" "); + writer.WriteLine (); + writer.WriteLine ($" "); + writer.WriteLine ($" "); + writer.WriteLine ($" "); + + writer.WriteLine ($" "); + writer.WriteLine ($" <_MultiTargetTargetsFile>$(_XamarinSdkRootDirectory)..\\@NUGET_VERSION_NO_METADATA@\\targets\\Xamarin.Shared.Sdk.MultiTarget.targets"); + writer.WriteLine ($" $(AfterMicrosoftNETSdkTargets);$(_MultiTargetTargetsFile)"); + writer.WriteLine ($" "); + + writer.WriteLine ($""); + writer.WriteLine (); +} + +Environment.Exit (0); diff --git a/dotnet/package/microsoft.ref.csproj b/dotnet/package/microsoft.ref.csproj index abe8d953d1e3..ce3108ffa062 100644 --- a/dotnet/package/microsoft.ref.csproj +++ b/dotnet/package/microsoft.ref.csproj @@ -1,6 +1,6 @@ - Microsoft.$(_PlatformName).Ref + Microsoft.$(_PlatformName).Ref.$(PackageOSTargetVersion) Microsoft $(_PlatformName) reference assemblies. Please do not reference directly. <_CreateFrameworkList>true diff --git a/dotnet/package/microsoft.runtime.csproj b/dotnet/package/microsoft.runtime.csproj index cc2c8129928d..5a595d6d9c5c 100644 --- a/dotnet/package/microsoft.runtime.csproj +++ b/dotnet/package/microsoft.runtime.csproj @@ -1,6 +1,6 @@ - Microsoft.$(_PlatformName).Runtime.$(_RuntimeIdentifier) + Microsoft.$(_PlatformName).Runtime.$(_RuntimeIdentifier).$(PackageOSTargetVersion) Microsoft $(_PlatformName) runtime pack for $(_RuntimeIdentifier). Please do not reference directly. <_CreateRuntimeList>true diff --git a/dotnet/package/microsoft.sdk.csproj b/dotnet/package/microsoft.sdk.csproj index cabd1cc77df3..c22a4a265313 100644 --- a/dotnet/package/microsoft.sdk.csproj +++ b/dotnet/package/microsoft.sdk.csproj @@ -1,7 +1,7 @@ - Microsoft.$(_PlatformName).Sdk - Microsoft.$(_PlatformName).Windows.Sdk + Microsoft.$(_PlatformName).Sdk.$(PackageOSTargetVersion) + Microsoft.$(_PlatformName).Windows.Sdk.$(PackageOSTargetVersion) Managed Tools and Bindings for the $(_PlatformName) SDK diff --git a/dotnet/targets/Microsoft.Sdk.DefaultItems.template.props b/dotnet/targets/Microsoft.Sdk.DefaultItems.template.props index 49e8b7b2bc57..2fbe236a13ef 100644 --- a/dotnet/targets/Microsoft.Sdk.DefaultItems.template.props +++ b/dotnet/targets/Microsoft.Sdk.DefaultItems.template.props @@ -17,7 +17,7 @@ --> - + $([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(Identity)')) diff --git a/dotnet/targets/Microsoft.Sdk.Versions.template.props b/dotnet/targets/Microsoft.Sdk.Versions.template.props index 40aa4d8e0130..015428c37d3d 100644 --- a/dotnet/targets/Microsoft.Sdk.Versions.template.props +++ b/dotnet/targets/Microsoft.Sdk.Versions.template.props @@ -7,6 +7,7 @@ <_ShortPackageVersion>@NUGET_VERSION_NO_METADATA@ <_PackageVersion>@NUGET_VERSION_FULL@ <_DefaultTargetPlatformVersion>@DEFAULT_TARGET_PLATFORM_VERSION@ + <_XamarinPackSuffix>@DOTNET_TFM@_@NUGET_OS_VERSION@ @VALID_RUNTIME_IDENTIFIERS@ @@ -20,9 +21,9 @@ RuntimeFrameworkName="Microsoft.@PLATFORM@" DefaultRuntimeFrameworkVersion="@NUGET_VERSION_NO_METADATA@" LatestRuntimeFrameworkVersion="@NUGET_VERSION_NO_METADATA@" - TargetingPackName="Microsoft.@PLATFORM@.Ref" + TargetingPackName="Microsoft.@PLATFORM@.Ref.@DOTNET_TFM@_@NUGET_OS_VERSION@" TargetingPackVersion="@NUGET_VERSION_NO_METADATA@" - RuntimePackNamePatterns="Microsoft.@PLATFORM@.Runtime.**RID**" + RuntimePackNamePatterns="Microsoft.@PLATFORM@.Runtime.**RID**.@DOTNET_TFM@_@NUGET_OS_VERSION@" RuntimePackRuntimeIdentifiers="@RUNTIME_PACK_RUNTIME_IDENTIFIERS@" Profile="@PLATFORM@" /> diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 728d6c4237d0..5fb10ba58222 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -838,7 +838,7 @@ <_PackageIdInfix Condition="'$(UseMonoRuntime)' == 'true'">Mono. <_MonoNugetPackageId>Microsoft.NETCore.App.Runtime.$(_PackageIdInfix)$(RuntimeIdentifier) - <_XamarinNugetPackageId>Microsoft.$(_PlatformName).Runtime.$(RuntimeIdentifier) + <_XamarinNugetPackageId>Microsoft.$(_PlatformName).Runtime.$(RuntimeIdentifier).$(_XamarinPackSuffix) diff --git a/msbuild/Makefile b/msbuild/Makefile index b7364f9026f6..3a8b9413cd3c 100644 --- a/msbuild/Makefile +++ b/msbuild/Makefile @@ -434,14 +434,6 @@ DOTNET_TARGETS += \ endif -# watchOS: contains all of the files for iOS as well (for now, we don't need all of them, so this is optimizable) -ifdef INCLUDE_WATCH -DOTNET_TARGETS += \ - $(foreach target,$(DOTNET_SHARED_FILES) ,$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/iOS/$(notdir $(target))) \ - $(foreach target,$(DOTNET_WATCHOS_FILES) ,$(DOTNET_DESTDIR)/$(WATCHOS_NUGET).Sdk/tools/msbuild/watchOS/$(notdir $(target))) \ - -endif - # macOS ifdef INCLUDE_MAC DOTNET_TARGETS += \ diff --git a/release/Makefile b/release/Makefile index 010856f830b1..b883fee8cd94 100644 --- a/release/Makefile +++ b/release/Makefile @@ -180,7 +180,17 @@ ifdef INCLUDE_XAMARIN_LEGACY if test -d $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono; then cd $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono && zip -9 -r $(CURDIR)/bundle.zip .; fi endif ifdef ENABLE_DOTNET - cd $(DOTNET_DESTDIR) && zip -9 -r $(CURDIR)/bundle.zip $(foreach platform,$(DOTNET_PLATFORMS),./Microsoft.$(platform).Ref/ref/) + $(foreach platform,$(DOTNET_PLATFORMS),export $(platform)_NUGET_REF_NAME=$($(platform)_NUGET_REF_NAME);) \ + for platform in $(DOTNET_PLATFORMS); do \ + cd $(CURDIR); \ + rm -rf tmpdir; \ + mkdir -p Microsoft.$$platform.Ref/; \ + TMPVAR=$${platform}_NUGET_REF_NAME; \ + $(CP) -r $(DOTNET_DESTDIR)/$${!TMPVAR}/ref Microsoft.$$platform.Ref; \ + cd tmpdir; \ + zip -9 -r $(CURDIR)/bundle.zip ./Microsoft.$$platform.Ref/ref/; \ + rm -rf tmpdir; \ + done endif zip -9 $@ Version Version.rev From 2f0141b34794967211170ee0031b88a482fd7252 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Aug 2023 14:26:32 +0200 Subject: [PATCH 3/5] [dotnet] Set _AppleSdkLoaded=true when loaded to ease logic in later sdks to determine the sdk to load. --- dotnet/targets/Xamarin.Shared.Sdk.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.props b/dotnet/targets/Xamarin.Shared.Sdk.props index bffc29378639..2b709e87bd0a 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.props +++ b/dotnet/targets/Xamarin.Shared.Sdk.props @@ -12,6 +12,8 @@ + + <_AppleSdkLoaded>true true From 64f24bc7a54e45cc57fc41b7cb93f02c3516424a Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 16 Aug 2023 10:34:02 +0200 Subject: [PATCH 4/5] [tests/xharness] Add support for setting test configuration using environment variables. Setting test configuration variables using the environment is useful when running tests on a Windows machine (easier than having to deal with make). Also refactor the code a bit to not use constants, and more consistent naming. Backport of #18738. --- tests/common/Configuration.cs | 8 +++-- tests/xharness/Harness.cs | 54 ++++++++++++++++++++------------ tests/xharness/IHarness.cs | 1 + tests/xharness/Targets/Target.cs | 2 +- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index debd1743001b..09263c113c6e 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -223,12 +223,16 @@ static IList GetVariableArray (string variable, string @default = "") public static string EvaluateVariable (string variable) { + var result = Environment.GetEnvironmentVariable (variable); + if (!string.IsNullOrEmpty (result)) + return result; + var output = new StringBuilder (); var rv = ExecutionHelper.Execute ("/usr/bin/make", new string [] { "-C", Path.Combine (SourceRoot, "tools", "devops"), "print-abspath-variable", $"VARIABLE={variable}" }, environmentVariables: null, stdout: output, stderr: output, timeout: TimeSpan.FromSeconds (5)); if (rv != 0) throw new Exception ($"Failed to evaluate variable '{variable}'. Exit code: {rv}. Output:\n{output}"); - var result = output.ToString ().Split (new char [] { '\n' }, StringSplitOptions.RemoveEmptyEntries).Where (v => v.StartsWith (variable + "=", StringComparison.Ordinal)).SingleOrDefault (); - if (result == null) + result = output.ToString ().Split (new char [] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries).Where (v => v.StartsWith (variable + "=", StringComparison.Ordinal)).SingleOrDefault (); + if (result is null) throw new Exception ($"Could not find the variable '{variable}' to evaluate."); return result.Substring (variable.Length + 1); } diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index 0bc412be058e..52c52e9cc040 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -131,6 +131,21 @@ string MlaunchPath { } } + bool IsVariableSet (string variable) + { + return !string.IsNullOrEmpty (GetVariable (variable)); + } + + string GetVariable (string variable, string @default = null) + { + var result = Environment.GetEnvironmentVariable (variable); + if (string.IsNullOrEmpty (result)) + config.TryGetValue (variable, out result); + if (string.IsNullOrEmpty (result)) + result = @default; + return result; + } + public List IOSTestProjects { get; } public List MacTestProjects { get; } = new List (); @@ -160,6 +175,7 @@ string MlaunchPath { public bool INCLUDE_XAMARIN_LEGACY { get; } public string SYSTEM_MONO { get; set; } public string DOTNET_DIR { get; set; } + public string DOTNET_TFM { get; set; } // Run @@ -217,34 +233,32 @@ public Harness (IResultParser resultParser, HarnessAction action, HarnessConfigu LaunchTimeout = InCI ? 3 : 120; - var config = ParseConfigFiles (); + config = ParseConfigFiles (); var src_root = Path.GetDirectoryName (Path.GetFullPath (RootDirectory)); MONO_PATH = Path.GetFullPath (Path.Combine (src_root, "external", "mono")); TVOS_MONO_PATH = MONO_PATH; - INCLUDE_IOS = config.ContainsKey ("INCLUDE_IOS") && !string.IsNullOrEmpty (config ["INCLUDE_IOS"]); - INCLUDE_TVOS = config.ContainsKey ("INCLUDE_TVOS") && !string.IsNullOrEmpty (config ["INCLUDE_TVOS"]); - JENKINS_RESULTS_DIRECTORY = config ["JENKINS_RESULTS_DIRECTORY"]; - INCLUDE_WATCH = config.ContainsKey ("INCLUDE_WATCH") && !string.IsNullOrEmpty (config ["INCLUDE_WATCH"]); - INCLUDE_MAC = config.ContainsKey ("INCLUDE_MAC") && !string.IsNullOrEmpty (config ["INCLUDE_MAC"]); - INCLUDE_MACCATALYST = config.ContainsKey ("INCLUDE_MACCATALYST") && !string.IsNullOrEmpty (config ["INCLUDE_MACCATALYST"]); - MAC_DESTDIR = config ["MAC_DESTDIR"]; - - IOS_DESTDIR = config ["IOS_DESTDIR"]; - MONO_IOS_SDK_DESTDIR = config ["MONO_IOS_SDK_DESTDIR"]; - MONO_MAC_SDK_DESTDIR = config ["MONO_MAC_SDK_DESTDIR"]; - ENABLE_DOTNET = config.ContainsKey ("ENABLE_DOTNET") && !string.IsNullOrEmpty (config ["ENABLE_DOTNET"]); - SYSTEM_MONO = config ["SYSTEM_MONO"]; - DOTNET_DIR = config ["DOTNET_DIR"]; - INCLUDE_XAMARIN_LEGACY = config.ContainsKey ("INCLUDE_XAMARIN_LEGACY") && !string.IsNullOrEmpty (config ["INCLUDE_XAMARIN_LEGACY"]); + INCLUDE_IOS = IsVariableSet (nameof (INCLUDE_IOS)); + INCLUDE_TVOS = IsVariableSet (nameof (INCLUDE_TVOS)); + JENKINS_RESULTS_DIRECTORY = GetVariable (nameof (JENKINS_RESULTS_DIRECTORY)); + INCLUDE_WATCH = IsVariableSet (nameof (INCLUDE_WATCH)); + INCLUDE_MAC = IsVariableSet (nameof (INCLUDE_MAC)); + INCLUDE_MACCATALYST = IsVariableSet (nameof (INCLUDE_MACCATALYST)); + MAC_DESTDIR = GetVariable (nameof (MAC_DESTDIR)); + IOS_DESTDIR = GetVariable (nameof (IOS_DESTDIR)); + MONO_IOS_SDK_DESTDIR = GetVariable (nameof (MONO_IOS_SDK_DESTDIR)); + MONO_MAC_SDK_DESTDIR = GetVariable (nameof (MONO_MAC_SDK_DESTDIR)); + ENABLE_DOTNET = IsVariableSet (nameof (ENABLE_DOTNET)); + SYSTEM_MONO = GetVariable (nameof (SYSTEM_MONO)); + DOTNET_DIR = GetVariable (nameof (DOTNET_DIR)); + INCLUDE_XAMARIN_LEGACY = IsVariableSet (nameof (INCLUDE_XAMARIN_LEGACY)); + DOTNET_TFM = GetVariable (nameof (DOTNET_TFM)); if (string.IsNullOrEmpty (SdkRoot)) - SdkRoot = config ["XCODE_DEVELOPER_ROOT"] ?? configuration.SdkRoot; - - this.config = config; + SdkRoot = GetVariable ("XCODE_DEVELOPER_ROOT", configuration.SdkRoot); processManager = new MlaunchProcessManager (XcodeRoot, MlaunchPath); - AppBundleLocator = new AppBundleLocator (processManager, () => HarnessLog, XIBuildPath, "/usr/local/share/dotnet/dotnet", config ["DOTNET"]); + AppBundleLocator = new AppBundleLocator (processManager, () => HarnessLog, XIBuildPath, "/usr/local/share/dotnet/dotnet", GetVariable ("DOTNET")); TunnelBore = new TunnelBore (processManager); } diff --git a/tests/xharness/IHarness.cs b/tests/xharness/IHarness.cs index c16339799415..eb3cb111f467 100644 --- a/tests/xharness/IHarness.cs +++ b/tests/xharness/IHarness.cs @@ -47,6 +47,7 @@ public interface IHarness { bool INCLUDE_XAMARIN_LEGACY { get; } string SYSTEM_MONO { get; set; } string DOTNET_DIR { get; set; } + string DOTNET_TFM { get; } string XcodeRoot { get; } string LogDirectory { get; } double Timeout { get; } diff --git a/tests/xharness/Targets/Target.cs b/tests/xharness/Targets/Target.cs index d615831c639a..eb32e2d1c9c7 100644 --- a/tests/xharness/Targets/Target.cs +++ b/tests/xharness/Targets/Target.cs @@ -65,7 +65,7 @@ public abstract class Target { public const string FSharpGuid = "{F2A71F9B-5D33-465A-A702-920D77279786}"; public const string CSharpGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; - public const string DotNetTfm = "net7.0"; + public string DotNetTfm => Harness.DOTNET_TFM; public string LanguageGuid { get { return IsFSharp ? FSharpGuid : CSharpGuid; } } From 5f545076ec37884c3199bc77ed8cafe1381dcdbf Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 31 Aug 2023 19:30:19 +0200 Subject: [PATCH 5/5] [dotnet] Relax the target platform version logic to load this workload. --- dotnet/generate-workloadmanifest-targets.csharp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dotnet/generate-workloadmanifest-targets.csharp b/dotnet/generate-workloadmanifest-targets.csharp index 642e3fcbcee0..8eedf34ef143 100755 --- a/dotnet/generate-workloadmanifest-targets.csharp +++ b/dotnet/generate-workloadmanifest-targets.csharp @@ -29,12 +29,12 @@ var tfm = currentApiVersion; using (var writer = new StreamWriter (outputPath)) { writer.WriteLine ($""); - writer.WriteLine ($" "); + writer.WriteLine ($" "); { var tfv = tfm.Replace ("net", ""); tfv = tfv.Substring (0, tfv.IndexOfAny (new char [] { '-', '_' })); var tpv = tfm.Substring (tfm.IndexOfAny (new char [] { '-', '_' }) + 1); - writer.WriteLine ($" "); + writer.WriteLine ($" "); } writer.WriteLine ($" "); if (hasWindows) { @@ -43,7 +43,7 @@ using (var writer = new StreamWriter (outputPath)) { var tfv = tfm.Replace ("net", ""); tfv = tfv.Substring (0, tfv.IndexOfAny (new char [] { '-', '_' })); var tpv = tfm.Substring (tfm.IndexOfAny (new char [] { '-', '_' }) + 1); - writer.WriteLine ($" "); + writer.WriteLine ($" "); } writer.WriteLine ($" "); }