From 859dd9924c0616cdc656238a9e494411265c22ec Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 31 Dec 2024 11:55:02 +0100 Subject: [PATCH] [tools] Fix computing the product version for Mac Catalyst. (#21868) This fixes a problem with the version number in error messages when only Mac Catalyst is enabled in the build: > warning MT0079: The recommended Xcode version for Microsoft.MacCatalyst @IOS_NUGET_VERSION@ is Xcode 16.2 or later. --- tools/common/Application.cs | 3 ++- tools/common/Make.common | 1 + tools/common/ProductConstants.in.cs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/common/Application.cs b/tools/common/Application.cs index 5036b2b8d4fe..b2b0bd9e64c4 100644 --- a/tools/common/Application.cs +++ b/tools/common/Application.cs @@ -1685,8 +1685,9 @@ internal ProductConstants ProductConstants { get { switch (Platform) { case ApplePlatform.iOS: - case ApplePlatform.MacCatalyst: return ProductConstants.iOS; + case ApplePlatform.MacCatalyst: + return ProductConstants.MacCatalyst; case ApplePlatform.TVOS: return ProductConstants.tvOS; case ApplePlatform.MacOSX: diff --git a/tools/common/Make.common b/tools/common/Make.common index 7d6a5e21edb3..67f16a21f012 100644 --- a/tools/common/Make.common +++ b/tools/common/Make.common @@ -63,6 +63,7 @@ $(abspath ../common/ProductConstants.cs): ../common/ProductConstants.in.cs Makef -e "s/@IOS_VERSION@/$(IOS_PACKAGE_VERSION_MAJOR).$(IOS_PACKAGE_VERSION_MINOR).$(IOS_PACKAGE_VERSION_REV)/g" \ -e "s/@TVOS_VERSION@/$(IOS_PACKAGE_VERSION_MAJOR).$(IOS_PACKAGE_VERSION_MINOR).$(IOS_PACKAGE_VERSION_REV)/g" \ -e "s/@MACOS_VERSION@/$(MAC_PACKAGE_VERSION_MAJOR).$(MAC_PACKAGE_VERSION_MINOR).$(MAC_PACKAGE_VERSION_REV)/g" \ + -e "s/@MACCATALYST_VERSION@/$(IOS_PACKAGE_VERSION_MAJOR).$(IOS_PACKAGE_VERSION_MINOR).$(IOS_PACKAGE_VERSION_REV)/g" \ \ $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),-e 's/@$(platform)_REVISION@/$($(platform)_COMMIT_DISTANCE) ($(CURRENT_BRANCH_SED_ESCAPED): $(CURRENT_HASH))/g') \ $(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),-e 's/@$(platform)_NUGET_VERSION@/$($(platform)_NUGET_VERSION)/g') \ diff --git a/tools/common/ProductConstants.in.cs b/tools/common/ProductConstants.in.cs index 88da439fabf2..6ac4f65d06fa 100644 --- a/tools/common/ProductConstants.in.cs +++ b/tools/common/ProductConstants.in.cs @@ -24,10 +24,12 @@ sealed class ProductConstants { public readonly static ProductConstants iOS = new ProductConstants ("@IOS_NUGET_VERSION@", "@IOS_NUGET_REVISION@"); public readonly static ProductConstants tvOS = new ProductConstants ("@TVOS_NUGET_VERSION@", "@TVOS_NUGET_REVISION@"); public readonly static ProductConstants macOS = new ProductConstants ("@MACOS_NUGET_VERSION@", "@MACOS_NUGET_REVISION@"); + public readonly static ProductConstants MacCatalyst = new ProductConstants ("@MACCATALYST_NUGET_VERSION@", "@MACCATALYST_NUGET_VERSION@"); #else public readonly static ProductConstants iOS = new ProductConstants ("@IOS_VERSION@", "@IOS_REVISION@"); public readonly static ProductConstants tvOS = new ProductConstants ("@TVOS_VERSION@", "@TVOS_REVISION@"); public readonly static ProductConstants macOS = new ProductConstants ("@MACOS_VERSION@", "@MACOS_REVISION@"); + public readonly static ProductConstants MacCatalyst = new ProductConstants ("@MACCATALYST_VERSION@", "@MACCATALYST_REVISION@"); #endif } }