diff --git a/build-tools/scripts/Ndk.projitems.in b/build-tools/scripts/Ndk.projitems.in index 50cce76bec0..93c7ef1ced1 100644 --- a/build-tools/scripts/Ndk.projitems.in +++ b/build-tools/scripts/Ndk.projitems.in @@ -2,6 +2,7 @@ @NDK_RELEASE@ + @NDK_PKG_REVISION@ @NDK_ARMEABI_V7_API@ @NDK_ARMEABI_V7_API_NET@ @NDK_ARM64_V8A_API@ diff --git a/build-tools/scripts/XABuildConfig.cs.in b/build-tools/scripts/XABuildConfig.cs.in index 1dc9f717dc7..f6424409659 100644 --- a/build-tools/scripts/XABuildConfig.cs.in +++ b/build-tools/scripts/XABuildConfig.cs.in @@ -11,6 +11,7 @@ namespace Xamarin.Android.Tools public const string XamarinAndroidVersion = "@XAMARIN_ANDROID_VERSION@"; public const string XamarinAndroidCommitHash = "@XAMARIN_ANDROID_COMMIT_HASH@"; public const string XamarinAndroidBranch = "@XAMARIN_ANDROID_BRANCH@"; + public const string AndroidSdkBuildToolsVersion = "@SDK_BUILD_TOOLS_VERSION@"; public const int AndroidMinimumDotNetApiLevel = @ANDROID_DEFAULT_MINIMUM_DOTNET_API_LEVEL@; public const int AndroidLatestStableApiLevel = @ANDROID_LATEST_STABLE_API_LEVEL@; public const int AndroidLatestUnstableApiLevel = @ANDROID_LATEST_UNSTABLE_API_LEVEL@; diff --git a/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in b/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in index c51c3ee2b8a..e0fc7e154b8 100644 --- a/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in +++ b/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in @@ -15,6 +15,7 @@ @HOST_CC64@ @HOST_CXX32@ @HOST_CXX64@ + @JAVA_SDK_VERSION@ @JavaSdkDirectory@ @javac@ @jar@ diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index 2a29cfa14fd..070f1a19123 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -145,6 +145,7 @@ GeneratedFile Get_Configuration_OperatingSystem_props (Context context) { "@HOST_CXX32@", context.OS.CXX32 ?? String.Empty }, { "@HOST_CXX64@", context.OS.CXX64 ?? String.Empty }, { "@HOST_HOMEBREW_PREFIX@", context.OS.HomebrewPrefix ?? String.Empty }, + { "@JAVA_SDK_VERSION@", Configurables.Defaults.MicrosoftOpenJDK17Version.ToString () }, { "@JavaSdkDirectory@", context.OS.JavaHome }, { "@javac@", context.OS.JavaCPath }, { "@java@", context.OS.JavaPath }, @@ -174,6 +175,7 @@ GeneratedFile Get_XABuildConfig_cs (Context context) { "@NDK_X86_API@", BuildAndroidPlatforms.NdkMinimumAPILegacy32.ToString ().ToString () }, { "@NDK_X86_64_API@", BuildAndroidPlatforms.NdkMinimumAPI.ToString ().ToString () }, { "@XA_SUPPORTED_ABIS@", context.Properties.GetRequiredValue (KnownProperties.AndroidSupportedTargetJitAbis).Replace (':', ';') }, + { "@SDK_BUILD_TOOLS_VERSION@", context.Properties.GetRequiredValue (KnownProperties.XABuildToolsFolder) }, { "@ANDROID_DEFAULT_MINIMUM_DOTNET_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidMinimumDotNetApiLevel) }, { "@ANDROID_DEFAULT_TARGET_DOTNET_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidDefaultTargetDotnetApiLevel) }, { "@ANDROID_LATEST_STABLE_API_LEVEL@", context.Properties.GetRequiredValue (KnownProperties.AndroidLatestStableApiLevel) }, diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs index b63d8c2102e..f294e87c031 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs @@ -194,12 +194,7 @@ public void GetDependencyWhenSDKIsMissingTest ([Values (true, false)] bool creat static string GetExpectedBuildToolsVersion () { - var propsPath = Path.Combine (XABuildPaths.TopDirectory, "src", "Xamarin.Android.Build.Tasks", "Xamarin.Android.Common.props.in"); - var props = XElement.Load (propsPath); - var AndroidSdkBuildToolsVersion = props.Elements (MSBuildXmlns + "PropertyGroup") - .Elements (MSBuildXmlns + "AndroidSdkBuildToolsVersion") - .FirstOrDefault (); - return AndroidSdkBuildToolsVersion?.Value?.Trim (); + return XABuildConfig.AndroidSdkBuildToolsVersion; } } } diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index ad49a5e4116..1019df12397 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -183,10 +183,26 @@ DestinationFile="Xamarin.Android.BuildInfo.txt" Replacements="@MONO_COMMIT@=$(_BuildInfo_MonoCommit);@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);"> + + <_XACommonPropsReplacement Include="@COMMAND_LINE_TOOLS_VERSION@=$(CommandLineToolsFolder)" /> + <_XACommonPropsReplacement Include="@BUNDLETOOL_VERSION@=$(XABundleToolVersion)" /> + <_XACommonPropsReplacement Include="@JAVA_SDK_VERSION@=$(JavaSdkVersion)" /> + + <_XACommonPropsReplacement Include="@NDK_PKG_REVISION@=26.3.11579264" /> + <_XACommonPropsReplacement Include="@NDK_ARM64_V8A_API@=$(AndroidNdkApiLevel_ArmV8a)" /> + <_XACommonPropsReplacement Include="@NDK_ARMEABI_V7_API@=$(AndroidNdkApiLevel_ArmV7a)" /> + <_XACommonPropsReplacement Include="@NDK_X86_64_API@=$(AndroidNdkApiLevel_X86_64)" /> + <_XACommonPropsReplacement Include="@NDK_X86_API@=$(AndroidNdkApiLevel_X86)" /> + <_XACommonPropsReplacement Include="@PACKAGE_VERSION_BUILD@=$(XAVersionCommitCount)" /> + <_XACommonPropsReplacement Include="@PACKAGE_VERSION@=$(ProductVersion)" /> + <_XACommonPropsReplacement Include="@SDK_BUILD_TOOLS_VERSION@=$(XABuildToolsFolder)" /> + <_XACommonPropsReplacement Include="@SDK_PLATFORM_TOOLS_VERSION@=$(XAPlatformToolsVersion)" /> + <_XACommonPropsReplacement Include="@SDK_PLATFORM_VERSION@=android-$(AndroidLatestStableApiLevel)" /> + + Replacements="@(_XACommonPropsReplacement)"> - - + + @SDK_BUILD_TOOLS_VERSION@ + @SDK_PLATFORM_TOOLS_VERSION@ + @SDK_PLATFORM_VERSION@ + + @COMMAND_LINE_TOOLS_VERSION@ + + @NDK_PKG_REVISION@ + @JAVA_SDK_VERSION@ + @PACKAGE_VERSION@-@PACKAGE_VERSION_BUILD@ <_JavaInteropReferences>Java.Interop;System.Runtime diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 22c96864d05..99fab5c6d74 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -124,6 +124,9 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. ******************************************* --> + +