diff --git a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs index a4df4d587f1..90c9b049da1 100644 --- a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs +++ b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs @@ -12,6 +12,8 @@ static class KnownProperties public const string AndroidLatestStableFrameworkVersion = "AndroidLatestStableFrameworkVersion"; public const string AndroidMxeFullPath = "AndroidMxeFullPath"; public const string AndroidNdkDirectory = "AndroidNdkDirectory"; + public const string AndroidPackVersion = "AndroidPackVersion"; + public const string AndroidPackVersionSuffix = "AndroidPackVersionSuffix"; public const string AndroidSdkDirectory = "AndroidSdkDirectory"; public const string AndroidSupportedHostJitAbis = "AndroidSupportedHostJitAbis"; public const string AndroidSupportedTargetAotAbis = "AndroidSupportedTargetAotAbis"; diff --git a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in index 4f461e18369..a5d49b14c5b 100644 --- a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in +++ b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in @@ -16,6 +16,8 @@ namespace Xamarin.Android.Prepare properties.Add (KnownProperties.AndroidLatestStableFrameworkVersion, StripQuotes ("@AndroidLatestStableFrameworkVersion@")); properties.Add (KnownProperties.AndroidMxeFullPath, StripQuotes (@"@AndroidMxeFullPath@")); properties.Add (KnownProperties.AndroidNdkDirectory, StripQuotes (@"@AndroidNdkDirectory@")); + properties.Add (KnownProperties.AndroidPackVersion, StripQuotes (@"@AndroidPackVersion@")); + properties.Add (KnownProperties.AndroidPackVersionSuffix, StripQuotes (@"@AndroidPackVersionSuffix@")); properties.Add (KnownProperties.AndroidSdkDirectory, StripQuotes (@"@AndroidSdkDirectory@")); properties.Add (KnownProperties.AndroidSupportedHostJitAbis, StripQuotes ("@AndroidSupportedHostJitAbis@")); properties.Add (KnownProperties.AndroidSupportedTargetAotAbis, StripQuotes ("@AndroidSupportedTargetAotAbis@")); diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index 2a29cfa14fd..6d30d2b75e3 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -163,6 +163,12 @@ GeneratedFile Get_XABuildConfig_cs (Context context) { const string OutputFileName = "XABuildConfig.cs"; + string xaVersion = context.Properties.GetRequiredValue (KnownProperties.AndroidPackVersion); + string? xaVersionSuffix = context.Properties.GetRequiredValue (KnownProperties.AndroidPackVersionSuffix); + if (!String.IsNullOrEmpty(xaVersionSuffix)) { + xaVersion = $"{xaVersion}-{xaVersionSuffix}"; + } + var replacements = new Dictionary (StringComparer.Ordinal) { { "@NDK_REVISION@", context.BuildInfo.NDKRevision }, { "@NDK_RELEASE@", BuildAndroidPlatforms.AndroidNdkVersion }, @@ -178,7 +184,7 @@ GeneratedFile Get_XABuildConfig_cs (Context context) { "@ANDROID_DEFAULT_TARGET_DOTNET_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidDefaultTargetDotnetApiLevel) }, { "@ANDROID_LATEST_STABLE_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidLatestStableApiLevel) }, { "@ANDROID_LATEST_UNSTABLE_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidLatestUnstableApiLevel) }, - { "@XAMARIN_ANDROID_VERSION@", context.Properties.GetRequiredValue (KnownProperties.ProductVersion) }, + { "@XAMARIN_ANDROID_VERSION@", xaVersion }, { "@XAMARIN_ANDROID_COMMIT_HASH@", context.BuildInfo.XACommitHash }, { "@XAMARIN_ANDROID_BRANCH@", context.BuildInfo.XABranch }, }; diff --git a/build-tools/xaprepare/xaprepare/xaprepare.targets b/build-tools/xaprepare/xaprepare/xaprepare.targets index 3ba0ccfd582..81c7c742e1c 100644 --- a/build-tools/xaprepare/xaprepare/xaprepare.targets +++ b/build-tools/xaprepare/xaprepare/xaprepare.targets @@ -50,6 +50,8 @@ + +