From c0aefeaaeef1acbbbbdf7ae589d15133cdc3064f Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Tue, 28 Nov 2023 12:57:45 -0500 Subject: [PATCH] [build] Remove the mono bundle dependency (#8517) Context: https://github.com/xamarin/xamarin-android/commit/b830f572b111e0c5379fd4194f260d2fd5a9e2fe Context: https://github.com/xamarin/xamarin-android/commit/5daf1027666098ef43e21d7692daf1513024819e Context: https://github.com/xamarin/xamarin-android/commit/a831d6230ddf03db45f2b5e47ad3802a56a3e400 Context: https://github.com/xamarin/xamarin-android/commit/8f338230ec22f1a9822e804268f9fd1d22ef27a2 All of the dependencies we had on the contents of the mono archive from commit mono/mono@6dd9def57ce have been removed from main. We can now remove all of the xaprepare sources that were used to download, prepare, and install components from the mono bundle. --- .external | 1 - Configuration.Override.props.in | 1 - Configuration.props | 3 - Makefile | 12 - build-tools/scripts/XAVersionInfo.targets | 1 - .../xaprepare/Application/Abi.Bitness.cs | 12 - .../xaprepare/xaprepare/Application/Abi.OS.cs | 12 - .../xaprepare/xaprepare/Application/Abi.cs | 119 --- .../xaprepare/Application/AbiType.cs | 11 - .../xaprepare/Application/BclFile.cs | 65 -- .../xaprepare/Application/BclFileTarget.cs | 23 - .../xaprepare/Application/BclFileType.cs | 8 - .../xaprepare/Application/BuildInfo.cs | 30 - .../xaprepare/Application/Context.cs | 203 +---- .../Application/Extensions.Runtime.cs | 14 - .../GeneratedMakeRulesFile.MacOS.cs | 13 - .../Application/GeneratedMakeRulesFile.cs | 6 - ...GeneratedProfileAssembliesProjitemsFile.cs | 186 ---- .../xaprepare/Application/KnownProperties.cs | 1 - .../Application/LlvmRuntime.Linux.cs | 9 - .../Application/LlvmRuntime.MacOS.cs | 9 - .../Application/LlvmRuntime.Windows.cs | 9 - .../xaprepare/Application/LlvmRuntime.cs | 23 - .../xaprepare/Application/MonoJitRuntime.cs | 30 - .../xaprepare/Application/MonoRuntime.cs | 31 - .../Application/MonoRuntimesHelpers.cs | 214 ----- .../xaprepare/Application/MonoUtilityFile.cs | 27 - .../Application/Properties.Defaults.cs.in | 1 - .../xaprepare/Application/Runtime.cs | 66 -- .../xaprepare/Application/RuntimeFile.cs | 51 -- .../xaprepare/Application/RuntimeFileType.cs | 10 - .../xaprepare/Application/Utilities.cs | 54 -- .../xaprepare/ConfigAndData/AbiNames.cs | 167 ---- .../ConfigAndData/BuildAndroidPlatforms.cs | 7 - .../ConfigAndData/Configurables.MacOS.cs | 5 - .../ConfigAndData/Configurables.Unix.cs | 5 - .../ConfigAndData/Configurables.Windows.cs | 3 - .../xaprepare/ConfigAndData/Configurables.cs | 126 +-- .../xaprepare/ConfigAndData/Runtimes.Code.cs | 232 ----- .../xaprepare/ConfigAndData/Runtimes.Unix.cs | 16 - .../ConfigAndData/Runtimes.Windows.cs | 15 - .../xaprepare/ConfigAndData/Runtimes.cs | 811 ------------------ build-tools/xaprepare/xaprepare/Main.cs | 9 - .../xaprepare/OperatingSystems/MacOS.cs | 15 - .../xaprepare/OperatingSystems/OS.cs | 6 - .../Configuration.OperatingSystem.props.in | 1 - .../xaprepare/Resources/MonoGitHash.props.in | 6 - .../Scenario_PrepareImageDependencies.cs | 23 - .../Scenarios/Scenario_Standard.Windows.cs | 11 - .../xaprepare/Scenarios/Scenario_Standard.cs | 10 - .../Steps/Step_BuildMonoRuntimes.Unix.cs | 451 ---------- .../Steps/Step_DownloadMonoArchive.cs | 152 ---- .../xaprepare/Steps/Step_GenerateFiles.cs | 19 - .../Steps/Step_InstallMonoRuntimes.cs | 337 -------- .../xaprepare/Steps/Step_PrepareBundle.cs | 119 --- .../xaprepare/Steps/Step_PrepareExternal.cs | 36 - .../Step_PrepareExternalGitDependencies.cs | 9 - .../Step_PrepareImageDependencies.MacOS.cs | 27 - .../Steps/Step_PrepareImageDependencies.cs | 66 -- .../xaprepare/Steps/Step_PrepareLocal.cs | 22 - .../xaprepare/Steps/Step_PrepareMSBuild.cs | 21 - .../Steps/Step_ShowEnabledRuntimes.cs | 28 - .../xaprepare/ThirdPartyNotices/mono.cs | 277 +----- .../xaprepare/xaprepare/xaprepare.csproj | 4 - .../xaprepare/xaprepare/xaprepare.targets | 1 - .../Xamarin.Android.Build.Tasks.targets | 2 +- .../Xamarin.Android.BuildInfo.txt.in | 1 - 67 files changed, 47 insertions(+), 4248 deletions(-) delete mode 100644 build-tools/xaprepare/xaprepare/Application/Abi.Bitness.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/Abi.OS.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/Abi.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/AbiType.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/BclFile.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/BclFileTarget.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/BclFileType.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/Extensions.Runtime.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/GeneratedMakeRulesFile.MacOS.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/GeneratedProfileAssembliesProjitemsFile.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Linux.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/LlvmRuntime.MacOS.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Windows.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/LlvmRuntime.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/MonoJitRuntime.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/MonoRuntime.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/MonoRuntimesHelpers.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/MonoUtilityFile.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/Runtime.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/RuntimeFile.cs delete mode 100644 build-tools/xaprepare/xaprepare/Application/RuntimeFileType.cs delete mode 100644 build-tools/xaprepare/xaprepare/ConfigAndData/AbiNames.cs delete mode 100644 build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Code.cs delete mode 100644 build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Unix.cs delete mode 100644 build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Windows.cs delete mode 100644 build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs delete mode 100644 build-tools/xaprepare/xaprepare/Resources/MonoGitHash.props.in delete mode 100644 build-tools/xaprepare/xaprepare/Scenarios/Scenario_PrepareImageDependencies.cs delete mode 100644 build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.Windows.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_DownloadMonoArchive.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_PrepareBundle.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternal.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.MacOS.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_PrepareLocal.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_PrepareMSBuild.cs delete mode 100644 build-tools/xaprepare/xaprepare/Steps/Step_ShowEnabledRuntimes.cs diff --git a/.external b/.external index 34e0d15bac6..697d5879312 100644 --- a/.external +++ b/.external @@ -1,2 +1 @@ xamarin/monodroid:main@c5f1e77bc732dc660090a8d59048f07de846ccd7 -mono/mono:2020-02@6dd9def57ce969ca04a0ecd9ef72c0a8f069112d diff --git a/Configuration.Override.props.in b/Configuration.Override.props.in index e60799fc0c5..8e5284085df 100644 --- a/Configuration.Override.props.in +++ b/Configuration.Override.props.in @@ -42,6 +42,5 @@ $(HOME)\android-archives $(HOME)\android-toolchain - $(AndroidToolchainDirectory)\mxe diff --git a/Configuration.props b/Configuration.props index 1c9a42b5e0b..b69935065d3 100644 --- a/Configuration.props +++ b/Configuration.props @@ -76,8 +76,6 @@ v1.0 $(HOME)\android-archives $(HOME)\android-toolchain - \usr - $(HostHomebrewPrefix) $(ANDROID_SDK_ROOT) $(AndroidToolchainDirectory)\sdk $(ANDROID_NDK_LATEST_HOME) @@ -140,7 +138,6 @@ $(JavaSdkDirectory) - $([System.IO.Path]::GetFullPath ('$(AndroidMxeInstallPrefix)')) $([System.IO.Path]::GetFullPath ('$(AndroidNdkDirectory)')) $([System.IO.Path]::GetFullPath ('$(AndroidSdkDirectory)')) $([System.IO.Path]::GetFullPath ('$(JavaInteropSourceDirectory)')) diff --git a/Makefile b/Makefile index 914a2a03225..b1c5fc1692c 100644 --- a/Makefile +++ b/Makefile @@ -59,18 +59,6 @@ ifneq ($(PREPARE_AUTOPROVISION),0) _PREPARE_ARGS += --auto-provision=yes --auto-provision-uses-sudo=yes endif -ifeq ($(OS_NAME),Darwin) -ifeq ($(HOMEBREW_PREFIX),) -HOMEBREW_PREFIX ?= $(shell brew --prefix) -endif -else -HOMEBREW_PREFIX := $prefix -endif - -ifeq ($(wildcard Configuration.OperatingSystem.props),) -PREPARE_MSBUILD_FLAGS += "/p:HostHomebrewPrefix=$(HOMEBREW_PREFIX)" -endif - ifneq ($(PREPARE_SCENARIO),) _PREPARE_ARGS += -s:"$(PREPARE_SCENARIO)" endif diff --git a/build-tools/scripts/XAVersionInfo.targets b/build-tools/scripts/XAVersionInfo.targets index a96bcd8f4d1..82d4d5d1f65 100644 --- a/build-tools/scripts/XAVersionInfo.targets +++ b/build-tools/scripts/XAVersionInfo.targets @@ -6,7 +6,6 @@ - - - -"; - - const string FileBottom = @" - -"; - - public GeneratedProfileAssembliesProjitemsFile (string outputPath) - : base (outputPath) - {} - - public override void Generate (Context context) - { - var runtimes = new Runtimes (); - - IEnumerable facadeAssemblies = runtimes.BclFilesToInstall.Where (f => f.Type == BclFileType.FacadeAssembly); - IEnumerable profileAssemblies = runtimes.BclFilesToInstall.Where (f => f.Type == BclFileType.ProfileAssembly); - IEnumerable testAssemblies = runtimes.TestAssemblies; - - EnsureNoDiscrepancies (facadeAssemblies, profileAssemblies, testAssemblies.Where (ta => ta.TestType != TestAssemblyType.Reference && ta.TestType != TestAssemblyType.TestRunner)); - - using (var fs = File.Open (OutputPath, FileMode.Create)) { - using (var sw = new StreamWriter (fs)) { - GenerateFile (sw, facadeAssemblies, profileAssemblies, testAssemblies); - } - } - } - - void EnsureNoDiscrepancies (IEnumerable facadeAssemblies, IEnumerable profileAssemblies, IEnumerable testAssemblies) - { - bool failed = false; - - // We compare against the *installed* locations since we will not always need to download and/or build the - // Mono Archive (when the XA bundle is present) so we can't rely on the *source* locations of those - // assemblies to be present. - failed |= FileSetsDiffer (facadeAssemblies, Configurables.Paths.InstallBCLFrameworkFacadesDir, "Façade", new HashSet (StringComparer.OrdinalIgnoreCase) { "nunitlite.dll" }); - failed |= FileSetsDiffer (profileAssemblies, Configurables.Paths.InstallBCLFrameworkDir, "Profile"); - failed |= FileSetsDiffer (testAssemblies, Configurables.Paths.BCLTestsDestDir, "Test"); - - if (failed) - throw new InvalidOperationException ("Profile assembly discrepancies found. Please examine 'build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs' to make sure all assemblies listed above are included"); - } - - bool FileSetsDiffer (IEnumerable assemblies, string directoryPath, string batchName, HashSet? ignoreFiles = null) - { - List tests = FilesFromDir (directoryPath, ignoreFiles).ToList (); - tests.AddRange ( - FilesFromDir ( - directoryPath, - globPattern: "*.resources.dll", - stripPath: false, - searchSubdirs: true - ).Select (f => Utilities.GetRelativePath (directoryPath, f)) - ); - - return FileSetsDiffer (ToStringSet (assemblies), tests, batchName); - } - - bool FileSetsDiffer (IEnumerable assemblies, string directoryPath, string batchName, HashSet? ignoreFiles = null) - { - return FileSetsDiffer (ToStringSet (assemblies), FilesFromDir (directoryPath, ignoreFiles), batchName); - } - - bool FileSetsDiffer (IEnumerable set1, IEnumerable set2, string batchName) - { - List diff = set1.Except (set2).ToList (); - - if (diff.Count == 0) - return false; - - Log.ErrorLine ($"{batchName} assemblies found on disk but missing from xaprepare:"); - foreach (string asm in diff) { - Log.StatusLine ($" {Context.Instance.Characters.Bullet} {asm}", ConsoleColor.Cyan); - } - - return true; - } - - IEnumerable FilesFromDir (string directoryPath, HashSet? ignoreFiles = null, string globPattern = "*.dll", bool stripPath = true, bool searchSubdirs = false) - { - IEnumerable files = Directory.EnumerateFiles ( - directoryPath, - globPattern, - searchSubdirs ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly - ).Select (f => stripPath ? Path.GetFileName (f) : f); - - if (ignoreFiles == null || ignoreFiles.Count == 0) - return files; - - return files.Where (f => !ignoreFiles.Contains (f)); - } - - IEnumerable ToStringSet (IEnumerable files) - { - return files.Select (bcf => bcf.Name); - } - - IEnumerable ToStringSet (IEnumerable files) - { - return files.Select (ta => ta.Name); - } - - void GenerateFile (StreamWriter sw, IEnumerable facadeAssemblies, IEnumerable profileAssemblies, IEnumerable testAssemblies) - { - sw.Write (FileTop); - - WriteGroup (sw, "MonoFacadeAssembly", facadeAssemblies); - WriteGroup (sw, "MonoProfileAssembly", profileAssemblies); - WriteGroup (sw, testAssemblies); - - sw.Write (FileBottom); - } - - void WriteGroup (StreamWriter sw, string itemName, IEnumerable files) - { - StartGroup (sw); - foreach (BclFile bcf in files) { - sw.WriteLine ($" <{itemName} Include=\"{bcf.Name}\" />"); - } - foreach (BclFile bcf in files.Where (b => !b.ExcludeDebugSymbols)) { - sw.WriteLine ($" <{itemName}Symbol Include=\"{Path.GetFileName (bcf.DebugSymbolsPath)}\" />"); - } - EndGroup (sw); - } - - void WriteGroup (StreamWriter sw, IEnumerable files) - { - sw.WriteLine (""); - StartGroup (sw); - foreach (TestAssembly taf in files) { - string itemName = "MonoTestAssembly"; - string testType = String.Empty; - - switch (taf.TestType) { - case TestAssemblyType.Satellite: - itemName = "MonoTestSatelliteAssembly"; - break; - - case TestAssemblyType.XUnit: - testType = "xunit"; - break; - - case TestAssemblyType.Reference: - testType = "reference"; - break; - - case TestAssemblyType.TestRunner: - itemName = "MonoTestRunner"; - break; - } - - sw.Write ($" <{itemName} Include=\"{taf.Name}\""); - if (String.IsNullOrEmpty (testType)) - sw.WriteLine (" />"); - else { - sw.WriteLine (" >"); - sw.WriteLine ($" {testType}"); - sw.WriteLine ($" "); - } - } - EndGroup (sw); - } - - void StartGroup (StreamWriter sw) - { - sw.WriteLine (" "); - } - - void EndGroup (StreamWriter sw) - { - sw.WriteLine (" "); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs index 349e4cc41a1..dd2c7c733c0 100644 --- a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs +++ b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs @@ -10,7 +10,6 @@ static class KnownProperties public const string AndroidLatestStableApiLevel = "AndroidLatestStableApiLevel"; public const string AndroidLatestUnstableApiLevel = "AndroidLatestUnstableApiLevel"; public const string AndroidLatestStableFrameworkVersion = "AndroidLatestStableFrameworkVersion"; - public const string AndroidMxeFullPath = "AndroidMxeFullPath"; public const string AndroidNdkDirectory = "AndroidNdkDirectory"; public const string AndroidSdkDirectory = "AndroidSdkDirectory"; public const string AndroidSupportedTargetAotAbis = "AndroidSupportedTargetAotAbis"; diff --git a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Linux.cs b/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Linux.cs deleted file mode 100644 index 1552e3a5ae1..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Linux.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - partial class LlvmRuntime - { - const string OSInstallPath = "Linux"; - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.MacOS.cs b/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.MacOS.cs deleted file mode 100644 index 23a819c7677..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.MacOS.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - partial class LlvmRuntime - { - const string OSInstallPath = "Darwin"; - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Windows.cs b/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Windows.cs deleted file mode 100644 index c24fad5cd98..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.Windows.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - partial class LlvmRuntime - { - const string OSInstallPath = ""; - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.cs b/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.cs deleted file mode 100644 index 2de5a75b3d2..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/LlvmRuntime.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - partial class LlvmRuntime : Runtime - { - public override string Flavor => "LLVM"; - public bool InstallBinaries { get; protected set; } = true; - - public LlvmRuntime (string name, Func enabledCheck) - : base (name, enabledCheck) - {} - - public override void Init (Context context) - { - if (Context.IsLlvmWindowsAbi (Name)) { - ExeSuffix = Configurables.Defaults.WindowsExecutableSuffix; - InstallPath = Configurables.Paths.InstallMSBuildDir; - } else - InstallPath = OSInstallPath; - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/MonoJitRuntime.cs b/build-tools/xaprepare/xaprepare/Application/MonoJitRuntime.cs deleted file mode 100644 index 4838e62647e..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/MonoJitRuntime.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - class MonoJitRuntime : MonoRuntime - { - public override string Flavor => "Android JIT"; - - public MonoJitRuntime (string abiName, bool interpreter, Func enabledCheck) - : base (abiName, enabledCheck) - { - if (interpreter) { - MonoSdksPrefix = "interpreter-"; - DisplayName = $"{abiName} (interpreter)"; - } - } - - public override void Init (Context context) - { - InstallPath = "lib"; - NativeLibraryExtension = Configurables.Defaults.MonoJitRuntimeNativeLibraryExtension; - OutputAotProfilerFilename = Configurables.Defaults.MonoRuntimeOutputAotProfilerFilename; - OutputMonoBtlsFilename = Configurables.Defaults.MonoRuntimeOutputMonoBtlsFilename; - OutputMonoPosixHelperFilename = Configurables.Defaults.MonoRuntimeOutputMonoPosixHelperFilename; - OutputProfilerFilename = Configurables.Defaults.MonoRuntimeOutputProfilerFilename; - Strip = Path.Combine (Configurables.Paths.AndroidToolchainBinDirectory, "llvm-strip"); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/MonoRuntime.cs b/build-tools/xaprepare/xaprepare/Application/MonoRuntime.cs deleted file mode 100644 index 4fabdb2723d..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/MonoRuntime.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - abstract class MonoRuntime : Runtime - { - public bool CanStripNativeLibrary { get; set; } = true; - public string CrossMonoName { get; set; } = String.Empty; - public string ExePrefix { get; set; } = String.Empty; - public bool IsCrossRuntime { get; set; } - public string NativeLibraryExtension { get; set; } = String.Empty; - - /// - /// Optional directory prefix for native library source. This should be a path relative to runtime's library - /// output dir and it exists because MinGW builds will put the runtime .dll in the bin directory instead of in - /// the lib one. - /// - public string NativeLibraryDirPrefix { get; set; } = String.Empty; - public string OutputAotProfilerFilename { get; set; } = String.Empty; - public string OutputMonoBtlsFilename { get; set; } = String.Empty; - public string OutputMonoPosixHelperFilename { get; set; } = String.Empty; - public string OutputProfilerFilename { get; set; } = String.Empty; - public string OutputRuntimeFilename { get; set; } = Configurables.Defaults.MonoRuntimeOutputFileName; - public string Strip { get; set; } = String.Empty; - public string StripFlags { get; set; } = "--strip-debug"; - - protected MonoRuntime (string name, Func enabledCheck) - : base (name, enabledCheck) - {} - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/MonoRuntimesHelpers.cs b/build-tools/xaprepare/xaprepare/Application/MonoRuntimesHelpers.cs deleted file mode 100644 index 6e23fddb304..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/MonoRuntimesHelpers.cs +++ /dev/null @@ -1,214 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Xamarin.Android.Prepare -{ - class MonoRuntimesHelpers - { - public static string UtilitiesDestinationDir => Configurables.Paths.InstallMSBuildDir; - public static string BCLRedistListDestinationDir => Configurables.Paths.InstallBCLFrameworkRedistListDir; - public static string BCLTestsDestinationDir => Configurables.Paths.BCLTestsDestDir; - public static string BCLTestsArchivePath => Configurables.Paths.BCLTestsArchivePath; - public static string RuntimeDestinationDir => Configurables.Paths.InstallMSBuildDir; - public static string FrameworkListPath => Configurables.Paths.FrameworkListInstallPath; - - public static readonly Dictionary BCLDestinationDirs = new Dictionary () { - { BclFileTarget.Android, Configurables.Paths.InstallBCLFrameworkDir }, - { BclFileTarget.DesignerHost, Configurables.Paths.InstallHostBCLDir }, - { BclFileTarget.DesignerWindows, Configurables.Paths.InstallWindowsBCLDir }, - }; - - public static readonly Dictionary BCLFacadesDestinationDirs = new Dictionary () { - { BclFileTarget.Android, Configurables.Paths.InstallBCLFrameworkFacadesDir }, - { BclFileTarget.DesignerHost, Configurables.Paths.InstallHostBCLFacadesDir }, - { BclFileTarget.DesignerWindows, Configurables.Paths.InstallWindowsBCLFacadesDir }, - }; - - public static List GetEnabledRuntimes (Runtimes allRuntimes, bool enableLogging) - { - if (allRuntimes == null) - throw new ArgumentNullException (nameof (allRuntimes)); - - var context = Context.Instance; - var enabledRuntimes = new List (); - - if (enableLogging) - Log.Instance.StatusLine ("Enabled Mono Android runtime ABIs:", ConsoleColor.White); - - foreach (Runtime runtime in allRuntimes.Items.Where (r => r is MonoJitRuntime && r.Enabled)) { - enabledRuntimes.Add (runtime); - if (enableLogging) - Log.Instance.StatusLine ($" {context.Characters.Bullet} {runtime.DisplayName}"); - } - return enabledRuntimes; - } - - public static (string executable, string debugSymbols) GetDestinationPaths (MonoUtilityFile muf) - { - string destDir = UtilitiesDestinationDir; - string targetFileName; - - if (!String.IsNullOrEmpty (muf.TargetName)) - targetFileName = muf.TargetName!; - else - targetFileName = Path.GetFileName (muf.SourcePath); - - string destFilePath = Path.Combine (destDir, targetFileName); - if (String.IsNullOrEmpty (muf.DebugSymbolsPath)) - return (destFilePath, String.Empty); - - return (destFilePath, Path.Combine (destDir, Utilities.GetDebugSymbolsPath (targetFileName))); - } - - public static (string assembly, string debugSymbols) GetDestinationPaths (BclFile bf) - { - string destDir; - switch (bf.Type) { - case BclFileType.ProfileAssembly: - destDir = BCLDestinationDirs [bf.Target]; - break; - - case BclFileType.FacadeAssembly: - destDir = BCLFacadesDestinationDirs [bf.Target]; - break; - - default: - throw new InvalidOperationException ($"Unsupported BCL file type {bf.Type} for file {bf.Name}"); - } - - string destFile = Path.Combine (destDir, bf.Name); - if (bf.ExcludeDebugSymbols) - return (destFile, String.Empty); - - return (destFile, Path.Combine (destDir, Path.GetFileName (bf.DebugSymbolsPath) ?? String.Empty)); - } - - public static (string assembly, string debugSymbols) GetDestinationPaths (TestAssembly tasm) - { - if (tasm == null) - throw new ArgumentNullException (nameof (tasm)); - - bool pdbRequired; - switch (tasm.TestType) { - case TestAssemblyType.Reference: - case TestAssemblyType.TestRunner: - case TestAssemblyType.XUnit: - case TestAssemblyType.NUnit: - case TestAssemblyType.Satellite: - pdbRequired = tasm.TestType != TestAssemblyType.Satellite && !tasm.ExcludeDebugSymbols; - break; - - default: - throw new InvalidOperationException ($"Unsupported test assembly type: {tasm.TestType}"); - } - - string destDir; - if (tasm.Name.IndexOf (Path.DirectorySeparatorChar) >= 0) - destDir = Path.Combine (BCLTestsDestinationDir, Path.GetDirectoryName (tasm.Name) ?? String.Empty); - else - destDir = BCLTestsDestinationDir; - - string destFile = Path.Combine (destDir, Path.GetFileName (tasm.Name)); - return (destFile, pdbRequired ? Utilities.GetDebugSymbolsPath (destFile) : String.Empty); - } - - public static (bool skip, string src, string dst) GetRuntimeFilePaths (Runtime runtime, RuntimeFile rtf) - { - if (rtf.ShouldSkip != null && rtf.ShouldSkip (runtime)) - return (true, String.Empty, String.Empty); - - return ( - false, - GetPath ("source", rtf.Source (runtime), Configurables.Paths.MonoSourceFullPath), - GetPath ("destination", rtf.Destination (runtime), RuntimeDestinationDir) - ); - - string GetPath (string name, string path, string defaultRoot) - { - if (String.IsNullOrEmpty (path)) - throw new InvalidOperationException ($"Empty {name} file path"); - if (!Path.IsPathRooted (path)) - path = Path.Combine (defaultRoot, path); - return Path.GetFullPath (path); - } - } - - public static string GetRootDir (Runtime runtime) - { - if (runtime == null) - throw new ArgumentNullException (nameof (runtime)); - - return Path.Combine (Configurables.Paths.MonoSDKSRelativeOutputDir, $"android-{runtime.PrefixedName}-{Configurables.Defaults.MonoSdksConfiguration}"); - } - - public static bool AreRuntimeItemsInstalled (Context context, Runtimes runtimes) - { - if (context == null) - throw new ArgumentNullException (nameof (context)); - if (runtimes == null) - throw new ArgumentNullException (nameof (runtimes)); - - if (!string.IsNullOrEmpty (context.MonoArchiveCustomUrl)) { - context.Log.StatusLine ("Skipping AreRuntimeItemsInstalled check, due to custom mono archive URL."); - return false; - } - - foreach (var bclFile in runtimes.BclFilesToInstall) { - (string destFilePath, string debugSymbolsDestPath) = GetDestinationPaths (bclFile); - if (!DoesItemExist (destFilePath, bclFile.ExcludeDebugSymbols, debugSymbolsDestPath)) - return false; - } - - foreach (var bclFile in runtimes.DesignerHostBclFilesToInstall) { - (string destFilePath, string debugSymbolsDestPath) = GetDestinationPaths (bclFile); - if (!DoesItemExist (destFilePath, bclFile.ExcludeDebugSymbols, debugSymbolsDestPath)) - return false; - } - - foreach (var bclFile in runtimes.DesignerWindowsBclFilesToInstall) { - (string destFilePath, string debugSymbolsDestPath) = GetDestinationPaths (bclFile); - if (!DoesItemExist (destFilePath, bclFile.ExcludeDebugSymbols, debugSymbolsDestPath)) - return false; - } - - foreach (var testFile in runtimes.TestAssemblies) { - (string destFilePath, string debugSymbolsDestPath) = GetDestinationPaths (testFile); - if (!DoesItemExist (destFilePath, true, debugSymbolsDestPath)) - return false; - } - - foreach (var utilFile in runtimes.UtilityFilesToInstall) { - (string destFilePath, string debugSymbolsDestPath) = GetDestinationPaths (utilFile); - if (!DoesItemExist (destFilePath, utilFile.IgnoreDebugInfo, debugSymbolsDestPath)) - return false; - } - - foreach (var runtime in GetEnabledRuntimes (runtimes, true)) { - foreach (var runtimeFile in runtimes.RuntimeFilesToInstall) { - (bool skipFile, string src, string dst) = GetRuntimeFilePaths (runtime, runtimeFile); - - if (!skipFile && (dst.Length == 0 || !File.Exists (dst))) { - Log.Instance.WarningLine ($"File '{dst}' missing, skipping the rest of runtime item file scan"); - return false; - } - } - } - - return true; - - bool DoesItemExist (string destFilePath, bool shouldExcludeSymbols, string debugSymbolsDestPath) - { - if (File.Exists (destFilePath) && shouldExcludeSymbols) - return true; - - if (File.Exists (destFilePath) && !shouldExcludeSymbols && !String.IsNullOrEmpty (debugSymbolsDestPath) && File.Exists (debugSymbolsDestPath)) - return true; - - Log.Instance.DebugLine ($"File '{destFilePath}' or symbols '{debugSymbolsDestPath}' missing, skipping the rest of runtime item file scan"); - return false; - } - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/MonoUtilityFile.cs b/build-tools/xaprepare/xaprepare/Application/MonoUtilityFile.cs deleted file mode 100644 index e8f16caafc4..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/MonoUtilityFile.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - sealed class MonoUtilityFile - { - public string SourcePath { get; } - public string? TargetName { get; } - public bool RemapCecil { get; } - public bool IgnoreDebugInfo { get; } - - public string DebugSymbolsPath => Utilities.GetDebugSymbolsPath (SourcePath); - - public MonoUtilityFile (string name, bool remap = false, string? targetName = null, bool ignoreDebugInfo = false) - { - name = name.Trim (); - if (String.IsNullOrEmpty (name)) - throw new ArgumentException ("must not be null or empty", nameof (name)); - - SourcePath = Path.GetFullPath (Path.Combine (Configurables.Paths.MonoProfileToolsDir, name)); - RemapCecil = remap; - TargetName = targetName; - IgnoreDebugInfo = ignoreDebugInfo; - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in index 5b07a8dec54..2d0bd087f0c 100644 --- a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in +++ b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in @@ -14,7 +14,6 @@ namespace Xamarin.Android.Prepare properties.Add (KnownProperties.AndroidLatestStableApiLevel, StripQuotes ("@AndroidLatestStableApiLevel@")); properties.Add (KnownProperties.AndroidLatestUnstableApiLevel, StripQuotes ("@AndroidLatestUnstableApiLevel@")); properties.Add (KnownProperties.AndroidLatestStableFrameworkVersion, StripQuotes ("@AndroidLatestStableFrameworkVersion@")); - properties.Add (KnownProperties.AndroidMxeFullPath, StripQuotes (@"@AndroidMxeFullPath@")); properties.Add (KnownProperties.AndroidNdkDirectory, StripQuotes (@"@AndroidNdkDirectory@")); properties.Add (KnownProperties.AndroidSdkDirectory, StripQuotes (@"@AndroidSdkDirectory@")); properties.Add (KnownProperties.AndroidSupportedTargetAotAbis, StripQuotes ("@AndroidSupportedTargetAotAbis@")); diff --git a/build-tools/xaprepare/xaprepare/Application/Runtime.cs b/build-tools/xaprepare/xaprepare/Application/Runtime.cs deleted file mode 100644 index 647b48d4d59..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/Runtime.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - abstract class Runtime : AppObject - { - string displayName = String.Empty; - Func enabledCheck; - - /// - /// Set to true if the current runtime is supported on the host OS. - /// - protected bool SupportedOnHostOS { get; set; } = true; - - protected Context Context => Context.Instance; - public bool Enabled => SupportedOnHostOS && enabledCheck (Context); - public string ExeSuffix { get; protected set; } = String.Empty; - - /// - /// Path relative to where the runtime will be placed or - /// null to install the runtime directly under . In - /// each case the runtime will be appended to create full path to the destination - /// directory. - /// - public string InstallPath { get; protected set; } = String.Empty; - public string Name { get; protected set; } - - /// - /// Name of the runtime for display purposes. If not set explicitly, it is the same as - /// - public string DisplayName { - get => String.IsNullOrEmpty (displayName) ? Name : displayName; - set => displayName = value ?? String.Empty; - } - - /// - /// Purely cosmetic thing - the kind of runtime (LLVM, JIT etc), for progress reporting. - /// - public abstract string Flavor { get; } - - /// - /// Prefix to used by MonoSDKs to construct the runtime output directory. - /// - protected string MonoSdksPrefix { get; set; } = String.Empty; - - /// - /// Host runtimes need a prefix in order to match Mono SDKs output directory name for them. This property is - /// defined in the base class to make code using the runtime definitions simpler. - /// - public string PrefixedName => String.IsNullOrEmpty (MonoSdksPrefix) ? Name : $"{MonoSdksPrefix}{Name}"; - - public Runtime (string name, Func enabledCheck) - { - if (String.IsNullOrEmpty (name)) - throw new ArgumentException ("must not be null or empty", nameof (name)); - - if (enabledCheck == null) - throw new ArgumentNullException (nameof (enabledCheck)); - - this.enabledCheck = enabledCheck; - Name = name; - } - - public abstract void Init (Context context); - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/RuntimeFile.cs b/build-tools/xaprepare/xaprepare/Application/RuntimeFile.cs deleted file mode 100644 index 7e61be9c847..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/RuntimeFile.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - class RuntimeFile - { - /// - /// Path of the source file (one in the Mono SDK output location). Either relative to Mono SDK output path or - /// absolute. - /// - public Func Source { get; } - - /// - /// Destination of the file. Either relative to or absolute. - /// - public Func Destination { get; } - - /// - /// An optional check on whether or not the file should be installed for the particular runtime. - /// - public Func? ShouldSkip { get; } - - /// - /// Whether or not to strip the binary of debugging symbols after installation. - /// - public bool Strip { get; } = true; - - /// - /// Type of the file. It's needed in order to determine what tools, if any, we can run on the file once it is - /// installed, if any. - /// - public RuntimeFileType Type { get; } = RuntimeFileType.Other; - - /// - /// If set to true then the file will be copied only once, not per runtime - /// - public bool Shared { get; } - - public bool AlreadyCopied { get; set; } - - public RuntimeFile (Func sourceCreator, Func destinationCreator, Func? shouldSkip = null, bool strip = true, RuntimeFileType type = RuntimeFileType.Other, bool shared = false) - { - Source = sourceCreator; - Destination = destinationCreator; - ShouldSkip = shouldSkip; - Strip = strip; - Type = type; - Shared = shared; - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/RuntimeFileType.cs b/build-tools/xaprepare/xaprepare/Application/RuntimeFileType.cs deleted file mode 100644 index 70e0e9cde58..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/RuntimeFileType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Xamarin.Android.Prepare -{ - enum RuntimeFileType - { - Other, - Binary, - StrippableBinary, - SdkHeader, - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/Utilities.cs b/build-tools/xaprepare/xaprepare/Application/Utilities.cs index 3757fff9010..e380f8563ca 100644 --- a/build-tools/xaprepare/xaprepare/Application/Utilities.cs +++ b/build-tools/xaprepare/xaprepare/Application/Utilities.cs @@ -53,60 +53,6 @@ public static bool ParseAndroidPkgRevision (string? v, out Version? version, out return false; } - public static bool AbiChoiceChanged (Context context) - { - string cacheFile = Configurables.Paths.MonoRuntimesEnabledAbisCachePath; - if (!File.Exists (cacheFile)) { - Log.DebugLine ($"Enabled ABI cache file not found at {cacheFile}"); - return true; - } - - var oldAbis = new HashSet (StringComparer.Ordinal); - foreach (string l in File.ReadAllLines (cacheFile)) { - string line = l.Trim (); - if (String.IsNullOrEmpty (line) || oldAbis.Contains (line)) - continue; - oldAbis.Add (line); - } - - HashSet? currentAbis = null; - FillCurrentAbis (context, ref currentAbis); - - if (currentAbis == null) - return false; - - if (oldAbis.Count != currentAbis.Count) - return true; - - foreach (string abi in oldAbis) { - if (!currentAbis.Contains (abi)) - return true; - } - - return false; - } - - public static void SaveAbiChoice (Context context) - { - HashSet? currentAbis = null; - FillCurrentAbis (context, ref currentAbis); - - if (currentAbis == null || currentAbis.Count == 0) { - Log.WarningLine ("Cannot save ABI choice, no current ABIs"); - return; - } - - string cacheFile = Configurables.Paths.MonoRuntimesEnabledAbisCachePath; - Log.DebugLine ($"Writing ABI cache file {cacheFile}"); - File.WriteAllLines (cacheFile, currentAbis); - } - - static void FillCurrentAbis (Context context, ref HashSet? currentAbis) - { - Utilities.AddAbis (context.Properties.GetRequiredValue (KnownProperties.AndroidSupportedTargetJitAbis).Trim (), ref currentAbis); - Utilities.AddAbis (context.Properties.GetRequiredValue (KnownProperties.AndroidSupportedTargetAotAbis).Trim (), ref currentAbis); - } - public static string ToXamarinAndroidPropertyValue (ICollection coll) { if (coll == null) diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/AbiNames.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/AbiNames.cs deleted file mode 100644 index 4a334b03f45..00000000000 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/AbiNames.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Xamarin.Android.Prepare -{ - static class AbiNames - { - static HashSet ? allHostAbis; - - public static class TargetJit - { - public const string AndroidArmV7a = "armeabi-v7a"; - public const string AndroidArmV8a = "arm64-v8a"; - public const string AndroidArm64 = AndroidArmV8a; - public const string AndroidX86 = "x86"; - public const string AndroidX86_64 = "x86_64"; - } - - public static class TargetAot - { - public const string ArmV7a = "armeabi-v7a"; - public const string WinArmV7a = "win-armeabi-v7a"; - public const string ArmV8a = "arm64"; - public const string Arm64 = ArmV8a; - public const string WinArmV8a = "win-arm64"; - public const string WinArm64 = WinArmV8a; - public const string X86 = "x86"; - public const string WinX86 = "win-x86"; - public const string X86_64 = "x86_64"; - public const string WinX86_64 = "win-x86_64"; - } - - public static class HostJit - { - public const string Linux = "Linux"; - public const string Darwin = "Darwin"; - public const string Win32 = "mxe-Win32"; - public const string Win64 = "mxe-Win64"; - } - - public static class CrossAot - { - public static readonly string ArmV7a = "cross-arm"; - public static readonly string WinArmV7a = $"{ArmV7a}-win"; - public static readonly string ArmV8a = "cross-arm64"; - public static readonly string Arm64 = ArmV8a; - public static readonly string WinArmV8a = $"{ArmV8a}-win"; - public static readonly string WinArm64 = WinArmV8a; - public static readonly string X86 = "cross-x86"; - public static readonly string WinX86 = $"{X86}-win"; - public static readonly string X86_64 = "cross-x86_64"; - public static readonly string WinX86_64 = $"{X86_64}-win"; - } - - public static class Llvm - { - public const string Host32Bit = "llvm32"; - public const string Host64Bit = "llvm64"; - public const string Windows32Bit = "llvmwin32"; - public const string Windows64Bit = "llvmwin64"; - } - - public static HashSet AllHostAbis { - get { - if (allHostAbis == null) - allHostAbis = Abi.GetHostAbis (includeAllHostOSes: false); - return allHostAbis; - } - } - - public static readonly HashSet AllNativeHostAbis = Abi.GetHostAbis (osType: Abi.OS.NotWindows); - - public static readonly HashSet AllAotAbis = Abi.GetHostAotAbis (); - - public static readonly HashSet AllLlvmHostAbis = Abi.GetLlvmAbis (); - public static readonly HashSet AllLlvmWindowsAbis = Abi.GetLlvmAbis (osType: Abi.OS.Windows); - public static readonly HashSet All32BitLlvmAbis = Abi.GetLlvmAbis (bitness: Abi.Bitness.ThirtyTwo); - public static readonly HashSet All64BitLlvmAbis = Abi.GetLlvmAbis (bitness: Abi.Bitness.SixtyFour); - - public static readonly HashSet AllJitAbis = Abi.GetTargetJitAbis (); - public static readonly HashSet All32BitTargetJitAbis = Abi.GetTargetJitAbis (Abi.Bitness.ThirtyTwo); - public static readonly HashSet All64BitTargetJitAbis = Abi.GetTargetJitAbis (Abi.Bitness.SixtyFour); - - public static readonly HashSet AllHostAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.NotWindows); - public static readonly HashSet All32BitHostAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.NotWindows, bitness: Abi.Bitness.ThirtyTwo); - public static readonly HashSet All64BitHostAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.NotWindows, bitness: Abi.Bitness.SixtyFour); - - public static readonly HashSet AllWindowsAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.Windows); - public static readonly HashSet All32BitWindowsAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.Windows, bitness: Abi.Bitness.ThirtyTwo); - public static readonly HashSet All64BitWindowsAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.Windows, bitness: Abi.Bitness.SixtyFour); - - public static readonly HashSet AllTargetAotAbis = Abi.GetHostAotAbis (); - public static readonly HashSet All64BitTargetAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.Any, bitness: Abi.Bitness.SixtyFour); - public static readonly HashSet All32BitTargetAotAbis = Abi.GetHostAotAbis (osType: Abi.OS.Any, bitness: Abi.Bitness.ThirtyTwo); - - public static readonly HashSet AllCrossHostAotAbis = Abi.GetCrossAbis (osType: Abi.OS.NotWindows); - public static readonly HashSet AllCrossWindowsAotAbis = Abi.GetCrossAbis (osType: Abi.OS.Windows); - public static readonly HashSet All64BitCrossAotAbis = Abi.GetCrossAbis (bitness: Abi.Bitness.SixtyFour); - public static readonly HashSet All32BitCrossAotAbis = Abi.GetCrossAbis (bitness: Abi.Bitness.ThirtyTwo); - - public static readonly HashSet AllMingwHostAbis = Abi.GetHostAbis (osType: Abi.OS.Windows); - public static readonly HashSet All32BitMingwHostAbis = Abi.GetHostAbis (osType: Abi.OS.Windows, bitness: Abi.Bitness.ThirtyTwo); - public static readonly HashSet All64BitMingwHostAbis = Abi.GetHostAbis (osType: Abi.OS.Windows, bitness: Abi.Bitness.SixtyFour); - - public static void LogAllNames (Context context) - { - if (context.LoggingVerbosity < LoggingVerbosity.Verbose) - return; - - Log.Instance.DebugLine ("All defined ABI names:"); - - LogAbis (context, "AllHostAbis", AllHostAbis); - LogAbis (context, "AllNativeHostAbis", AllNativeHostAbis); - - LogAbis (context, "AllLlvmHostAbis", AllLlvmHostAbis); - LogAbis (context, "AllLlvmWindowsAbis", AllLlvmWindowsAbis); - LogAbis (context, "All32BitLlvmAbis", All32BitLlvmAbis); - LogAbis (context, "All64BitLlvmAbis", All64BitLlvmAbis); - - LogAbis (context, "AllJitAbis", AllJitAbis); - LogAbis (context, "All32BitTargetJitAbis", All32BitTargetJitAbis); - LogAbis (context, "All64BitTargetJitAbis", All64BitTargetJitAbis); - - LogAbis (context, "AllHostAotAbis", AllHostAotAbis); - LogAbis (context, "All32BitHostAotAbis", All32BitHostAotAbis); - LogAbis (context, "All64BitHostAotAbis", All64BitHostAotAbis); - - LogAbis (context, "AllWindowsAotAbis", AllWindowsAotAbis); - LogAbis (context, "All32BitWindowsAotAbis", All32BitWindowsAotAbis); - LogAbis (context, "All64BitWindowsAotAbis", All64BitWindowsAotAbis); - LogAbis (context, "All64BitTargetAotAbis", All64BitTargetAotAbis); - LogAbis (context, "All32BitTargetAotAbis", All32BitTargetAotAbis); - - LogAbis (context, "AllCrossHostAotAbis", AllCrossHostAotAbis); - LogAbis (context, "AllCrossWindowsAotAbis", AllCrossWindowsAotAbis); - LogAbis (context, "All64BitCrossAotAbis", All64BitCrossAotAbis); - LogAbis (context, "All32BitCrossAotAbis", All32BitCrossAotAbis); - - LogAbis (context, "AllMingwHostAbis", AllMingwHostAbis); - LogAbis (context, "All32BitMingwHostAbis", All32BitMingwHostAbis); - LogAbis (context, "All64BitMingwHostAbis", All64BitMingwHostAbis); - } - - static void LogAbis (Context context, string name, HashSet abis) - { - Log.Instance.DebugLine ($" {context.Characters.Bullet} {name}"); - foreach (string abi in abis) { - Log.Instance.DebugLine ($" {abi}"); - } - Log.Instance.DebugLine (); - } - - public static string AbiToRuntimeIdentifier (string androidAbi) - { - if (androidAbi == TargetJit.AndroidArmV7a) { - return "android-arm"; - } else if (androidAbi == TargetJit.AndroidArmV8a) { - return "android-arm64"; - } else if (androidAbi == TargetJit.AndroidX86) { - return "android-x86"; - } else if (androidAbi == TargetJit.AndroidX86_64) { - return "android-x64"; - } - throw new InvalidOperationException ($"Unknown abi: {androidAbi}"); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs index 24675bcba58..506a56b25e4 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs @@ -47,12 +47,5 @@ class BuildAndroidPlatforms new AndroidPlatform (apiName: "UpsideDownCake", apiLevel: 34, platformID: "34", include: "v14.0", framework: "v14.0"), }; - public static readonly Dictionary NdkMinimumAPIMap = new Dictionary { - { AbiNames.TargetJit.AndroidArmV7a, NdkMinimumAPILegacy32 }, - { AbiNames.TargetJit.AndroidArmV8a, NdkMinimumAPI }, - { AbiNames.TargetJit.AndroidX86, NdkMinimumAPILegacy32 }, - { AbiNames.TargetJit.AndroidX86_64, NdkMinimumAPI }, - }; - } } diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs index 4e7c41133a7..9e277a90aad 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs @@ -13,18 +13,13 @@ partial class Configurables partial class Defaults { - public const string MacOSDeploymentTarget = "10.11"; public const string NativeLibraryExtension = ".dylib"; } partial class Paths { - const string LibMonoSgenBaseName = "libmonosgen-2.0"; - public const string MonoCrossRuntimeInstallPath = "Darwin"; public const string NdkToolchainOSTag = "darwin-x86_64"; - public static readonly string UnstrippedLibMonoSgenName = $"{LibMonoSgenBaseName}.d{Defaults.NativeLibraryExtension}"; - public static readonly string StrippedLibMonoSgenName = $"{LibMonoSgenBaseName}{Defaults.NativeLibraryExtension}"; } } } diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Unix.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Unix.cs index 3f6fbc4ab35..4c02c008f8c 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Unix.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Unix.cs @@ -13,11 +13,6 @@ partial class Defaults public const string DefaultCompiler = "cc"; } - partial class Paths - { - static string ArchiveOSType => Context.Instance.OS.Type; - } - partial class Urls { public static readonly Uri DotNetInstallScript = new Uri ("https://dot.net/v1/dotnet-install.sh"); diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Windows.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Windows.cs index be13e5f6c3f..cf20faf3d1f 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Windows.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Windows.cs @@ -21,9 +21,6 @@ partial class Defaults partial class Paths { - static string ArchiveOSType => "Darwin"; // Windows need sources from there - public const string MonoCrossRuntimeInstallPath = "Windows"; - public static readonly string MonoRuntimeHostMingwNativeLibraryPrefix = Path.Combine ("..", "bin"); public const string NdkToolchainOSTag = "windows-x86_64"; } diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs index 9241be30233..4fe4f25c879 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs @@ -156,42 +156,10 @@ public static partial class Defaults public const string HashAlgorithm = "SHA1"; public static readonly Dictionary AndroidToolchainPrefixes = new Dictionary (StringComparer.Ordinal) { - { AbiNames.TargetJit.AndroidArmV7a, "arm-linux-androideabi" }, - { AbiNames.TargetJit.AndroidArmV8a, "aarch64-linux-android" }, - { AbiNames.TargetJit.AndroidX86, "i686-linux-android" }, - { AbiNames.TargetJit.AndroidX86_64, "x86_64-linux-android" }, - }; - - const string CrossArmV7aName = "cross-arm"; - const string CrossArmV8aName = "cross-arm64"; - const string CrossX86Name = "cross-x86"; - const string CrossX86_64Name = "cross-x86_64"; - - public static readonly Dictionary CrossRuntimeNames = new Dictionary (StringComparer.Ordinal) { - { AbiNames.CrossAot.ArmV7a, CrossArmV7aName }, - { AbiNames.CrossAot.ArmV8a, CrossArmV8aName }, - { AbiNames.CrossAot.X86, CrossX86Name }, - { AbiNames.CrossAot.X86_64, CrossX86_64Name }, - { AbiNames.CrossAot.WinArmV7a, CrossArmV7aName }, - { AbiNames.CrossAot.WinArmV8a, CrossArmV8aName }, - { AbiNames.CrossAot.WinX86, CrossX86Name }, - { AbiNames.CrossAot.WinX86_64, CrossX86_64Name }, - }; - - const string ArmV7aPrefix = "armv7-linux-android-"; - const string ArmV8aPrefix = "aarch64-v8a-linux-android-"; - const string X86Prefix = "i686-linux-android-"; - const string X86_64Prefix = "x86_64-linux-android-"; - - public static readonly Dictionary CrossRuntimeExePrefixes = new Dictionary (StringComparer.Ordinal) { - { AbiNames.CrossAot.ArmV7a, ArmV7aPrefix}, - { AbiNames.CrossAot.ArmV8a, ArmV8aPrefix }, - { AbiNames.CrossAot.X86, X86Prefix }, - { AbiNames.CrossAot.X86_64, X86_64Prefix }, - { AbiNames.CrossAot.WinArmV7a, ArmV7aPrefix }, - { AbiNames.CrossAot.WinArmV8a, ArmV8aPrefix }, - { AbiNames.CrossAot.WinX86, X86Prefix }, - { AbiNames.CrossAot.WinX86_64, X86_64Prefix }, + { "armeabi-v7a", "arm-linux-androideabi" }, + { "arm64-v8a", "aarch64-linux-android" }, + { "x86", "i686-linux-android" }, + { "x86_64", "x86_64-linux-android" }, }; /// @@ -238,58 +206,16 @@ public static partial class Paths public static readonly string ExternalGitDepsFilePath = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, ".external"); public static readonly string ExternalGitDepsDestDir = ExternalDir; public static readonly string ExternalXamarinAndroidToolsSln = Path.Combine (ExternalDir, "xamarin-android-tools", "Xamarin.Android.Tools.sln"); - public static readonly string MxeSourceDir = Path.Combine (ExternalDir, "mxe"); - public static readonly string MonoSDKSRelativeOutputDir = Path.Combine ("sdks", "out"); - public static readonly string MonoSDKRelativeIncludeSourceDir = Path.Combine ("include", "mono-2.0", "mono"); - public static readonly string RuntimeInstallRelativeLibDir = "lib"; - public static readonly string PackageImageDependenciesTemplate = Path.Combine (BuildToolsScriptsDir, "prepare-image-dependencies.sh.in"); - public static readonly string PackageImageDependenciesOutput = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "prepare-image-dependencies.sh"); // Dynamic locations used throughout the code public static string ExternalJavaInteropDir => GetCachedPath (ref externalJavaInteropDir, () => ctx.Properties.GetRequiredValue (KnownProperties.JavaInteropFullPath)); - public static string MonoSDKSOutputDir => GetCachedPath (ref monoSDKsOutputDir, () => Path.Combine (MonoSourceFullPath, MonoSDKSRelativeOutputDir)); - public static string MonoProfileDir => GetCachedPath (ref monoProfileDir, () => Path.Combine (MonoSDKSOutputDir, "android-bcl", "monodroid")); - public static string MonoProfileToolsDir => GetCachedPath (ref monoProfileToolsDir, () => Path.Combine (MonoSDKSOutputDir, "android-bcl", "monodroid_tools")); - public static string MonoSDKIncludeDestinationDir => GetCachedPath (ref monoSDKSIncludeDestDir, () => Path.Combine (OutputIncludeDir, "mono-2.0", "mono")); - - public static string BCLFacadeAssembliesSourceDir => GetCachedPath (ref bclFacadeAssembliesSourceDir, () => Path.Combine (BCLAssembliesSourceDir, "Facades")); - public static string BCLHostAssembliesSourceDir => BCLAssembliesSourceDir; - public static string BCLHostFacadeAssembliesSourceDir => BCLFacadeAssembliesSourceDir; - - public static string BCLWindowsOutputDir => GetCachedPath (ref bclWindowsOutputDir, () => Path.Combine (BuildBinDir, "windows-bcl")); - public static string BCLWindowsAssembliesSourceDir => GetCachedPath (ref bclWindowsAssembliesSourceDir, () => Path.Combine (BCLWindowsOutputDir, "android-bcl", "monodroid")); - public static string BCLWindowsFacadeAssembliesSourceDir => GetCachedPath (ref bclWindowsFacadeAssembliesSourceDir, () => Path.Combine (BCLWindowsAssembliesSourceDir, "Facades")); - - public static string BCLAssembliesSourceDir => MonoProfileDir; - - public static string BCLTestsSourceDir => GetCachedPath (ref bclTestsSourceDir, () => Path.Combine (MonoProfileDir, "tests")); - - public static string BCLTestsDestDir => GetCachedPath (ref bclTestsDestDir, () => Path.Combine (XAInstallPrefix, "..", "..", "bcl-tests")); - public static string BCLTestsArchivePath => GetCachedPath (ref bclTestsArchivePath, () => Path.Combine (BCLTestsDestDir, BCLTestsArchiveName)); - public static string TestBinDir => GetCachedPath (ref testBinDir, () => Path.Combine (Configurables.Paths.BinDirRoot, $"Test{ctx.Configuration}")); public static string BinDir => GetCachedPath (ref binDir, () => Path.Combine (Configurables.Paths.BinDirRoot, ctx.Configuration)); public static string BuildBinDir => GetCachedPath (ref buildBinDir, () => Path.Combine (Configurables.Paths.BinDirRoot, $"Build{ctx.Configuration}")); - public static string ProfileAssembliesProjitemsPath => GetCachedPath (ref profileAssembliesProjitemsPath, () => Path.Combine (BuildBinDir, "ProfileAssemblies.projitems")); public static string ConfigurationPropsGeneratedPath => GetCachedPath (ref configurationPropsGeneratedPath, () => Path.Combine (BuildBinDir, "Configuration.Generated.props")); - - // Mono Runtimes public static string MonoAndroidFrameworksSubDir = Path.Combine ("xbuild-frameworks", "MonoAndroid"); public static string MonoAndroidFrameworksRootDir => GetCachedPath (ref monoAndroidFrameworksRootDir, () => Path.Combine (XAInstallPrefix, MonoAndroidFrameworksSubDir)); - public static string InstallBCLFrameworkDir => GetCachedPath (ref installBCLFrameworkDir, () => Path.Combine (MonoAndroidFrameworksRootDir, "v1.0")); - public static string InstallBCLFrameworkFacadesDir => GetCachedPath (ref installBCLFrameworkFacadesDir, () => Path.Combine (InstallBCLFrameworkDir, "Facades")); - public static string InstallBCLFrameworkRedistListDir => GetCachedPath (ref installBCLFrameworkRedistListDir, () => Path.Combine (InstallBCLFrameworkDir, "RedistList")); - - public static string InstallBCLDesignerDir => GetCachedPath (ref installBCLDesignerDir, () => Path.Combine (XAInstallPrefix, "xbuild", "Xamarin", "Android")); - public static string InstallHostBCLDir => GetCachedPath (ref installHostBCLDir, () => Path.Combine (InstallBCLDesignerDir, ctx.OS.Type, "bcl")); - public static string InstallHostBCLFacadesDir => GetCachedPath (ref installHostBCLFacadesDir, () => Path.Combine (InstallBCLDesignerDir, ctx.OS.Type, "bcl", "Facades")); - public static string InstallWindowsBCLDir => GetCachedPath (ref installWindowsBCLDir, () => Path.Combine (InstallBCLDesignerDir, "bcl")); - public static string InstallWindowsBCLFacadesDir => GetCachedPath (ref installWindowsBCLFacadesDir, () => Path.Combine (InstallBCLDesignerDir, "bcl", "Facades")); - public static string InstallMSBuildDir => GetCachedPath (ref installMSBuildDir, () => ctx.Properties.GetRequiredValue (KnownProperties.MicrosoftAndroidSdkOutDir)); - public static string OutputIncludeDir => GetCachedPath (ref outputIncludeDir, () => Path.Combine (BinDirRoot, ctx.Configuration, "include")); - public static string MonoRuntimesEnabledAbisCachePath => GetCachedPath (ref monoRuntimesEnabledAbisCachePath, () => Path.Combine (BuildBinDir, "mono-runtimes-abi.cache")); - public static string FrameworkListInstallPath => GetCachedPath (ref frameworkListInstallPath, () => Path.Combine (InstallBCLFrameworkRedistListDir, "FrameworkList.xml")); // AdoptOpenJDK public static string OldOpenJDKInstallDir => GetCachedPath (ref oldOpenJDKInstallDir, () => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainDirectory), "jdk")); @@ -298,17 +224,6 @@ public static partial class Paths public static string OpenJDK17InstallDir => GetCachedPath (ref openJDK17InstallDir, () => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainDirectory), "jdk-17")); public static string OpenJDK17CacheDir => GetCachedPath (ref openJDK17CacheDir, () => ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainCacheDirectory)); - // bundle - public static string BCLTestsArchiveName = "bcl-tests.zip"; - - // Mono Archive - public static string MonoArchiveMonoHash => ctx.BuildInfo.FullMonoHash; - public static string MonoArchiveBaseFileName => $"android-{Defaults.MonoSdksConfiguration}-{ArchiveOSType}-{MonoArchiveMonoHash}"; - public static string MonoArchiveWindowsBaseFileName => $"android-release-Windows-{MonoArchiveMonoHash}"; - public static string MonoArchiveFileName => $"{MonoArchiveBaseFileName}.7z"; - public static string MonoArchiveWindowsFileName => $"{MonoArchiveWindowsBaseFileName}.7z"; - public static string MonoArchiveLocalPath => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainCacheDirectory), MonoArchiveFileName); - public static string MonoArchiveWindowsLocalPath => Path.Combine (ctx.Properties.GetRequiredValue (KnownProperties.AndroidToolchainCacheDirectory), MonoArchiveWindowsFileName); // .NET 6 public static string NetcoreAppRuntimeAndroidARM => GetCachedPath (ref netcoreAppRuntimeAndroidARM, () => GetNetcoreAppRuntimePath (ctx, "arm")); @@ -349,13 +264,6 @@ public static partial class Paths // not really configurables, merely convenience aliases for more frequently used paths that come from properties public static string XAInstallPrefix => ctx.Properties.GetRequiredValue (KnownProperties.XAInstallPrefix); public static string XAPackagesDir = DetermineNugetPackagesDir (ctx); - public static string MonoSourceFullPath => ctx.Properties.GetRequiredValue (KnownProperties.MonoSourceFullPath); - public static string MonoSdksTpnPath => GetCachedPath (ref monoSdksTpnPath, () => Path.Combine (MonoSDKSOutputDir, "android-tpn")); - public static string MonoSdksTpnExternalPath => GetCachedPath (ref monoSdksTpnExternalPath, () => Path.Combine (MonoSdksTpnPath, "external")); - public static string MonoLlvmTpnPath => GetCachedPath (ref monoLlvmTpnPath, () => { - var path = Path.Combine (MonoSdksTpnExternalPath, "llvm-project", "llvm"); - return Directory.Exists (path) ? path : Path.Combine (MonoSdksTpnExternalPath, "llvm"); - }); static string GetNetcoreAppRuntimePath (Context ctx, string androidTarget) { @@ -400,38 +308,12 @@ static string GetCachedPath (ref string? variable, Func creator) static string? testBinDir; static string? buildBinDir; static string? binDir; - static string? monoSDKsOutputDir; static string? androidToolchainRootDirectory; static string? androidToolchainBinDirectory; static string? androidToolchainSysrootLibDirectory; - static string? monoProfileDir; - static string? monoProfileToolsDir; - static string? bclTestsDestDir; - static string? bclTestsArchivePath; - static string? bclFacadeAssembliesSourceDir; - static string? bclWindowsOutputDir; - static string? bclWindowsAssembliesSourceDir; - static string? bclWindowsFacadeAssembliesSourceDir; - static string? installBCLFrameworkDir; - static string? installBCLFrameworkFacadesDir; - static string? installBCLFrameworkRedistListDir; static string? installMSBuildDir; - static string? outputIncludeDir; - static string? monoRuntimesEnabledAbisCachePath; - static string? frameworkListInstallPath; - static string? profileAssembliesProjitemsPath; - static string? bclTestsSourceDir; - static string? installHostBCLDir; - static string? installHostBCLFacadesDir; - static string? installWindowsBCLDir; - static string? installWindowsBCLFacadesDir; - static string? installBCLDesignerDir; static string? monoAndroidFrameworksRootDir; static string? externalJavaInteropDir; - static string? monoSdksTpnPath; - static string? monoSdksTpnExternalPath; - static string? monoSDKSIncludeDestDir; - static string? monoLlvmTpnPath; static string? openJDK8InstallDir, openJDK17InstallDir; static string? openJDK8CacheDir, openJDK17CacheDir; static string? oldOpenJDKInstallDir; diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Code.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Code.cs deleted file mode 100644 index ec172a1ad97..00000000000 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Code.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Xamarin.Android.Prepare -{ - partial class Runtimes - { - static Context ctx => Context.Instance; - - static string GetMonoUtilitySourcePath (string utilityName) - { - return Path.Combine (Configurables.Paths.MonoProfileToolsDir, utilityName); - } - - static string GetLlvmOutputSourcePath (Runtime runtime) - { - var llvmRuntime = EnsureRuntimeType (runtime, "LLVM"); - return Path.Combine (GetLlvmInputDir (runtime), "bin"); - } - - static string GetLlvmOutputDestinationPath (Runtime runtime) - { - var llvmRuntime = EnsureRuntimeType (runtime, "LLVM"); - return llvmRuntime.InstallPath; - } - - static string GetMonoPosixHelperOutputSourcePath (Runtime runtime) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputMonoPosixHelperFilename}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetMonoPosixHelperOutputDestinationPath (Runtime runtime, bool debug) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputMonoPosixHelperFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetMonoBtlsOutputSourcePath (Runtime runtime) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputMonoBtlsFilename}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetMonoBtlsOutputDestinationPath (Runtime runtime, bool debug) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputMonoBtlsFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetAotProfilerOutputSourcePath (Runtime runtime) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputAotProfilerFilename}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetAotProfilerOutputDestinationPath (Runtime runtime, bool debug) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputAotProfilerFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetProfilerOutputSourcePath (Runtime runtime) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputProfilerFilename}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetProfilerOutputDestinationPath (Runtime runtime, bool debug) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputProfilerFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetRuntimeOutputSourcePath (Runtime runtime) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"{monoRuntime.OutputRuntimeFilename}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetRuntimeOutputDestinationPath (Runtime runtime, bool debug) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetRuntimeOutputDir (runtime), $"{monoRuntime.OutputRuntimeFilename}{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetMonoNativeOutputSourcePath (Runtime runtime) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - if (IsAbi (runtime, AbiNames.HostJit.Darwin)) - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"libmono-native-compat{monoRuntime.NativeLibraryExtension}"); - - return Path.Combine (GetAndroidInputLibDir (runtime), monoRuntime.NativeLibraryDirPrefix, $"libmono-native{monoRuntime.NativeLibraryExtension}"); - } - - static string GetMonoNativeOutputDestinationPath (Runtime runtime, bool debug) - { - var monoRuntime = EnsureRuntimeType (runtime, "Mono"); - return Path.Combine (GetRuntimeOutputDir (runtime), $"libmono-native{GetDebugInfix (debug)}{monoRuntime.NativeLibraryExtension}"); - } - - static string GetDebugInfix (bool debug) - { - return debug ? Configurables.Defaults.DebugBinaryInfix : String.Empty; - } - - static bool IsHostOrTargetRuntime (Runtime runtime) - { - return IsRuntimeType (runtime); - } - - static T EnsureRuntimeType (Runtime runtime, string typeName) where T: Runtime - { - var ret = runtime.As (); - if (ret == null) - throw new InvalidOperationException ($"Runtime {runtime.Name} is not a {typeName} runtime"); - - return ret; - } - - static bool IsRuntimeType (Runtime runtime) where T: Runtime - { - return runtime.As() != null; - } - - static bool IsWindowsRuntime (Runtime runtime) - { - return String.Compare (runtime.ExeSuffix, Configurables.Defaults.WindowsExecutableSuffix, StringComparison.Ordinal) == 0; - } - - static bool IsAbi (Runtime runtime, string abiName, params string[] furtherAbiNames) - { - if (ExpectedAbi (abiName)) - return true; - - if (furtherAbiNames == null) - return false; - - foreach (string a in furtherAbiNames) { - if (ExpectedAbi (a)) - return true; - } - - return false; - - bool ExpectedAbi (string abi) - { - if (String.IsNullOrEmpty (abi)) - return false; - - return String.Compare (abi, runtime.Name ?? String.Empty, StringComparison.Ordinal) == 0; - } - } - - static string GetLlvmInputDir (Runtime runtime) - { - return GetLlvmInputRootDir (runtime); - } - - static string GetLlvmInputRootDir (Runtime runtime) - { - return Path.Combine (Configurables.Paths.MonoSDKSRelativeOutputDir, $"llvm-{runtime.PrefixedName}"); - } - - static string GetAndroidInputLibDir (Runtime runtime) - { - return Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), "lib"); - } - - static string GetRuntimeOutputDir (Runtime runtime) - { - return Path.Combine (Configurables.Paths.RuntimeInstallRelativeLibDir, runtime.PrefixedName); - } - - static bool IsLlvmRuntimeEnabled (Context ctx, string llvmAbi) - { - bool enabled = false; - bool windows = ctx.IsLlvmWindowsAbi (llvmAbi); - bool is64Bit = ctx.Is64BitLlvmAbi (llvmAbi); - - HashSet targets; - if (windows) - targets = is64Bit ? AbiNames.All64BitWindowsAotAbis : AbiNames.All32BitWindowsAotAbis; - else - targets = is64Bit ? AbiNames.All64BitHostAotAbis : AbiNames.All32BitHostAotAbis; - - foreach (string target in targets) { - if (Context.Instance.IsTargetAotAbiEnabled (target)) { - enabled = true; - break; - } - } - - return enabled && (!is64Bit || Context.Instance.OS.Is64Bit); - } - - public Runtimes () - { - Context c = ctx; - foreach (Runtime runtime in Items) { - runtime.Init (c); - } - - DesignerHostBclFilesToInstall = new List (); - DesignerWindowsBclFilesToInstall = new List (); - - PopulateDesignerBclFiles (DesignerHostBclFilesToInstall, DesignerWindowsBclFilesToInstall); - } - - List BclToDesigner (BclFileTarget ignoreForTarget) - { - return BclFilesToInstall.Where (bf => ShouldIncludeDesignerBcl (bf)).Select (bf => new BclFile (bf.Name, bf.Type, bf.ExcludeDebugSymbols, version: bf.Version, target: ignoreForTarget)).ToList (); - - bool ShouldIncludeDesignerBcl (BclFile bf) - { - if (DesignerIgnoreFiles == null || !DesignerIgnoreFiles.TryGetValue (bf.Name, out (BclFileType Type, BclFileTarget Target) bft)) { - return true; - } - - if (bf.Type != bft.Type || bft.Target != ignoreForTarget) - return true; - - Log.Instance.DebugLine ($"BCL file {bf.Name} will NOT be included in the installed Designer BCL files ({ignoreForTarget})"); - return false; - } - } - - partial void PopulateDesignerBclFiles (List designerHostBclFilesToInstall, List designerWindowsBclFilesToInstall); - } -} diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Unix.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Unix.cs deleted file mode 100644 index 5bce3b9d360..00000000000 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Unix.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Xamarin.Android.Prepare -{ - partial class Runtimes - { - partial void PopulateDesignerBclFiles (List designerHostBclFilesToInstall, List designerWindowsBclFilesToInstall) - { - designerHostBclFilesToInstall.AddRange (BclToDesigner (BclFileTarget.DesignerHost)); - designerWindowsBclFilesToInstall.AddRange (BclToDesigner (BclFileTarget.DesignerWindows)); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Windows.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Windows.cs deleted file mode 100644 index 3740c880551..00000000000 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.Windows.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Xamarin.Android.Prepare -{ - partial class Runtimes - { - partial void PopulateDesignerBclFiles (List designerHostBclFilesToInstall, List designerWindowsBclFilesToInstall) - { - designerWindowsBclFilesToInstall.AddRange (BclToDesigner (BclFileTarget.DesignerWindows)); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs deleted file mode 100644 index 6cc04f97fe8..00000000000 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Runtimes.cs +++ /dev/null @@ -1,811 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Xamarin.Android.Prepare -{ - partial class Runtimes - { - public readonly List Items = new List { - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidArmV7a, - interpreter: false, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidArmV7a) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidArmV7a, - interpreter: true, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidArmV7a) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidArmV8a, - interpreter: false, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidArmV8a) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidArmV8a, - interpreter: true, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidArmV8a) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidX86, - interpreter: false, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidX86) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidX86, - interpreter: true, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidX86) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidX86_64, - interpreter: false, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidX86_64) - ), - - new MonoJitRuntime ( - abiName: AbiNames.TargetJit.AndroidX86_64, - interpreter: true, - enabledCheck: (Context ctx) => ctx.IsTargetJitAbiEnabled (AbiNames.TargetJit.AndroidX86_64) - ), - - new LlvmRuntime ( - name: AbiNames.Llvm.Host64Bit, - enabledCheck: (Context ctx) => IsLlvmRuntimeEnabled (ctx, AbiNames.Llvm.Host64Bit) - ), - - new LlvmRuntime ( - name: AbiNames.Llvm.Windows64Bit, - enabledCheck: (Context) => IsLlvmRuntimeEnabled (ctx, AbiNames.Llvm.Windows64Bit) - ), - }; - - public readonly List BclFilesToInstall = new List { - new BclFile ("I18N.dll", BclFileType.ProfileAssembly), - new BclFile ("I18N.CJK.dll", BclFileType.ProfileAssembly), - new BclFile ("I18N.MidEast.dll", BclFileType.ProfileAssembly), - new BclFile ("I18N.Other.dll", BclFileType.ProfileAssembly), - new BclFile ("I18N.Rare.dll", BclFileType.ProfileAssembly), - new BclFile ("I18N.West.dll", BclFileType.ProfileAssembly), - new BclFile ("Microsoft.CSharp.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.Btls.Interface.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.CompilerServices.SymbolWriter.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.CSharp.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.Data.Sqlite.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.Data.Tds.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.Posix.dll", BclFileType.ProfileAssembly), - new BclFile ("Mono.Security.dll", BclFileType.ProfileAssembly), - new BclFile ("mscorlib.dll", BclFileType.ProfileAssembly), - new BclFile ("System.dll", BclFileType.ProfileAssembly), - new BclFile ("System.ComponentModel.Composition.dll", BclFileType.ProfileAssembly), - new BclFile ("System.ComponentModel.DataAnnotations.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Core.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Data.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Data.DataSetExtensions.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Data.Services.Client.dll", BclFileType.ProfileAssembly), - new BclFile ("System.IdentityModel.dll", BclFileType.ProfileAssembly), - new BclFile ("System.IO.Compression.dll", BclFileType.ProfileAssembly), - new BclFile ("System.IO.Compression.FileSystem.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Json.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Net.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Net.Http.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Net.Http.WinHttpHandler.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Numerics.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Numerics.Vectors.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Reflection.Context.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Runtime.CompilerServices.Unsafe.dll", BclFileType.ProfileAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Serialization.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Security.dll", BclFileType.ProfileAssembly), - new BclFile ("System.ServiceModel.dll", BclFileType.ProfileAssembly), - new BclFile ("System.ServiceModel.Internals.dll", BclFileType.ProfileAssembly), - new BclFile ("System.ServiceModel.Web.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Transactions.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Web.Services.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Windows.dll", BclFileType.ProfileAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Xml.Linq.dll", BclFileType.ProfileAssembly), - new BclFile ("System.Xml.Serialization.dll", BclFileType.ProfileAssembly, excludeDebugSymbols: true), - - new BclFile ("Microsoft.Win32.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("Microsoft.Win32.Registry.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("Microsoft.Win32.Registry.AccessControl.dll", BclFileType.FacadeAssembly), - new BclFile ("netstandard.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.AppContext.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Buffers.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Collections.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Collections.Concurrent.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Collections.NonGeneric.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Collections.Specialized.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ComponentModel.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ComponentModel.Annotations.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ComponentModel.EventBasedAsync.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ComponentModel.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ComponentModel.TypeConverter.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Console.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Data.Common.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Data.SqlClient.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.Contracts.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.Debug.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.FileVersionInfo.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.Process.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.StackTrace.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.TextWriterTraceListener.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.Tools.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.TraceEvent.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.TraceSource.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Diagnostics.Tracing.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Drawing.Common.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Drawing.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Dynamic.Runtime.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Globalization.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Globalization.Calendars.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Globalization.Extensions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.Compression.ZipFile.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.FileSystem.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.FileSystem.AccessControl.dll", BclFileType.FacadeAssembly), - new BclFile ("System.IO.FileSystem.DriveInfo.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.FileSystem.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.FileSystem.Watcher.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.IsolatedStorage.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.MemoryMappedFiles.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.Pipes.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.IO.UnmanagedMemoryStream.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Linq.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Linq.Expressions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Linq.Parallel.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Linq.Queryable.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Memory.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.AuthenticationManager.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Cache.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.HttpListener.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Mail.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.NameResolution.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.NetworkInformation.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Ping.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Requests.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Security.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.ServicePoint.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Sockets.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.Utilities.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.WebHeaderCollection.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.WebSockets.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Net.WebSockets.Client.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ObjectModel.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.DispatchProxy.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Reflection.Emit.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.Emit.ILGeneration.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.Emit.Lightweight.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.Extensions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Reflection.TypeExtensions.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Resources.Reader.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Resources.ReaderWriter.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Resources.ResourceManager.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Resources.Writer.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.CompilerServices.VisualC.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Extensions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Handles.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.InteropServices.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.InteropServices.RuntimeInformation.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.InteropServices.WindowsRuntime.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Loader.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Runtime.Numerics.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Serialization.Formatters.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Serialization.Json.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Serialization.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Runtime.Serialization.Xml.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.AccessControl.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Claims.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Algorithms.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Cng.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Csp.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.DeriveBytes.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Encoding.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Encryption.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Encryption.Aes.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Encryption.ECDiffieHellman.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Encryption.ECDsa.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Hashing.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Hashing.Algorithms.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.OpenSsl.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Security.Cryptography.Pkcs.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.ProtectedData.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.RandomNumberGenerator.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.RSA.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Cryptography.X509Certificates.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Principal.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.Principal.Windows.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Security.SecureString.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ServiceModel.Duplex.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ServiceModel.Http.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ServiceModel.NetTcp.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ServiceModel.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ServiceModel.Security.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ServiceProcess.ServiceController.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Text.Encoding.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Text.Encoding.CodePages.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Text.Encoding.Extensions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Text.RegularExpressions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.AccessControl.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Threading.Overlapped.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.Tasks.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.Tasks.Extensions.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.Tasks.Parallel.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.Thread.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.ThreadPool.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Threading.Timer.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.ValueTuple.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.ReaderWriter.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.XDocument.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.XmlDocument.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.XmlSerializer.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.XPath.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.XPath.XDocument.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - new BclFile ("System.Xml.XPath.XmlDocument.dll", BclFileType.FacadeAssembly), - new BclFile ("System.Xml.Xsl.Primitives.dll", BclFileType.FacadeAssembly, excludeDebugSymbols: true), - }; - - // These two are populated from BclFilesToInstall in the constructor - public readonly List DesignerHostBclFilesToInstall; - public readonly List DesignerWindowsBclFilesToInstall; - - public readonly List TestAssemblies = new List { - new TestAssembly ("BinarySerializationOverVersionsTest.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_corlib_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_corlib_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_I18N.CJK_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_I18N.MidEast_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_I18N.Other_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_I18N.Rare_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_I18N.West_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_Microsoft.CSharp_xunit-test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_Mono.CSharp_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_Mono.Data.Sqlite_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_Mono.Data.Tds_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_Mono.Posix_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_Mono.Security_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.ComponentModel.Composition_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.ComponentModel.DataAnnotations_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Core_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Core_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Data_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Data_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.IO.Compression.FileSystem_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.IO.Compression_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Json_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Json_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Net.Http_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Net.Http.FunctionalTests_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Net.Http.UnitTests_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Numerics_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Numerics_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Runtime.CompilerServices.Unsafe_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Runtime.Serialization_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Runtime.Serialization_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Security_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Security_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.ServiceModel.Web_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.ServiceModel_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Transactions_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Web.Services_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Xml.Linq_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Xml.Linq_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System.Xml_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System.Xml_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("monodroid_System_test.dll", TestAssemblyType.NUnit), - new TestAssembly ("monodroid_System_xunit-test.dll", TestAssemblyType.XUnit), - new TestAssembly ("System.Reflection.TestModule.dll", TestAssemblyType.NUnit, excludeDebugSymbols: true), - new TestAssembly ("TestLoadAssembly.dll", TestAssemblyType.NUnit), - - // Mono.CSharp testsuite dynamically loads Microsoft.CSharp - new TestAssembly ("Microsoft.CSharp.dll", TestAssemblyType.Reference), - - // This is referenced by monodroid_corlib_xunit-test.dll - new TestAssembly ("System.Runtime.CompilerServices.Unsafe.dll", TestAssemblyType.Reference, excludeDebugSymbols: true), - new TestAssembly ("Xunit.NetCore.Extensions.dll", TestAssemblyType.Satellite), - - // Satellite assemblies - new TestAssembly (Path.Combine ("es-ES", "monodroid_corlib_test.resources.dll"), TestAssemblyType.Satellite), - new TestAssembly (Path.Combine ("nn-NO", "monodroid_corlib_test.resources.dll"), TestAssemblyType.Satellite), - - // Other - new TestAssembly ("nunitlite.dll", TestAssemblyType.TestRunner), - }; - - public static readonly Dictionary FrameworkListVersionOverrides = new Dictionary (StringComparer.Ordinal) { - { "System.Buffers", "4.0.99.0" }, - { "System.Memory", "4.0.99.0" } - }; - - public static readonly string FrameworkListRedist = "MonoAndroid"; - public static readonly string FrameworkListName = "Xamarin.Android Base Class Libraries"; - - public readonly List UtilityFilesToInstall = new List { - new MonoUtilityFile ("mono-cil-strip.exe", targetName: "cil-strip.exe"), - new MonoUtilityFile ("illinkanalyzer.exe", remap: true), - new MonoUtilityFile ("mdoc.exe", remap: true), - new MonoUtilityFile ("mono-symbolicate.exe", remap: true), - new MonoUtilityFile ("mkbundle.exe", remap: true), - new MonoUtilityFile ("monodoc.dll"), - new MonoUtilityFile ("monodoc.dll.config", ignoreDebugInfo: true), - new MonoUtilityFile ("mono-api-html.exe", remap: true), - new MonoUtilityFile ("mono-api-info.exe", remap: true), - new MonoUtilityFile ("ICSharpCode.SharpZipLib.dll", remap: false), - new MonoUtilityFile ("Mono.CompilerServices.SymbolWriter.dll", remap: false), - new MonoUtilityFile ("aprofutil.exe", remap: false), - new MonoUtilityFile ("Mono.Profiler.Log.dll", remap: false), - }; - - /// - /// These are source:destination relative paths for source files we are to install. Sources are relative to - /// the mono submodule directory or absolute, while destinations are relative to or absolute. Note that the destination must include the - /// file name. - /// - public readonly List RuntimeFilesToInstall = new List { - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), "share", "mono-2.0", "mono", "eglib", "eglib-config.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.OutputIncludeDir, runtime.PrefixedName, "eglib", "eglib-config.h"), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "cil", "opcode.def"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "cil", "opcode.def"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "jit", "jit.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "jit", "jit.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "appdomain.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "appdomain.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "assembly.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "assembly.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "attrdefs.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "attrdefs.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "blob.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "blob.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "class.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "class.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "debug-helpers.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "debug-helpers.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "debug-mono-symfile.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "debug-mono-symfile.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "environment.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "environment.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "exception.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "exception.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "image.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "image.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "loader.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "loader.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "metadata.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "metadata.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "mono-config.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "mono-config.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "mono-debug.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "mono-debug.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "mono-gc.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "mono-gc.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "object-forward.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "object-forward.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "object.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "object.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "opcodes.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "opcodes.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "profiler-events.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "profiler-events.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "profiler.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "profiler.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "reflection.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "reflection.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "row-indexes.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "row-indexes.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "sgen-bridge.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "sgen-bridge.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "threads.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "threads.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "tokentype.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "tokentype.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "metadata", "verify.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "metadata", "verify.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-counters.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-counters.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-dl-fallback.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-dl-fallback.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-error.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-error.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-forward.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-forward.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-jemalloc.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-jemalloc.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-logger.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-logger.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), Configurables.Paths.MonoSDKRelativeIncludeSourceDir, "utils", "mono-publib.h"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoSDKIncludeDestinationDir, "utils", "mono-publib.h"), - strip: false, - shared: true, - type: RuntimeFileType.SdkHeader - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.MonoProfileDir, "Consts.cs"), - destinationCreator: (Runtime runtime) => Path.Combine (Configurables.Paths.OutputIncludeDir, "Consts.cs"), - strip: false, - shared: true - ), - - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (MonoRuntimesHelpers.GetRootDir (runtime), "lib", "libmonosgen-2.0.dll.a"), - destinationCreator: (Runtime runtime) => Path.Combine (GetRuntimeOutputDir (runtime), "libmonosgen-2.0.dll.a"), - shouldSkip: (Runtime runtime) => !IsAbi (runtime, AbiNames.HostJit.Win32, AbiNames.HostJit.Win64), - strip: false - ), - - // Stripped runtime - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetRuntimeOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetRuntimeOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime), - type: RuntimeFileType.StrippableBinary - ), - - // Unstripped runtime - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetRuntimeOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetRuntimeOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // Stripped libmono-native for Mac, copied from libmono-native-compat - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoNativeOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoNativeOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || !IsAbi (runtime, AbiNames.HostJit.Darwin), - type: RuntimeFileType.StrippableBinary - ), - - // Unstripped libmono-native for Mac, copied from libmono-native-compat - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoNativeOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoNativeOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || !IsAbi (runtime, AbiNames.HostJit.Darwin), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // Stripped libmono-native for everything except: Mac, Win32, Win64, cross runtimes - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoNativeOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoNativeOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || IsAbi (runtime, AbiNames.HostJit.Darwin, AbiNames.HostJit.Win32, AbiNames.HostJit.Win64), - type: RuntimeFileType.StrippableBinary - ), - - // Untripped libmono-native for everything except: Mac, Win32, Win64, cross runtimes - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoNativeOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoNativeOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || IsAbi (runtime, AbiNames.HostJit.Darwin, AbiNames.HostJit.Win32, AbiNames.HostJit.Win64), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // Stripped profiler - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetProfilerOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetProfilerOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputProfilerFilename), - type: RuntimeFileType.StrippableBinary - ), - - // Unstripped profiler - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetProfilerOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetProfilerOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputProfilerFilename), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // Stripped AOT profiler - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetAotProfilerOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetAotProfilerOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputAotProfilerFilename), - type: RuntimeFileType.StrippableBinary - ), - - // Unstripped AOT profiler - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetAotProfilerOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetAotProfilerOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputAotProfilerFilename), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // Stripped BTLS - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoBtlsOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoBtlsOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputMonoBtlsFilename), - type: RuntimeFileType.StrippableBinary - ), - - // Unstripped BTLS - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoBtlsOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoBtlsOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputMonoBtlsFilename), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // Stripped MonoPosixHelper - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoPosixHelperOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoPosixHelperOutputDestinationPath (runtime, debug: false), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputMonoPosixHelperFilename), - type: RuntimeFileType.StrippableBinary - ), - - // Unstripped MonoPosixHelper - new RuntimeFile ( - sourceCreator: (Runtime runtime) => GetMonoPosixHelperOutputSourcePath (runtime), - destinationCreator: (Runtime runtime) => GetMonoPosixHelperOutputDestinationPath (runtime, debug: true), - shouldSkip: (Runtime runtime) => !IsHostOrTargetRuntime (runtime) || String.IsNullOrEmpty (runtime.As()?.OutputMonoPosixHelperFilename), - type: RuntimeFileType.StrippableBinary, - strip: false - ), - - // LLVM opt - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (GetLlvmOutputSourcePath(runtime), $"opt{runtime.As()?.ExeSuffix}"), - destinationCreator: (Runtime runtime) => Path.Combine (GetLlvmOutputDestinationPath (runtime), $"opt{runtime.As()?.ExeSuffix}"), - shouldSkip: (Runtime runtime) => !IsRuntimeType (runtime) || !runtime.As()!.InstallBinaries || (Context.IsWindows && !IsWindowsRuntime (runtime)), - type: RuntimeFileType.StrippableBinary - ), - - // LLVM llc - new RuntimeFile ( - sourceCreator: (Runtime runtime) => Path.Combine (GetLlvmOutputSourcePath(runtime), $"llc{runtime.As()?.ExeSuffix}"), - destinationCreator: (Runtime runtime) => Path.Combine (GetLlvmOutputDestinationPath (runtime), $"llc{runtime.As()?.ExeSuffix}"), - shouldSkip: (Runtime runtime) => !IsRuntimeType (runtime) || !runtime.As()!.InstallBinaries || (Context.IsWindows && !IsWindowsRuntime (runtime)), - type: RuntimeFileType.StrippableBinary - ) - }; - - // If some assemblies don't exist in the Designer BCL set, list them here - static readonly Dictionary DesignerIgnoreFiles = new Dictionary { - { "Mono.Btls.Interface.dll", (Type: BclFileType.ProfileAssembly, Target: BclFileTarget.DesignerWindows) }, - }; - - /// - /// List of directories we'll be installing to. All the directories will be removed recursively before - /// installation starts. This is to ensure that no artifacts from previous builds remain. - /// - public readonly List OutputDirectories = new List { - Configurables.Paths.BCLTestsDestDir, - Configurables.Paths.InstallMSBuildDir, - Configurables.Paths.InstallBCLFrameworkDir, - Configurables.Paths.OutputIncludeDir, - }; - } -} diff --git a/build-tools/xaprepare/xaprepare/Main.cs b/build-tools/xaprepare/xaprepare/Main.cs index cc5452cbcb7..70f867d52b7 100644 --- a/build-tools/xaprepare/xaprepare/Main.cs +++ b/build-tools/xaprepare/xaprepare/Main.cs @@ -16,7 +16,6 @@ sealed class ParsedOptions public bool ShowHelp { get; set; } = false; public bool DumpProps { get; set; } = false; public bool NoEmoji { get; set; } = !Configurables.Defaults.UseEmoji; - public bool ForceRuntimesBuild { get; set; } = false; public string? HashAlgorithm { get; set; } public uint MakeConcurrency { get; set; } = 0; public ExecutionMode ExecutionMode { get; set; } = Configurables.Defaults.ExecutionMode; @@ -30,8 +29,6 @@ sealed class ParsedOptions public bool AutoProvisionUsesSudo { get; set; } public bool IgnoreMaxMonoVersion { get; set; } public bool IgnoreMinMonoVersion { get; set; } - public string? MonoArchiveCustomUrl { get; set; } - public bool EnableAll { get; set; } public RefreshableComponent RefreshList { get; set; } public IEnumerable AndroidSdkPlatforms { get; set; } = Enumerable.Empty (); } @@ -95,7 +92,6 @@ static async Task Run (string[] args) {"j|make-concurrency=", "Number of concurrent jobs for make to run. A positive integer or 0 for the default. Defaults to the number of CPUs/cores", v => parsedOptions.MakeConcurrency = EnsureUInt (v, "Invalid Make concurrency value") }, {"no-emoji", "Do not use any emoji characters in the output", v => parsedOptions.NoEmoji = true }, {"r|run-mode=", $"Specify the execution mode: {GetExecutionModes()}. See documentation for mode descriptions. Default: {Configurables.Defaults.ExecutionMode}", v => parsedOptions.ExecutionMode = ParseExecutionMode (v)}, - {"f|build-runtimes", $"Build runtimes even if the bundle/archives are available.", v => parsedOptions.ForceRuntimesBuild = true }, {"H|hash-algorithm=", "Use the specified hash algorithm instead of the default {Configurables.Defaults.HashAlgorithm}", v => parsedOptions.HashAlgorithm = v?.Trim () }, {"D|debug-ext=", $"Extension of files with debug information for managed DLLs and executables. Default: {parsedOptions.DebugFileExtension}", v => parsedOptions.DebugFileExtension = v?.Trim () ?? String.Empty }, {"v|verbosity=", $"Set console log verbosity to {{LEVEL}}. Level name may be abbreviated to the smallest unique part (one of: {GetVerbosityLevels ()}). Default: {Context.Instance.LoggingVerbosity.ToString().ToLowerInvariant ()}", v => parsedOptions.Verbosity = ParseLogVerbosity (v) }, @@ -103,14 +99,12 @@ static async Task Run (string[] args) {"ls", "List names of all known scenarios", v => parsedOptions.ListScenarios = true }, {"cf=", $"{{NAME}} of the compression format to use for some archives (e.g. the XA bundle). One of: {GetCompressionFormatNames ()}; Default: {parsedOptions.CompressionFormat}", v => parsedOptions.CompressionFormat = v?.Trim () ?? String.Empty}, {"c|configuration=", $"Build {{CONFIGURATION}}. Default: {Context.Instance.Configuration}", v => parsedOptions.Configuration = v?.Trim ()}, - {"a|enable-all", "Enable preparation of all the supported targets, ABIs etc", v => parsedOptions.EnableAll = true}, {"refresh:", "[sdk,ndk] Comma separated list of components which should be reinstalled. Defaults to all supported components if no value is provided.", v => parsedOptions.RefreshList = ParseRefreshableComponents (v?.Trim () ?? String.Empty)}, "", {"auto-provision=", $"Automatically install software required by Xamarin.Android", v => parsedOptions.AutoProvision = ParseBoolean (v)}, {"auto-provision-uses-sudo=", $"Allow use of sudo(1) when provisioning", v => parsedOptions.AutoProvisionUsesSudo = ParseBoolean (v)}, {"ignore-max-mono-version=", $"Ignore the maximum supported Mono version restriction", v => parsedOptions.IgnoreMaxMonoVersion = ParseBoolean (v)}, {"ignore-min-mono-version=", $"Ignore the minimum supported Mono version restriction", v => parsedOptions.IgnoreMinMonoVersion = ParseBoolean (v)}, - {"mono-archive-url=", "Use a specific URL for the mono archive.", v => parsedOptions.MonoArchiveCustomUrl = v?.Trim () }, {"android-sdk-platforms=", "Comma separated list of Android SDK platform levels to be installed. Defaults to all if no value is provided.", v => parsedOptions.AndroidSdkPlatforms = ParseAndroidSdkPlatformLevels (v?.Trim () ?? String.Empty) }, "", {"h|help", "Show this help message", v => parsedOptions.ShowHelp = true }, @@ -137,15 +131,12 @@ static async Task Run (string[] args) Context.Instance.MakeConcurrency = parsedOptions.MakeConcurrency; Context.Instance.NoEmoji = parsedOptions.NoEmoji; Context.Instance.ExecutionMode = parsedOptions.ExecutionMode; - Context.Instance.ForceRuntimesBuild = parsedOptions.ForceRuntimesBuild; Context.Instance.LoggingVerbosity = parsedOptions.Verbosity; Context.Instance.DebugFileExtension = parsedOptions.DebugFileExtension; Context.Instance.AutoProvision = parsedOptions.AutoProvision; Context.Instance.AutoProvisionUsesSudo = parsedOptions.AutoProvisionUsesSudo; Context.Instance.IgnoreMaxMonoVersion = parsedOptions.IgnoreMaxMonoVersion; Context.Instance.IgnoreMinMonoVersion = parsedOptions.IgnoreMinMonoVersion; - Context.Instance.MonoArchiveCustomUrl = parsedOptions.MonoArchiveCustomUrl ?? String.Empty; - Context.Instance.EnableAllTargets = parsedOptions.EnableAll; Context.Instance.ComponentsToRefresh = parsedOptions.RefreshList; Context.Instance.AndroidSdkPlatforms = parsedOptions.AndroidSdkPlatforms; diff --git a/build-tools/xaprepare/xaprepare/OperatingSystems/MacOS.cs b/build-tools/xaprepare/xaprepare/OperatingSystems/MacOS.cs index 906fab974c9..01671c98fc0 100644 --- a/build-tools/xaprepare/xaprepare/OperatingSystems/MacOS.cs +++ b/build-tools/xaprepare/xaprepare/OperatingSystems/MacOS.cs @@ -72,12 +72,6 @@ unsafe bool GetProcessIsTranslated () return ret != 0; } - protected override void PopulateEnvironmentVariables () - { - base.PopulateEnvironmentVariables (); - EnvironmentVariables ["MACOSX_DEPLOYMENT_TARGET"] = Configurables.Defaults.MacOSDeploymentTarget; - } - protected override bool InitOS () { if (!base.InitOS ()) @@ -91,7 +85,6 @@ protected override bool InitOS () Context.MonoOptions.Add ("--arch=64"); Context.Instance.Tools.BrewPath = brewPath; - HomebrewPrefix = Utilities.GetStringFromStdout (brewPath, "--prefix"); (bool success, string bv) = Utilities.GetProgramVersion (brewPath); if (!success || !Version.TryParse (bv, out Version? brewVersion) || brewVersion == null) { @@ -101,14 +94,6 @@ protected override bool InitOS () HomebrewVersion = brewVersion; - // This is a hack since we have a chicken-and-egg problem. On mac, Configuration.props uses the - // `HostHomebrewPrefix` property which is defined in `Configuration.OperatingSystem.props` but we're here to - // *generate* the latter file, so when the bootstrapper is built `HostHomebrewPrefix` is empty and we can't - // access mingw utilities. So, we need to cheat here. - string? mxePath = Context.Instance.Properties.GetValue (KnownProperties.AndroidMxeFullPath); - if (String.IsNullOrEmpty (mxePath)) - Context.Instance.Properties.Set (KnownProperties.AndroidMxeFullPath, HomebrewPrefix); - return true; } diff --git a/build-tools/xaprepare/xaprepare/OperatingSystems/OS.cs b/build-tools/xaprepare/xaprepare/OperatingSystems/OS.cs index 413cba6ae1a..370b798fdf4 100644 --- a/build-tools/xaprepare/xaprepare/OperatingSystems/OS.cs +++ b/build-tools/xaprepare/xaprepare/OperatingSystems/OS.cs @@ -84,12 +84,6 @@ abstract class OS : AppObject /// public string Architecture { get; protected set; } = String.Empty; - /// - /// Prefix where Homebrew is installed (relevant only on macOS, but present in all operating system for - /// compatibility reasons) - /// - public string HomebrewPrefix { get; set; } = String.Empty; - public virtual bool ProcessIsTranslated => false; /// diff --git a/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in b/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in index 6008a55fa01..7b5a2e7bac5 100644 --- a/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in +++ b/build-tools/xaprepare/xaprepare/Resources/Configuration.OperatingSystem.props.in @@ -10,7 +10,6 @@ @javac@ @jar@ @java@ - @HOST_HOMEBREW_PREFIX@ @NDK_LLVM_TAG@ diff --git a/build-tools/xaprepare/xaprepare/Resources/MonoGitHash.props.in b/build-tools/xaprepare/xaprepare/Resources/MonoGitHash.props.in deleted file mode 100644 index d5aebc5fcc1..00000000000 --- a/build-tools/xaprepare/xaprepare/Resources/MonoGitHash.props.in +++ /dev/null @@ -1,6 +0,0 @@ - - - - <_BuildInfo_MonoCommit>@MONO_COMMIT_HASH@ - - diff --git a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_PrepareImageDependencies.cs b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_PrepareImageDependencies.cs deleted file mode 100644 index a7b20e548a3..00000000000 --- a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_PrepareImageDependencies.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Xamarin.Android.Prepare -{ - [Scenario (isDefault: false)] - class Scenario_PrepareImageDependencies : ScenarioNoStandardEndSteps - { - public Scenario_PrepareImageDependencies () : base ("PrepareImageDependencies", "Prepare provisioning dependencies") - {} - - protected override void AddSteps (Context context) - { - Steps.Add (new Step_PrepareImageDependencies ()); - - // disable installation of missing programs... - context.SetCondition (KnownConditions.AllowProgramInstallation, false); - - // ...but do not signal an error when any are missing - context.SetCondition (KnownConditions.IgnoreMissingPrograms, true); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.Windows.cs b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.Windows.cs deleted file mode 100644 index 73aba8be5f6..00000000000 --- a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.Windows.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - partial class Scenario_Standard - { - partial void AddRequiredOSSpecificSteps (bool beforeBundle) - { - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs index 8c93310a154..65b4db34443 100644 --- a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs +++ b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs @@ -18,21 +18,12 @@ protected override void AddSteps (Context context) if (context == null) throw new ArgumentNullException (nameof (context)); - Steps.Add (new Step_ShowEnabledRuntimes ()); Steps.Add (new Step_InstallDotNetPreview ()); Steps.Add (new Step_InstallAdoptOpenJDK8 ()); Steps.Add (new Step_InstallMicrosoftOpenJDK11 ()); Steps.Add (new Step_Android_SDK_NDK ()); Steps.Add (new Step_GenerateFiles (atBuildStart: true)); Steps.Add (new Step_PrepareProps ()); - Steps.Add (new Step_PrepareExternal ()); - Steps.Add (new Step_PrepareLocal ()); - Steps.Add (new Step_DownloadMonoArchive ()); - AddRequiredOSSpecificSteps (true); - Steps.Add (new Step_InstallMonoRuntimes ()); - - // The next two steps MUST be after InstallMonoRuntimes above since the latter cleans up the target - // directory where the NDK binutils are installed Steps.Add (new Step_InstallGNUBinutils ()); Steps.Add (new Step_GenerateCGManifest ()); Steps.Add (new Step_Get_Android_BuildTools ()); @@ -44,6 +35,5 @@ protected override void AddEndSteps (Context context) Steps.Add (new Step_GenerateFiles (atBuildStart: false)); } - partial void AddRequiredOSSpecificSteps (bool beforeBundle); } } diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs b/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs deleted file mode 100644 index ca5a7917655..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_BuildMonoRuntimes.Unix.cs +++ /dev/null @@ -1,451 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace Xamarin.Android.Prepare -{ - class Step_BuildMonoRuntimes : StepWithDownloadProgress - { - const string StatusIndent = " "; - const string SubStatusIndent = " "; - - List? runtimeBuildMakeOptions; - List? runtimeBuildMakeTargets; - Runtimes? allRuntimes; - - public Step_BuildMonoRuntimes () - : base ("Preparing Mono runtimes") - { - Context.Instance.RuleGenerators.Add (MonoRuntime_RuleGenerator); - } - - protected override async Task Execute (Context context) - { - List enabledRuntimes = GetEnabledRuntimes (enableLogging: false); - if (enabledRuntimes.Count == 0) { - Log.StatusLine ("No runtimes to build/install"); - return true; - } - - if (!context.MonoArchiveDownloaded) { - List makeArguments = GetMakeArguments (context, enabledRuntimes); - if (!await BuildRuntimes (context, makeArguments)) { - Log.ErrorLine ("Mono runtime build failed"); - return false; - } - } - - CleanupBeforeInstall (); - Log.StatusLine (); - - string managedRuntime = context.Properties.GetRequiredValue (KnownProperties.ManagedRuntime); - bool haveManagedRuntime = !String.IsNullOrEmpty (managedRuntime); - - if (!await InstallRuntimes (context, enabledRuntimes)) - return false; - - if (!InstallBCL (context)) - return false; - - if (!InstallUtilities (context, haveManagedRuntime, managedRuntime)) - return false; - - - return true; - } - - void EnsureAllRuntimes () - { - if (allRuntimes == null) - throw new InvalidOperationException ("Step not initialized properly, allRuntimes is not set"); - } - - void CleanupBeforeInstall () - { - EnsureAllRuntimes (); - foreach (string dir in allRuntimes!.OutputDirectories) { - Utilities.DeleteDirectorySilent (dir); - } - } - - bool InstallUtilities (Context context, bool haveManagedRuntime, string managedRuntime) - { - string destDir = MonoRuntimesHelpers.UtilitiesDestinationDir; - - Utilities.CreateDirectory (destDir); - - StatusStep (context, "Installing runtime utilities"); - EnsureAllRuntimes (); - foreach (MonoUtilityFile muf in allRuntimes!.UtilityFilesToInstall) { - (string destFilePath, string debugSymbolsDestPath) = MonoRuntimesHelpers.GetDestinationPaths (muf); - Utilities.CopyFile (muf.SourcePath, destFilePath); - if (!muf.IgnoreDebugInfo) { - if (!String.IsNullOrEmpty (debugSymbolsDestPath)) { - Utilities.CopyFile (muf.DebugSymbolsPath, debugSymbolsDestPath); - } else { - Log.DebugLine ($"Debug symbols not found for utility file {Path.GetFileName (muf.SourcePath)}"); - } - } - } - - return true; - } - - bool GenerateFrameworkList (Context contex, string filePath, string bclDir, string facadesDir) - { - Log.DebugLine ($"Generating {filePath}"); - - EnsureAllRuntimes (); - var contents = new XElement ( - "FileList", - new XAttribute ("Redist", Runtimes.FrameworkListRedist), - new XAttribute ("Name", Runtimes.FrameworkListName), - allRuntimes!.BclFilesToInstall.Where (f => f.Type == BclFileType.FacadeAssembly || f.Type == BclFileType.ProfileAssembly).Select (f => ToFileElement (f)) - ); - contents.Save (filePath); - return true; - - XElement ToFileElement (BclFile bcf) - { - Log.Debug ("Writing "); - string fullFilePath; - - switch (bcf.Type) { - case BclFileType.ProfileAssembly: - fullFilePath = Path.Combine (bclDir, bcf.Name); - Log.Debug ("profile"); - break; - - case BclFileType.FacadeAssembly: - Log.Debug ("facade"); - fullFilePath = Path.Combine (facadesDir, bcf.Name); - break; - - default: - Log.Debug ("unsupported"); - fullFilePath = String.Empty; - break; - } - - Log.DebugLine ($" BCL assembly {bcf.Name}"); - if (String.IsNullOrEmpty (fullFilePath)) - throw new InvalidOperationException ($"Unsupported BCL file type {bcf.Type}"); - - AssemblyName aname = AssemblyName.GetAssemblyName (fullFilePath); - string? version = bcf.Version ?? String.Empty; - if (String.IsNullOrEmpty (version) && !Runtimes.FrameworkListVersionOverrides.TryGetValue (bcf.Name, out version) || version == null) - version = aname.Version?.ToString () ?? "0.0.0"; - - return new XElement ( - "File", - new XAttribute ("AssemblyName", aname.Name ?? "Unknown"), - new XAttribute ("Version", version), - new XAttribute ("PublicKeyToken", String.Join (String.Empty, aname.GetPublicKeyToken ()?.Select (b => b.ToString ("x2")) ?? new string[]{})), - new XAttribute ("ProcessorArchitecture", aname.ProcessorArchitecture.ToString ()) - ); - } - } - - bool InstallBCL (Context context) - { - string redistListDir = MonoRuntimesHelpers.BCLRedistListDestinationDir; - - foreach (KeyValuePair kvp in MonoRuntimesHelpers.BCLDestinationDirs) { - Utilities.CreateDirectory (kvp.Value); - } - - foreach (KeyValuePair kvp in MonoRuntimesHelpers.BCLFacadesDestinationDirs) { - Utilities.CreateDirectory (kvp.Value); - } - - Utilities.CreateDirectory (redistListDir); - - StatusStep (context, "Installing Android BCL assemblies"); - EnsureAllRuntimes (); - InstallBCLFiles (allRuntimes!.BclFilesToInstall); - - StatusStep (context, "Installing Designer Host BCL assemblies"); - InstallBCLFiles (allRuntimes.DesignerHostBclFilesToInstall); - - StatusStep (context, "Installing Designer Windows BCL assemblies"); - InstallBCLFiles (allRuntimes.DesignerWindowsBclFilesToInstall); - - return GenerateFrameworkList ( - context, - MonoRuntimesHelpers.FrameworkListPath, - MonoRuntimesHelpers.BCLDestinationDirs [BclFileTarget.Android], - MonoRuntimesHelpers.BCLFacadesDestinationDirs [BclFileTarget.Android] - ); - } - - void InstallBCLFiles (List files) - { - foreach (BclFile bf in files) { - (string destFilePath, string debugSymbolsDestPath) = MonoRuntimesHelpers.GetDestinationPaths (bf); - - Utilities.CopyFile (bf.SourcePath, destFilePath); - if (!bf.ExcludeDebugSymbols && !String.IsNullOrEmpty (bf.DebugSymbolsPath) && debugSymbolsDestPath.Length > 0) - Utilities.CopyFile (bf.DebugSymbolsPath!, debugSymbolsDestPath); - } - } - - async Task InstallRuntimes (Context context, List enabledRuntimes) - { - StatusStep (context, "Installing tests"); - EnsureAllRuntimes (); - foreach (TestAssembly tasm in allRuntimes!.TestAssemblies) { - string sourceBasePath; - - switch (tasm.TestType) { - case TestAssemblyType.Reference: - case TestAssemblyType.TestRunner: - sourceBasePath = Path.Combine (Configurables.Paths.MonoProfileDir); - break; - - case TestAssemblyType.XUnit: - case TestAssemblyType.NUnit: - case TestAssemblyType.Satellite: - sourceBasePath = Configurables.Paths.BCLTestsSourceDir; - break; - - default: - throw new InvalidOperationException ($"Unsupported test assembly type: {tasm.TestType}"); - } - - (string destFilePath, string debugSymbolsDestPath) = MonoRuntimesHelpers.GetDestinationPaths (tasm); - CopyFile (Path.Combine (sourceBasePath, tasm.Name), destFilePath); - if (debugSymbolsDestPath.Length > 0) - CopyFile (Path.Combine (sourceBasePath, Utilities.GetDebugSymbolsPath (tasm.Name)), debugSymbolsDestPath); - } - - StatusSubStep (context, "Creating BCL tests archive"); - Utilities.DeleteFileSilent (MonoRuntimesHelpers.BCLTestsArchivePath); - var sevenZip = new SevenZipRunner (context); - if (!await sevenZip.Zip (MonoRuntimesHelpers.BCLTestsArchivePath, MonoRuntimesHelpers.BCLTestsDestinationDir, new List { "." })) { - Log.ErrorLine ("BCL tests archive creation failed, see the log files for details."); - return false; - } - - StatusStep (context, "Installing runtimes"); - foreach (Runtime runtime in enabledRuntimes) { - StatusSubStep (context, $"Installing {runtime.Flavor} runtime {runtime.Name}"); - - string src, dst; - bool skipFile; - foreach (RuntimeFile rtf in allRuntimes.RuntimeFilesToInstall) { - if (rtf.Shared && rtf.AlreadyCopied) - continue; - - (skipFile, src, dst) = MonoRuntimesHelpers.GetRuntimeFilePaths (runtime, rtf); - if (skipFile || src.Length == 0 || dst.Length == 0) - continue; - - CopyFile (src, dst); - if (!StripFile (runtime, rtf, dst)) - return false; - - if (rtf.Shared) - rtf.AlreadyCopied = true; - } - } - - return true; - - bool StripFile (Runtime runtime, RuntimeFile rtf, string filePath) - { - if (rtf.Type != RuntimeFileType.StrippableBinary) - return true; - - var monoRuntime = runtime.As (); - if (monoRuntime == null || !monoRuntime.CanStripNativeLibrary || !rtf.Strip) - return true; - - if (String.IsNullOrEmpty (monoRuntime.Strip)) { - Log.WarningLine ($"Binary stripping impossible, runtime {monoRuntime.Name} doesn't define the strip command"); - return true; - } - - bool result; - if (!String.IsNullOrEmpty (monoRuntime.StripFlags)) - result = Utilities.RunCommand (monoRuntime.Strip, monoRuntime.StripFlags, filePath); - else - result = Utilities.RunCommand (monoRuntime.Strip, filePath); - - if (result) - return true; - - Log.ErrorLine ($"Failed to strip the binary file {filePath}, see logs for error details"); - return false; - } - - void CopyFile (string src, string dest) - { - if (!CheckFileExists (src, true)) - return; - - Utilities.CopyFile (src, dest); - } - } - - async Task BuildRuntimes (Context context, List makeArguments) - { - var make = new MakeRunner (context); - - bool result = await make.Run ( - logTag: "mono-runtimes", - workingDirectory: GetWorkingDirectory (context), - arguments: makeArguments - ); - - if (!result) - return false; - - Utilities.SaveAbiChoice (context); - - return true; - } - - string GetWorkingDirectory (Context context) - { - return Path.Combine (context.Properties.GetRequiredValue (KnownProperties.MonoSourceFullPath), "sdks", "builds"); - } - - List GetMakeArguments (Context context, List enabledRuntimes) - { - string workingDirectory = GetWorkingDirectory (context); - return PrepareMakeArguments (context, workingDirectory, enabledRuntimes); - } - - List GetEnabledRuntimes (bool enableLogging) - { - var enabledRuntimes = new List (); - - if (allRuntimes == null) - allRuntimes = new Runtimes (); - return MonoRuntimesHelpers.GetEnabledRuntimes (allRuntimes, enableLogging); - } - - List PrepareMakeArguments (Context context, string workingDirectory, List runtimes) - { - string toolchainsPrefix = Path.Combine (GetProperty (KnownProperties.AndroidToolchainDirectory), "toolchains"); - - var ret = new List { - "ENABLE_ANDROID=1", - $"CONFIGURATION={Configurables.Defaults.MonoSdksConfiguration}", - "IGNORE_PROVISION_MXE=false", - "IGNORE_PROVISION_ANDROID=true", - $"ANDROID_CMAKE_VERSION={GetProperty (KnownProperties.AndroidCmakeVersionPath)}", - $"ANDROID_NDK_VERSION=r{BuildAndroidPlatforms.AndroidNdkVersion}", - $"ANDROID_SDK_VERSION_armeabi-v7a={BuildAndroidPlatforms.NdkMinimumAPILegacy32}", - $"ANDROID_SDK_VERSION_arm64-v8a={BuildAndroidPlatforms.NdkMinimumAPI}", - $"ANDROID_SDK_VERSION_x86={BuildAndroidPlatforms.NdkMinimumAPILegacy32}", - $"ANDROID_SDK_VERSION_x86_64={BuildAndroidPlatforms.NdkMinimumAPI}", - $"ANDROID_TOOLCHAIN_DIR={GetProperty (KnownProperties.AndroidToolchainDirectory)}", - $"ANDROID_TOOLCHAIN_CACHE_DIR={GetProperty (KnownProperties.AndroidToolchainCacheDirectory)}", - $"ANDROID_TOOLCHAIN_PREFIX={toolchainsPrefix}", - $"MXE_PREFIX_DIR={GetProperty (KnownProperties.AndroidToolchainDirectory)}", - $"MXE_SRC={Configurables.Paths.MxeSourceDir}" - }; - - runtimeBuildMakeOptions = new List (ret); - runtimeBuildMakeTargets = new List (); - - List? standardArgs = null; - var make = new MakeRunner (context); - make.GetStandardArguments (ref standardArgs, workingDirectory); - if (standardArgs != null && standardArgs.Count > 0) { - runtimeBuildMakeOptions.AddRange (standardArgs); - } - - AddPackageTargets (runtimes.Where (r => r is MonoJitRuntime)); - ret.Add ("package-android-bcl"); - AddTargets ("provision-llvm", runtimes.Where (r => r is LlvmRuntime)); - - return ret; - - void AddPackageTargets (IEnumerable items) - { - AddTargets ("package-android", items); - } - - void AddTargets (string prefix, IEnumerable items) - { - foreach (Runtime runtime in items) { - string target = $"{prefix}-{runtime.Name}"; - ret.Add (target); - runtimeBuildMakeTargets!.Add (target); - } - } - - string GetProperty (string name) - { - return context.Properties.GetRequiredValue (name); - } - } - - void MonoRuntime_RuleGenerator (GeneratedMakeRulesFile file, StreamWriter ruleWriter) - { - const string OptionsVariableName = "MONO_RUNTIME_SDKS_MAKE_OPTIONS"; - - if (runtimeBuildMakeOptions == null || runtimeBuildMakeTargets == null) { - List enabledRuntimes = GetEnabledRuntimes (false); - GetMakeArguments (Context.Instance, enabledRuntimes); - - if (runtimeBuildMakeOptions == null || runtimeBuildMakeTargets == null) { - Log.DebugLine ("No rules to generate for Mono SDKs build"); - return; - } - } - - ruleWriter.Write ($"{OptionsVariableName} ="); - foreach (string opt in runtimeBuildMakeOptions) { - ruleWriter.WriteLine (" \\"); - ruleWriter.Write ($"\t{opt}"); - } - ruleWriter.WriteLine (); - - foreach (string target in runtimeBuildMakeTargets) { - ruleWriter.WriteLine (); - ruleWriter.WriteLine ($"sdks-{target}:"); - ruleWriter.WriteLine ($"\t$(MAKE) $({OptionsVariableName}) {target}"); - } - - ruleWriter.WriteLine (); - ruleWriter.WriteLine ("sdks-all:"); - - string allTargets = String.Join (" ", runtimeBuildMakeTargets); - ruleWriter.WriteLine ($"\t$(MAKE) $({OptionsVariableName}) {allTargets}"); - } - - void StatusMessage (Context context, string indent, string message) - { - Log.StatusLine ($"{indent}{context.Characters.Bullet} {message}"); - } - - void StatusStep (Context context, string name) - { - StatusMessage (context, StatusIndent, name);; - } - - void StatusSubStep (Context context, string name) - { - StatusMessage (context, SubStatusIndent, name);; - } - - bool CheckFileExists (string filePath, bool required) - { - if (File.Exists (filePath)) - return true; - - if (required) - throw new InvalidOperationException ($"Required file not found: {filePath}"); - - return false; - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_DownloadMonoArchive.cs b/build-tools/xaprepare/xaprepare/Steps/Step_DownloadMonoArchive.cs deleted file mode 100644 index ebe0278e49a..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_DownloadMonoArchive.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace Xamarin.Android.Prepare -{ - class Step_DownloadMonoArchive : StepWithDownloadProgress - { - public Step_DownloadMonoArchive () - : base ("Downloading Mono archive") - {} - - protected override async Task Execute (Context context) - { - bool success = await DownloadMonoArchive (context); - - if (!success) { - Log.InfoLine ("Mono archive not present"); - return true; - } else - Utilities.SaveAbiChoice (context); - - context.MonoArchiveDownloaded = success; - return true; - } - - async Task DownloadMonoArchive (Context context) - { - if (context.ForceRuntimesBuild) { - Log.StatusLine ("Mono runtime rebuild forced, Mono Archive download skipped"); - return false; - } - - Log.StatusLine ("Checking if all runtime files are present"); - var allRuntimes = new Runtimes (); - if (MonoRuntimesHelpers.AreRuntimeItemsInstalled (context, allRuntimes)) { - - // User might have changed the set of ABIs to build, we need to check and rebuild if necessary - if (!Utilities.AbiChoiceChanged (context)) { - Log.StatusLine ("Mono runtimes already present and complete. No need to download or build."); - return true; - } - - Log.StatusLine ("Mono already present, but the choice of ABIs changed since previous build, runtime refresh is necessary"); - } - Log.Instance.StatusLine ($" {Context.Instance.Characters.Bullet} some files are missing, download and extraction required"); - - string localPath, archiveFileName; - if (string.IsNullOrEmpty (context.MonoArchiveCustomUrl)) { - localPath = Configurables.Paths.MonoArchiveLocalPath; - archiveFileName = Configurables.Paths.MonoArchiveFileName; - } else { - var uri = new Uri (context.MonoArchiveCustomUrl); - archiveFileName = Path.GetFileName (uri.LocalPath); - localPath = Path.Combine (context.Properties.GetRequiredValue (KnownProperties.AndroidToolchainCacheDirectory), archiveFileName); - } - - bool result = false; - for (uint i = 0; i < 3; i++) { - result = await DownloadAndUpackIfNeeded ( - context, - "Mono", - context.MonoArchiveCustomUrl, - localPath, - archiveFileName, - Configurables.Paths.MonoSDKSOutputDir - ); - - if (result) - break; - } - - if (!result) - return false; - - for (uint i = 0; i < 3; i++) { - result = await DownloadAndUpackIfNeeded ( - context, - "Windows Mono", - customUrl: String.Empty, - localPath: Configurables.Paths.MonoArchiveWindowsLocalPath, - archiveFileName: Configurables.Paths.MonoArchiveWindowsFileName, - destinationDirectory: Configurables.Paths.BCLWindowsOutputDir - ); - - if (result) - break; - } - - return result; - } - - async Task DownloadAndUpackIfNeeded (Context context, string name, string customUrl, string localPath, string archiveFileName, string destinationDirectory) - { - if (File.Exists (localPath)) { - Log.StatusLine ($"{name} archive already downloaded"); - } else { - Utilities.DeleteFileSilent (localPath); - - var url = string.IsNullOrEmpty (customUrl) ? - new Uri (Configurables.Urls.MonoArchive_BaseUri, archiveFileName) : - new Uri (customUrl); - Log.StatusLine ($"Downloading {name} archive from {url}"); - - (bool success, ulong size, HttpStatusCode status) = await Utilities.GetDownloadSizeWithStatus (url); - if (!success) { - if (status == HttpStatusCode.NotFound) - Log.Info ($"{name} archive URL not found"); - else - Log.Info ($"Failed to obtain {name} archive size. HTTP status code: {status} ({(int)status})"); - Log.InfoLine (". Mono runtimes will be rebuilt"); - return false; - } - - DownloadStatus downloadStatus = Utilities.SetupDownloadStatus (context, size, context.InteractiveSession); - Log.StatusLine ($" {context.Characters.Link} {url}", ConsoleColor.White); - await Download (context, url, localPath, $"{name} Archive", archiveFileName, downloadStatus); - - if (!File.Exists (localPath)) { - Log.InfoLine ($"Download of {name} archive from {url} failed"); - return false; - } - } - - string tempDir = $"{destinationDirectory}.tmp"; - if (!await Utilities.Unpack (localPath, tempDir, cleanDestinatioBeforeUnpacking: true)) { - Utilities.DeleteFileSilent (localPath); - Utilities.DeleteDirectorySilent (destinationDirectory); - Log.WarningLine ($"Failed to unpack {name} archive {localPath}"); - Utilities.DeleteFileSilent (localPath); - return false; - } - - Log.DebugLine ($"Moving unpacked Mono archive from {tempDir} to {destinationDirectory}"); - try { - Utilities.MoveDirectoryContentsRecursively (tempDir, destinationDirectory, resetFileTimestamp: true); - } finally { - Utilities.DeleteDirectorySilent (tempDir); - // Clean up zip after extraction if running on a hosted azure pipelines agent. - if (context.IsRunningOnHostedAzureAgent) - Utilities.DeleteFileSilent (localPath); - } - - return true; - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index 1bd8641f435..aaa16fb9225 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -55,7 +55,6 @@ protected override async Task Execute (Context context) if (onlyRequired) { return new List { Get_SourceLink_Json (context), - Get_MonoGitHash_props (context), Get_Configuration_Generated_Props (context), Get_Cmake_XA_Build_Configuration (context), }; @@ -67,7 +66,6 @@ protected override async Task Execute (Context context) Get_Cmake_XA_Build_Configuration (context), Get_Ndk_projitems (context), Get_XABuildConfig_cs (context), - Get_MonoGitHash_props (context), Get_Omnisharp_Json (context), }; } @@ -77,7 +75,6 @@ protected override async Task Execute (Context context) return null; var steps = new List { - new GeneratedProfileAssembliesProjitemsFile (Configurables.Paths.ProfileAssembliesProjitemsPath), new GeneratedMonoAndroidProjitemsFile (), }; @@ -133,7 +130,6 @@ GeneratedFile Get_Configuration_OperatingSystem_props (Context context) { "@OS_RELEASE@", context.OS.Release ?? String.Empty }, { "@HOST_CPUS@", context.OS.CPUCount.ToString () }, { "@ARCHITECTURE_BITS@", context.OS.Is64Bit ? "64" : "32" }, - { "@HOST_HOMEBREW_PREFIX@", context.OS.HomebrewPrefix ?? String.Empty }, { "@JavaSdkDirectory@", context.OS.JavaHome }, { "@javac@", context.OS.JavaCPath }, { "@java@", context.OS.JavaPath }, @@ -202,21 +198,6 @@ GeneratedFile Get_Ndk_projitems (Context context) ); } - public GeneratedFile Get_MonoGitHash_props (Context context) - { - const string OutputFileName = "MonoGitHash.props"; - - var replacements = new Dictionary (StringComparer.Ordinal) { - { "@MONO_COMMIT_HASH@", context.BuildInfo.MonoHash } - }; - - return new GeneratedPlaceholdersFile ( - replacements, - Path.Combine (Configurables.Paths.BootstrapResourcesDir, $"{OutputFileName}.in"), - Path.Combine (Configurables.Paths.BuildBinDir, OutputFileName) - ); - } - public GeneratedFile Get_Omnisharp_Json (Context context) { const string OutputFileName = "omnisharp.json"; diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs b/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs deleted file mode 100644 index 8bc930477a8..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs +++ /dev/null @@ -1,337 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace Xamarin.Android.Prepare -{ - class Step_InstallMonoRuntimes : StepWithDownloadProgress - { - const string StatusIndent = " "; - const string SubStatusIndent = " "; - - Runtimes? allRuntimes; - - public Step_InstallMonoRuntimes () - : base ("Installing Mono runtimes") - { - } - - protected override async Task Execute (Context context) - { - List enabledRuntimes = GetEnabledRuntimes (enableLogging: false); - if (enabledRuntimes.Count == 0) { - Log.StatusLine ("No runtimes to build/install"); - return true; - } - - if (!context.MonoArchiveDownloaded) { - // https://github.com/xamarin/xamarin-android/pull/3816 - throw new NotImplementedException ("Unable to build mono runtimes from sources."); - } - - Log.StatusLine ("Checking if all runtime files are present"); - var allRuntimes = new Runtimes (); - if (MonoRuntimesHelpers.AreRuntimeItemsInstalled (context, allRuntimes)) { - - // User might have changed the set of ABIs to build, we need to check and rebuild if necessary - if (!Utilities.AbiChoiceChanged (context)) { - Log.StatusLine ("Mono runtimes already present and complete. No need to download or build."); - return true; - } - - Log.StatusLine ("Mono already present, but the choice of ABIs changed since previous build, runtime refresh is necessary"); - } - Log.Instance.StatusLine ($" {Context.Instance.Characters.Bullet} some files are missing, rebuild/reinstall forced"); - - CleanupBeforeInstall (); - Log.StatusLine (); - - string managedRuntime = context.Properties.GetRequiredValue (KnownProperties.ManagedRuntime); - bool haveManagedRuntime = !String.IsNullOrEmpty (managedRuntime); - - if (!await InstallRuntimes (context, enabledRuntimes)) - return false; - - if (!InstallBCL (context)) - return false; - - if (!InstallUtilities (context, haveManagedRuntime, managedRuntime)) - return false; - - return true; - } - - void EnsureAllRuntimes () - { - if (allRuntimes == null) - throw new InvalidOperationException ("Step not initialized properly, allRuntimes is not set"); - } - - void CleanupBeforeInstall () - { - EnsureAllRuntimes (); - foreach (string dir in allRuntimes!.OutputDirectories) { - Utilities.DeleteDirectorySilent (dir); - } - } - - bool InstallUtilities (Context context, bool haveManagedRuntime, string managedRuntime) - { - string destDir = MonoRuntimesHelpers.UtilitiesDestinationDir; - - Utilities.CreateDirectory (destDir); - - StatusStep (context, "Installing runtime utilities"); - EnsureAllRuntimes (); - foreach (MonoUtilityFile muf in allRuntimes!.UtilityFilesToInstall) { - (string destFilePath, string debugSymbolsDestPath) = MonoRuntimesHelpers.GetDestinationPaths (muf); - Utilities.CopyFile (muf.SourcePath, destFilePath); - if (!muf.IgnoreDebugInfo) { - if (!String.IsNullOrEmpty (debugSymbolsDestPath)) { - Utilities.CopyFile (muf.DebugSymbolsPath, debugSymbolsDestPath); - } else { - Log.DebugLine ($"Debug symbols not found for utility file {Path.GetFileName (muf.SourcePath)}"); - } - } - } - - return true; - } - - bool GenerateFrameworkList (Context contex, string filePath, string bclDir, string facadesDir) - { - Log.DebugLine ($"Generating {filePath}"); - - EnsureAllRuntimes (); - var contents = new XElement ( - "FileList", - new XAttribute ("Redist", Runtimes.FrameworkListRedist), - new XAttribute ("Name", Runtimes.FrameworkListName), - allRuntimes!.BclFilesToInstall.Where (f => f.Type == BclFileType.FacadeAssembly || f.Type == BclFileType.ProfileAssembly).Select (f => ToFileElement (f)) - ); - contents.Save (filePath); - return true; - - XElement ToFileElement (BclFile bcf) - { - Log.Debug ("Writing "); - string fullFilePath; - - switch (bcf.Type) { - case BclFileType.ProfileAssembly: - fullFilePath = Path.Combine (bclDir, bcf.Name); - Log.Debug ("profile"); - break; - - case BclFileType.FacadeAssembly: - Log.Debug ("facade"); - fullFilePath = Path.Combine (facadesDir, bcf.Name); - break; - - default: - Log.Debug ("unsupported"); - fullFilePath = String.Empty; - break; - } - - Log.DebugLine ($" BCL assembly {bcf.Name}"); - if (String.IsNullOrEmpty (fullFilePath)) - throw new InvalidOperationException ($"Unsupported BCL file type {bcf.Type}"); - - AssemblyName aname = AssemblyName.GetAssemblyName (fullFilePath); - string? version = bcf.Version ?? String.Empty; - if (String.IsNullOrEmpty (version) && !Runtimes.FrameworkListVersionOverrides.TryGetValue (bcf.Name, out version) || version == null) - version = aname.Version?.ToString () ?? "0.0.0"; - - return new XElement ( - "File", - new XAttribute ("AssemblyName", aname.Name ?? "Unknown"), - new XAttribute ("Version", version), - new XAttribute ("PublicKeyToken", String.Join (String.Empty, aname.GetPublicKeyToken ()?.Select (b => b.ToString ("x2")) ?? new string[]{})), - new XAttribute ("ProcessorArchitecture", aname.ProcessorArchitecture.ToString ()) - ); - } - } - - bool InstallBCL (Context context) - { - string redistListDir = MonoRuntimesHelpers.BCLRedistListDestinationDir; - - foreach (KeyValuePair kvp in MonoRuntimesHelpers.BCLDestinationDirs) { - Utilities.CreateDirectory (kvp.Value); - } - - foreach (KeyValuePair kvp in MonoRuntimesHelpers.BCLFacadesDestinationDirs) { - Utilities.CreateDirectory (kvp.Value); - } - - Utilities.CreateDirectory (redistListDir); - - StatusStep (context, "Installing Android BCL assemblies"); - EnsureAllRuntimes (); - InstallBCLFiles (allRuntimes!.BclFilesToInstall); - - StatusStep (context, "Installing Designer Host BCL assemblies"); - InstallBCLFiles (allRuntimes.DesignerHostBclFilesToInstall); - - StatusStep (context, "Installing Designer Windows BCL assemblies"); - InstallBCLFiles (allRuntimes.DesignerWindowsBclFilesToInstall); - - return GenerateFrameworkList ( - context, - MonoRuntimesHelpers.FrameworkListPath, - MonoRuntimesHelpers.BCLDestinationDirs [BclFileTarget.Android], - MonoRuntimesHelpers.BCLFacadesDestinationDirs [BclFileTarget.Android] - ); - } - - void InstallBCLFiles (List files) - { - foreach (BclFile bf in files) { - (string destFilePath, string debugSymbolsDestPath) = MonoRuntimesHelpers.GetDestinationPaths (bf); - - Utilities.CopyFile (bf.SourcePath, destFilePath); - if (!bf.ExcludeDebugSymbols && !String.IsNullOrEmpty (bf.DebugSymbolsPath) && debugSymbolsDestPath.Length > 0) - Utilities.CopyFile (bf.DebugSymbolsPath!, debugSymbolsDestPath); - } - } - - async Task InstallRuntimes (Context context, List enabledRuntimes) - { - StatusStep (context, "Installing tests"); - EnsureAllRuntimes (); - foreach (TestAssembly tasm in allRuntimes!.TestAssemblies) { - string sourceBasePath; - - switch (tasm.TestType) { - case TestAssemblyType.Reference: - case TestAssemblyType.TestRunner: - sourceBasePath = Path.Combine (Configurables.Paths.MonoProfileDir); - break; - - case TestAssemblyType.XUnit: - case TestAssemblyType.NUnit: - case TestAssemblyType.Satellite: - sourceBasePath = Configurables.Paths.BCLTestsSourceDir; - break; - - default: - throw new InvalidOperationException ($"Unsupported test assembly type: {tasm.TestType}"); - } - - (string destFilePath, string debugSymbolsDestPath) = MonoRuntimesHelpers.GetDestinationPaths (tasm); - CopyFile (Path.Combine (sourceBasePath, tasm.Name), destFilePath); - if (debugSymbolsDestPath.Length > 0) - CopyFile (Path.Combine (sourceBasePath, Utilities.GetDebugSymbolsPath (tasm.Name)), debugSymbolsDestPath); - } - - StatusSubStep (context, "Creating BCL tests archive"); - Utilities.DeleteFileSilent (MonoRuntimesHelpers.BCLTestsArchivePath); - var sevenZip = new SevenZipRunner (context); - if (!await sevenZip.Zip (MonoRuntimesHelpers.BCLTestsArchivePath, MonoRuntimesHelpers.BCLTestsDestinationDir, new List { "." })) { - Log.ErrorLine ("BCL tests archive creation failed, see the log files for details."); - return false; - } - - StatusStep (context, "Installing runtimes"); - foreach (Runtime runtime in enabledRuntimes) { - StatusSubStep (context, $"Installing {runtime.Flavor} runtime {runtime.DisplayName}"); - - string src, dst; - bool skipFile; - foreach (RuntimeFile rtf in allRuntimes.RuntimeFilesToInstall) { - if (rtf.Shared && rtf.AlreadyCopied) - continue; - - (skipFile, src, dst) = MonoRuntimesHelpers.GetRuntimeFilePaths (runtime, rtf); - if (skipFile || src.Length == 0 || dst.Length == 0) - continue; - - CopyFile (src, dst); - if (!StripFile (runtime, rtf, dst)) - return false; - - if (rtf.Shared) - rtf.AlreadyCopied = true; - } - } - - return true; - - bool StripFile (Runtime runtime, RuntimeFile rtf, string filePath) - { - if (rtf.Type != RuntimeFileType.StrippableBinary) - return true; - - var monoRuntime = runtime.As (); - if (monoRuntime == null || !monoRuntime.CanStripNativeLibrary || !rtf.Strip) - return true; - - if (String.IsNullOrEmpty (monoRuntime.Strip)) { - Log.WarningLine ($"Binary stripping impossible, runtime {monoRuntime.DisplayName} doesn't define the strip command"); - return true; - } - - bool result; - if (!String.IsNullOrEmpty (monoRuntime.StripFlags)) - result = Utilities.RunCommand (monoRuntime.Strip, monoRuntime.StripFlags, filePath); - else - result = Utilities.RunCommand (monoRuntime.Strip, filePath); - - if (result) - return true; - - Log.ErrorLine ($"Failed to {monoRuntime.Strip} the binary file {filePath}, see logs for error details"); - return false; - } - - void CopyFile (string src, string dest) - { - if (!CheckFileExists (src, true)) - return; - - Utilities.CopyFile (src, dest); - } - } - - List GetEnabledRuntimes (bool enableLogging) - { - var enabledRuntimes = new List (); - - if (allRuntimes == null) - allRuntimes = new Runtimes (); - return MonoRuntimesHelpers.GetEnabledRuntimes (allRuntimes, enableLogging); - } - - void StatusMessage (Context context, string indent, string message) - { - Log.StatusLine ($"{indent}{context.Characters.Bullet} {message}"); - } - - void StatusStep (Context context, string name) - { - StatusMessage (context, StatusIndent, name); - } - - void StatusSubStep (Context context, string name) - { - StatusMessage (context, SubStatusIndent, name); - } - - bool CheckFileExists (string filePath, bool required) - { - if (File.Exists (filePath)) - return true; - - if (required) - throw new InvalidOperationException ($"Required file not found: {filePath}"); - - return false; - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareBundle.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareBundle.cs deleted file mode 100644 index 94d4a7eb852..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareBundle.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.IO; -using System.Net; -using System.Threading.Tasks; - -namespace Xamarin.Android.Prepare -{ - partial class Step_PrepareBundle : StepWithDownloadProgress - { - static Uri BundleUriPrefix => Configurables.Urls.Bundle_XABundleDownloadPrefix; - static string BundleFileName => Configurables.Paths.XABundleFileName; - static bool osSupportsMonoBuild; - - public Step_PrepareBundle () - : base ("Preparing the binary bundle") - { - InitOS (); - } - - protected override async Task Execute (Context context) - { - if (context.ForceRuntimesBuild) { - if (osSupportsMonoBuild) { - Log.InfoLine ("Rebuilding Mono runtimes as requested"); - return false; - } - - Log.InfoLine ($"Forced Mono runtimes rebuild requested but rebuilding on {context.OS.Type} is currently not supported."); - } - - string localPackagePath = Configurables.Paths.BundleArchivePath; - Log.DebugLine ($"Local bundle path: {localPackagePath}"); - - if (File.Exists (localPackagePath)) { - Log.StatusLine ("Xamarin.Android Bundle archive already downloaded"); - } else { - if (!String.IsNullOrEmpty (context.XABundlePath)) { - // User indicated they wanted to use a specific bundle that's supposed to be on disk. It's not (or - // it's invalid) and that means we have no way of getting it - we can't download the default one - // since that was not the intention behind overriding the location. Thus, we error out. - Log.DebugLine ($"Bundle directory from command line: {context.XABundlePath}"); - throw new InvalidOperationException ($"Xamarin.Android bundle indicated on the command line does not exist ({context.XABundlePath})"); - } - - var bundleUrl = new Uri (BundleUriPrefix, BundleFileName); - - Log.StatusLine ("Bundle URL: ", $"{bundleUrl}", tailColor: ConsoleColor.Cyan); - - HttpStatusCode status; - bool success; - ulong size; - - (success, size, status) = await Utilities.GetDownloadSizeWithStatus (bundleUrl); - if (!success) { - if (status == HttpStatusCode.NotFound) { - if (osSupportsMonoBuild) - Log.StatusLine (" not found, will need to rebuild"); - else - Log.ErrorLine ($" not found, rebuilding on {context.OS.Type} is not currently supported"); - return false; - } - - if (String.IsNullOrEmpty (bundle404Message)) - throw new InvalidOperationException ($"Failed to access bundle at {bundleUrl} (HTTP status: {status})"); - else - throw new InvalidOperationException (bundle404Message); - } - - DownloadStatus downloadStatus = Utilities.SetupDownloadStatus (context, size, context.InteractiveSession); - Log.StatusLine ($" {context.Characters.Link} {bundleUrl}", ConsoleColor.White); - await Download (context, bundleUrl, localPackagePath, "Xamarin.Android Bundle", Path.GetFileName (localPackagePath), downloadStatus); - - if (!File.Exists (localPackagePath)) { - Log.ErrorLine ($"Download of Xamarin.Android Bundle from {bundleUrl} failed."); - return false; - } - } - - Log.StatusLine ($"Unpacking bundle to {Utilities.GetRelativePath (BuildPaths.XamarinAndroidSourceRoot, Configurables.Paths.BundleInstallDir)}"); - string tempDir = $"{Configurables.Paths.BundleInstallDir}-bundle.temp"; - try { - if (!await Utilities.Unpack (localPackagePath, tempDir, cleanDestinatioBeforeUnpacking: true)) { - Log.WarningLine ("Failed to unpack bundle, will need to rebuild"); - return false; - } - - Log.DebugLine ($"Moving unpacked bundle from {tempDir} to {Configurables.Paths.BundleInstallDir}"); - Utilities.MoveDirectoryContentsRecursively (tempDir, Configurables.Paths.BundleInstallDir, resetFileTimestamp: true, ignoreDeletionErrors: true); - } finally { - Utilities.DeleteDirectorySilent (tempDir); - } - - if (String.IsNullOrEmpty (context.XABundleCopyDir)) - return HaveEverything (); - - string destPackagePath = Path.Combine (context.XABundleCopyDir, Path.GetFileName (localPackagePath)); - Log.DebugLine ($"Copy of the XA bundle was requested to be created at {destPackagePath}"); - if (Utilities.FileExists (destPackagePath)) { - Log.DebugLine ("Bundle copy already exists"); - return HaveEverything (); - } - - // Utilities.FileExists above will return `false` for a dangling symlink at `destPackagePath`, doesn't hurt - // to remove it here just in case - Utilities.DeleteFileSilent (destPackagePath); - Utilities.CopyFile (localPackagePath, destPackagePath); - - return HaveEverything (); - - bool HaveEverything () - { - bool ret = MonoRuntimesHelpers.AllBundleItemsPresent (new Runtimes ()); - if (!ret) - Log.Instance.StatusLine ($"Some bundle files are missing, download/rebuild/reinstall forced"); - return ret; - } - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternal.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternal.cs deleted file mode 100644 index b49a3592d65..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternal.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; - -namespace Xamarin.Android.Prepare -{ - partial class Step_PrepareExternal : Step - { - public Step_PrepareExternal () - : base ("Preparing external components") - {} - - protected override async Task Execute (Context context) - { - var msbuild = new MSBuildRunner (context); - - string slnPath = Path.Combine (Configurables.Paths.ExternalDir, "debugger-libs", "debugger-libs.sln"); - bool result = await msbuild.Restore ( - projectPath: slnPath, - logTag: "debugger-libs-restore", - binlogName: "prepare-debugger-libs-restore" - ); - - if (!result) - return false; - - return await msbuild.Restore ( - projectPath: Configurables.Paths.ExternalXamarinAndroidToolsSln, - logTag: "xat-restore", - arguments: new List () { "--configfile", Path.Combine (Configurables.Paths.ExternalDir, "xamarin-android-tools", "NuGet.config") }, - binlogName: "prepare-xat-restore" - ); - } - - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternalGitDependencies.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternalGitDependencies.cs index d625f11a4f5..94ad14a17b1 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternalGitDependencies.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareExternalGitDependencies.cs @@ -24,15 +24,6 @@ protected override async Task Execute (Context context) foreach (ExternalGitDependency egd in externalDependencies) { Log.StatusLine ($" {context.Characters.Bullet} {egd.Name}"); - if (egd.Owner == "mono" && egd.Name == "mono") { - var genFilesStep = new Step_GenerateFiles (false, true); - var monogitPropsFile = genFilesStep.Get_MonoGitHash_props (context); - Log.Status ("Generating "); - Log.Status (Utilities.GetRelativePath (BuildPaths.XamarinAndroidSourceRoot, monogitPropsFile.OutputPath), ConsoleColor.White); - monogitPropsFile.Generate (context); - continue; - } - string destDir = Path.Combine (Configurables.Paths.ExternalGitDepsDestDir, egd.Name); if (!Directory.Exists (destDir)) { var egdUrl = await GetGitHubURL (egd, git); diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.MacOS.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.MacOS.cs deleted file mode 100644 index 3233740cc8c..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.MacOS.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Xamarin.Android.Prepare -{ - partial class Step_PrepareImageDependencies - { - partial void GatherMacPackages (List brewTaps, List brewPackages, List pkgUrls) - { - foreach (Program p in Context.Instance.OS.Dependencies) { - var homebrewProgram = p as HomebrewProgram; - if (homebrewProgram == null) - continue; - - if (!String.IsNullOrEmpty (homebrewProgram.HomebrewTapName)) - brewTaps.Add (homebrewProgram.HomebrewTapName); - - if (homebrewProgram.HomebrewFormulaUrl != null) - brewPackages.Add (homebrewProgram.HomebrewFormulaUrl.ToString ()); - else - brewPackages.Add (homebrewProgram.Name); - } - - pkgUrls.Add (Context.Instance.Properties.GetRequiredValue (KnownProperties.MonoDarwinPackageUrl)); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.cs deleted file mode 100644 index 5bbe324e578..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareImageDependencies.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Threading.Tasks; - -namespace Xamarin.Android.Prepare -{ - partial class Step_PrepareImageDependencies : Step - { - public Step_PrepareImageDependencies () - : base ("Preparing image dependency script") - {} - -#pragma warning disable CS1998 - protected override async Task Execute (Context context) - { - var toolchainDirs = new List { - Path.GetFileName (context.Properties.GetRequiredValue (KnownProperties.AndroidSdkDirectory)), - Path.GetFileName (context.Properties.GetRequiredValue (KnownProperties.AndroidNdkDirectory)), - }; - - var androidToolchain = new AndroidToolchain (); - var androidPackages = new List (); - foreach (AndroidToolchainComponent component in androidToolchain.Components) { - if (component == null) - continue; - - Uri pkgUrl; - if (component.RelativeUrl != null) - pkgUrl = new Uri (AndroidToolchain.AndroidUri, component.RelativeUrl); - else - pkgUrl = AndroidToolchain.AndroidUri; - pkgUrl = new Uri (pkgUrl, $"{component.Name}.zip"); - androidPackages.Add ($"{pkgUrl} {component.DestDir}"); - } - - var brewTaps = new List (); - var brewPackages = new List (); - var pkgUrls = new List (); - - GatherMacPackages (brewTaps, brewPackages, pkgUrls); - - var sb = new StringBuilder (File.ReadAllText (Configurables.Paths.PackageImageDependenciesTemplate)); - sb.Replace ("@TOOLCHAIN_DIRS@", MakeLines (toolchainDirs)); - sb.Replace ("@PACKAGES@", MakeLines (androidPackages)); - sb.Replace ("@BREW_TAPS@", MakeLines (brewTaps)); - sb.Replace ("@BREWS@", MakeLines (brewPackages)); - sb.Replace ("@PKG_URLS@", MakeLines (pkgUrls)); - - string outputFile = Configurables.Paths.PackageImageDependenciesOutput; - Log.StatusLine ($"Generating ", outputFile, tailColor: ConsoleColor.White); - File.WriteAllText (outputFile, sb.ToString ()); - - return Utilities.MakeExecutable (outputFile, throwOnError: false); - - string MakeLines (List list) - { - return String.Join ("\n", list); - } - } -#pragma warning restore CS1998 - - partial void GatherMacPackages (List brewTaps, List brewPackages, List pkgUrls); - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareLocal.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareLocal.cs deleted file mode 100644 index e9ec7ff5f5d..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareLocal.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; - -namespace Xamarin.Android.Prepare -{ - class Step_PrepareLocal : Step - { - public Step_PrepareLocal () - : base ("Preparing local components") - {} - - - protected override async Task Execute(Context context) - { - var msbuild = new MSBuildRunner (context); - string xfTestPath = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "tests", "Xamarin.Forms-Performance-Integration", "Xamarin.Forms.Performance.Integration.csproj"); - - return await msbuild.Restore (projectPath: xfTestPath, logTag: "xfperf", binlogName: "prepare-local"); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareMSBuild.cs b/build-tools/xaprepare/xaprepare/Steps/Step_PrepareMSBuild.cs deleted file mode 100644 index 73b077b3a54..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_PrepareMSBuild.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; - -namespace Xamarin.Android.Prepare -{ - class Step_PrepareMSBuild : Step - { - public Step_PrepareMSBuild () - : base ("Preparing MSbuild") - {} - -#pragma warning disable CS1998 - protected override async Task Execute (Context context) - { - Log.StatusLine (".:! NOT IMPLEMENTED YET !:. (Possibly not needed?)"); - return true; - } -#pragma warning restore CS1998 - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_ShowEnabledRuntimes.cs b/build-tools/xaprepare/xaprepare/Steps/Step_ShowEnabledRuntimes.cs deleted file mode 100644 index 15595002eec..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_ShowEnabledRuntimes.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace Xamarin.Android.Prepare -{ - class Step_ShowEnabledRuntimes : Step - { - public Step_ShowEnabledRuntimes () - : base ("Configured targets") - { - } - - protected override Task Execute (Context context) - { - List enabledRuntimes = MonoRuntimesHelpers.GetEnabledRuntimes (new Runtimes (), enableLogging: true); - if (enabledRuntimes.Count == 0) - Log.StatusLine ("No runtimes to build/install"); - - return Task.FromResult (true); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs index 742a1d38b64..2a549a76210 100644 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs +++ b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs @@ -10,268 +10,73 @@ class mono_External_Dependencies_Group : ThirdPartyNoticeGroup protected override bool ShouldInclude (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; public override List Notices => new List { - new mono_mono_mono_TPN (), new mono_mono_cecil_TPN (), - new mono_mono_boringssl_TPN (), - new mono_mono_ikdasm_TPN (), - new mono_mono_ikvm_fork_TPN (), new mono_mono_linker_TPN (), - new mono_mono_NuGet_BuildTasks_TPN (), - new mono_mono_NUnitLite_TPN (), - new mono_mono_rx_net_TPN (), - new mono_mono_Ix_net_TPN (), - new mono_llvm_Group (), }; } class mono_mono_cecil_TPN : ThirdPartyNotice { static readonly Uri url = new Uri ("https://github.com/mono/cecil/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnPath, "external", "cecil", "LICENSE.txt"); + static readonly string licenseFile = String.Empty; public override string LicenseFile => licenseFile; public override string Name => "mono/cecil"; public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_mono_mono_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnPath, "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/mono"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_mono_aspnetwebstack_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/aspnetwebstack/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnPath, "aspnetwebstack", "License.txt"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/aspnetwebstack"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; - } - - class mono_mono_boringssl_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/boringssl"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "boringssl", "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/boringssl"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } - - class mono_mono_ikdasm_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/ikdasm"); - - public override string LicenseFile => String.Empty; - public override string Name => "mono/ikdasm"; - public override Uri SourceUrl => url; - public override string LicenseText => @" -Copyright (C) 2012 Jeroen Frijters - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - -Jeroen Frijters -jeroen@frijters.net + public override string LicenseText => @"Copyright (c) 2008 - 2015 Jb Evain +Copyright (c) 2008 - 2011 Novell, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +""Software""), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. "; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; - } - - class mono_mono_ikvm_fork_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/ikvm-fork/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "ikvm", "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/ikvm-fork"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; } class mono_mono_linker_TPN : ThirdPartyNotice { static readonly Uri url = new Uri ("https://github.com/mono/linker/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "linker", "LICENSE"); + static readonly string licenseFile = String.Empty; public override string LicenseFile => licenseFile; public override string Name => "mono/linker"; public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_mono_NuGet_BuildTasks_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/NuGet.BuildTasks/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "nuget-buildtasks", "LICENSE.txt"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/NuGet.BuildTasks"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; - } - - class mono_mono_NUnitLite_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/NUnitLite/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "nunit-lite", "NUnitLite-1.0.0", "LICENSE.txt"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/NUnitLite"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } - - class mono_mono_rx_net_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/rx/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "rx", "Rx", "NET", "Source", "license.txt"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/rx.net"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; - } - - class mono_mono_Ix_net_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/rx/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoSdksTpnExternalPath, "rx", "Ix", "NET", "license.txt"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/Ix.net"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; - } - - class mono_llvm_Group : ThirdPartyNoticeGroup - { - protected override bool ShouldInclude (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && (includeBuildDeps || Context.Instance.TargetAotAbisEnabled); - - public override List Notices => new List { - new mono_llvm_llvm_TPN (), - new mono_llvm_google_test_TPN (), - new mono_llvm_openbsd_regex_TPN (), - new mono_llvm_pyyaml_tests_TPN (), - new mono_llvm_arm_contributions_TPN (), - new mono_llvm_md5_contributions_TPN (), - }; - } - - class mono_llvm_llvm_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/llvm/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoLlvmTpnPath, "LICENSE.TXT"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/llvm"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_llvm_google_test_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/llvm/tree/master/utils/unittest/googletest/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoLlvmTpnPath, "utils", "unittest", "googletest", "LICENSE.TXT"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/llvm Google Test"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_llvm_openbsd_regex_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/llvm/tree/master/lib/Support/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoLlvmTpnPath, "lib", "Support", "COPYRIGHT.regex"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/llvm OpenBSD Regex"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_llvm_pyyaml_tests_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/llvm/tree/master/test/YAMLParser/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoLlvmTpnPath, "test", "YAMLParser", "LICENSE.txt"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/llvm pyyaml tests"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_llvm_arm_contributions_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/llvm/tree/master/lib/Target/ARM/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.MonoLlvmTpnPath, "lib", "Target", "ARM", "LICENSE.TXT"); - - public override string LicenseFile => licenseFile; - public override string Name => "mono/llvm ARM contributions"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class mono_llvm_md5_contributions_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/llvm/blob/master/lib/Support/MD5.cpp"); - - public override string LicenseFile => String.Empty; - public override string Name => "mono/llvm md5 contributions"; - public override Uri SourceUrl => url; + public override string LicenseText => @"The MIT License (MIT) +Copyright (c) .NET Foundation and Contributors - public override string LicenseText => @" - This software was written by Alexander Peslyak in 2001. No copyright is - claimed, and the software is hereby placed in the public domain. - In case this attempt to disclaim copyright and place the software in the - public domain is deemed null and void, then the software is - Copyright (c) 2001 Alexander Peslyak and it is hereby released to the - general public under the following terms: +All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the ""Software""), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - There's ABSOLUTELY NO WARRANTY, express or implied. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - (This is a heavily cut-down ""BSD license"".) +THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. "; } } diff --git a/build-tools/xaprepare/xaprepare/xaprepare.csproj b/build-tools/xaprepare/xaprepare/xaprepare.csproj index 6730c7adae9..41766677fdd 100644 --- a/build-tools/xaprepare/xaprepare/xaprepare.csproj +++ b/build-tools/xaprepare/xaprepare/xaprepare.csproj @@ -12,10 +12,6 @@ - - - - diff --git a/build-tools/xaprepare/xaprepare/xaprepare.targets b/build-tools/xaprepare/xaprepare/xaprepare.targets index 02cdecfbcb3..1afe7e363b1 100644 --- a/build-tools/xaprepare/xaprepare/xaprepare.targets +++ b/build-tools/xaprepare/xaprepare/xaprepare.targets @@ -47,7 +47,6 @@ - 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 952030ba291..f9b06ecc8aa 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -187,7 +187,7 @@ + Replacements="@JAVA_INTEROP_COMMIT@=$(_BuildInfo_JavaInteropCommit);@SQLITE_COMMIT@=$(_BuildInfo_SqliteCommit);@XAMARIN_ANDROID_TOOLS_COMMIT@=$(_BuildInfo_XamarinAndroidToolsCommit);">