[tests] Update tests to cope with a different default platform than the latest version. (#16063)

This commit is contained in:
Rolf Bjarne Kvinge 2022-09-23 14:08:40 +02:00 коммит произвёл GitHub
Родитель f592de721d
Коммит 5837d5a1e0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 28 добавлений и 4 удалений

Просмотреть файл

@ -5,15 +5,28 @@ namespace Xamarin.Utils {
public static string ToFrameworkWithDefaultVersion (this ApplePlatform @this)
{
var netVersion = Configuration.DotNetTfm;
var defaultTargetPlatformVersion = GetDefaultTargetPlatformVersion (@this);
switch (@this) {
case ApplePlatform.iOS:
return netVersion + "-ios" + SdkVersions.iOS;
return netVersion + "-ios" + defaultTargetPlatformVersion;
case ApplePlatform.MacOSX:
return netVersion + "-macos" + SdkVersions.OSX;
return netVersion + "-macos" + defaultTargetPlatformVersion;
case ApplePlatform.TVOS:
return netVersion + "-tvos" + SdkVersions.TVOS;
return netVersion + "-tvos" + defaultTargetPlatformVersion;
case ApplePlatform.MacCatalyst:
return netVersion + "-maccatalyst" + SdkVersions.MacCatalyst;
return netVersion + "-maccatalyst" + defaultTargetPlatformVersion;
default:
return "Unknown";
}
}
public static string GetDefaultTargetPlatformVersion (this ApplePlatform @this)
{
switch (@this) {
case ApplePlatform.iOS: return SdkVersions.DefaultTargetPlatformVersioniOS;
case ApplePlatform.TVOS: return SdkVersions.DefaultTargetPlatformVersiontvOS;
case ApplePlatform.MacOSX: return SdkVersions.DefaultTargetPlatformVersionmacOS;
case ApplePlatform.MacCatalyst: return SdkVersions.DefaultTargetPlatformVersionMacCatalyst;
default:
return "Unknown";
}

Просмотреть файл

@ -47,6 +47,12 @@
-e 's/@MACOS_REVISION@/$(MAC_COMMIT_DISTANCE) ($(CURRENT_BRANCH_SED_ESCAPED): $(CURRENT_HASH))/g' \
-e "s/@MACOS_NUGET_VERSION@/$(MACOS_NUGET_VERSION)/g" \
-e "s/@MACOS_NUGET_REVISION@/$(NUGET_PRERELEASE_IDENTIFIER)$(MACOS_NUGET_COMMIT_DISTANCE)+$(NUGET_BUILD_METADATA)/g" \
\
-e "s/@DEFAULT_TARGET_PLATFORM_VERSION_IOS@/$(DEFAULT_TARGET_PLATFORM_VERSION_IOS)/g" \
-e "s/@DEFAULT_TARGET_PLATFORM_VERSION_TVOS@/$(DEFAULT_TARGET_PLATFORM_VERSION_TVOS)/g" \
-e "s/@DEFAULT_TARGET_PLATFORM_VERSION_MACOS@/$(DEFAULT_TARGET_PLATFORM_VERSION_MACOS)/g" \
-e "s/@DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST@/$(DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST)/g" \
\
$< > $@

Просмотреть файл

@ -46,6 +46,11 @@ namespace Xamarin {
public const string MaxWatchDeploymentTarget = "@MAX_WATCH_DEPLOYMENT_TARGET@";
public const string MaxTVOSDeploymentTarget = "@MAX_TVOS_DEPLOYMENT_TARGET@";
public const string DefaultTargetPlatformVersioniOS = "@DEFAULT_TARGET_PLATFORM_VERSION_IOS@";
public const string DefaultTargetPlatformVersiontvOS = "@DEFAULT_TARGET_PLATFORM_VERSION_TVOS@";
public const string DefaultTargetPlatformVersionmacOS = "@DEFAULT_TARGET_PLATFORM_VERSION_MACOS@";
public const string DefaultTargetPlatformVersionMacCatalyst = "@DEFAULT_TARGET_PLATFORM_VERSION_MACCATALYST@";
public static Version OSXVersion { get { return new Version (OSX); }}
public static Version iOSVersion { get { return new Version (iOS); }}
public static Version WatchOSVersion { get { return new Version (WatchOS); }}