diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs index 024b181fc66..835a6d3d57f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs @@ -101,8 +101,6 @@ public class BuildApk : AndroidTask public string RuntimeConfigBinFilePath { get; set; } - public bool UseAssemblyStore { get; set; } - public string ZipFlushFilesLimit { get; set; } public string ZipFlushSizeLimit { get; set; } @@ -423,13 +421,8 @@ void AddRuntimeConfigBlob (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchi void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk, bool debug, bool compress, IDictionary> compressedAssembliesInfo, string assemblyStoreApkName) { string sourcePath; - AssemblyCompression.AssemblyData compressedAssembly = null; string compressedOutputDir = Path.GetFullPath (Path.Combine (Path.GetDirectoryName (ApkOutputPath), "..", "lz4")); - AssemblyStoreBuilder? storeBuilder = null; - - if (UseAssemblyStore) { - storeBuilder = new AssemblyStoreBuilder (Log); - } + var storeBuilder = new AssemblyStoreBuilder (Log); // Add user assemblies AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedUserAssemblies, DoAddAssembliesFromArchCollection); @@ -437,10 +430,6 @@ void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx ap // Add framework assemblies AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedFrameworkAssemblies, DoAddAssembliesFromArchCollection); - if (!UseAssemblyStore) { - return; - } - Dictionary assemblyStorePaths = storeBuilder.Generate (AppSharedLibrariesDir); if (assemblyStorePaths.Count == 0) { @@ -467,46 +456,7 @@ void DoAddAssembliesFromArchCollection (TaskLoggingHelper log, AndroidTargetArch // Thus, we no longer just store them in the apk but we call the `GetCompressionMethod` method to find out whether // or not we're supposed to compress .so files. sourcePath = CompressAssembly (assembly); - if (UseAssemblyStore) { - storeBuilder.AddAssembly (sourcePath, assembly, includeDebugSymbols: debug); - return; - } - - // Add assembly - (string assemblyPath, string assemblyDirectory) = GetInArchiveAssemblyPath (assembly); - string wrappedSourcePath = DSOWrapperGenerator.WrapIt (Log, dsoWrapperConfig, arch, sourcePath, Path.GetFileName (assemblyPath)); - AddFileToArchiveIfNewer (apk, wrappedSourcePath, assemblyPath, compressionMethod: GetCompressionMethod (assemblyPath)); - - // Try to add config if exists - var config = Path.ChangeExtension (assembly.ItemSpec, "dll.config"); - AddAssemblyConfigEntry (dsoWrapperConfig, apk, arch, assemblyDirectory, config); - - // Try to add symbols if Debug - if (!debug) { - return; - } - - string symbols = Path.ChangeExtension (assembly.ItemSpec, "pdb"); - if (!File.Exists (symbols)) { - return; - } - - string archiveSymbolsPath = assemblyDirectory + MonoAndroidHelper.MakeDiscreteAssembliesEntryName (Path.GetFileName (symbols)); - string wrappedSymbolsPath = DSOWrapperGenerator.WrapIt (Log, dsoWrapperConfig, arch, symbols, Path.GetFileName (archiveSymbolsPath)); - AddFileToArchiveIfNewer ( - apk, - wrappedSymbolsPath, - archiveSymbolsPath, - compressionMethod: GetCompressionMethod (archiveSymbolsPath) - ); - } - - void EnsureCompressedAssemblyData (string sourcePath, uint descriptorIndex) - { - if (compressedAssembly == null) - compressedAssembly = new AssemblyCompression.AssemblyData (sourcePath, descriptorIndex); - else - compressedAssembly.SetData (sourcePath, descriptorIndex); + storeBuilder.AddAssembly (sourcePath, assembly, includeDebugSymbols: debug); } string CompressAssembly (ITaskItem assembly) diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs index c0f7f0432ce..0d5c098a6fd 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs @@ -35,8 +35,6 @@ public class GeneratePackageManagerJava : AndroidTask public ITaskItem[] SatelliteAssemblies { get; set; } - public bool UseAssemblyStore { get; set; } - [Required] public string OutputDirectory { get; set; } @@ -76,6 +74,7 @@ public class GeneratePackageManagerJava : AndroidTask public string AndroidSequencePointsMode { get; set; } public bool EnableSGenConcurrent { get; set; } public string? CustomBundleConfigFile { get; set; } + public bool FastDevEnabled { get; set; } bool _Debug { get { @@ -204,21 +203,7 @@ void AddEnvironment () throw new InvalidOperationException ($"Unsupported BoundExceptionType value '{BoundExceptionType}'"); } - int assemblyNameWidth = 0; Encoding assemblyNameEncoding = Encoding.UTF8; - - Action updateNameWidth = (ITaskItem assembly) => { - if (UseAssemblyStore) { - return; - } - - string assemblyName = Path.GetFileName (assembly.ItemSpec); - int nameBytes = assemblyNameEncoding.GetBytes (assemblyName).Length; - if (nameBytes > assemblyNameWidth) { - assemblyNameWidth = nameBytes; - } - }; - int assemblyCount = 0; bool enableMarshalMethods = EnableMarshalMethods; HashSet archAssemblyNames = null; @@ -249,7 +234,6 @@ void AddEnvironment () if (SatelliteAssemblies != null) { foreach (ITaskItem assembly in SatelliteAssemblies) { - updateNameWidth (assembly); updateAssemblyCount (assembly); } } @@ -258,7 +242,6 @@ void AddEnvironment () int jnienv_initialize_method_token = -1; int jnienv_registerjninatives_method_token = -1; foreach (var assembly in ResolvedAssemblies) { - updateNameWidth (assembly); updateAssemblyCount (assembly); if (android_runtime_jnienv_class_token != -1) { @@ -272,17 +255,6 @@ void AddEnvironment () GetRequiredTokens (assembly.ItemSpec, out android_runtime_jnienv_class_token, out jnienv_initialize_method_token, out jnienv_registerjninatives_method_token); } - if (!UseAssemblyStore) { - int abiNameLength = 0; - foreach (string abi in SupportedAbis) { - if (abi.Length <= abiNameLength) { - continue; - } - abiNameLength = abi.Length; - } - assemblyNameWidth += abiNameLength + 2; // room for '/' and the terminating NUL - } - MonoComponent monoComponents = MonoComponent.None; if (MonoComponents != null && MonoComponents.Length > 0) { foreach (ITaskItem item in MonoComponents) { @@ -334,10 +306,8 @@ void AddEnvironment () JniAddNativeMethodRegistrationAttributePresent = NativeCodeGenState.TemplateJniAddNativeMethodRegistrationAttributePresent, HaveRuntimeConfigBlob = haveRuntimeConfigBlob, NumberOfAssembliesInApk = assemblyCount, - BundledAssemblyNameWidth = assemblyNameWidth, MonoComponents = (MonoComponent)monoComponents, NativeLibraries = uniqueNativeLibraries, - HaveAssemblyStore = UseAssemblyStore, AndroidRuntimeJNIEnvToken = android_runtime_jnienv_class_token, JNIEnvInitializeToken = jnienv_initialize_method_token, JNIEnvRegisterJniNativesToken = jnienv_registerjninatives_method_token, @@ -345,6 +315,7 @@ void AddEnvironment () JniRemappingReplacementMethodIndexEntryCount = jniRemappingNativeCodeInfo == null ? 0 : jniRemappingNativeCodeInfo.ReplacementMethodIndexEntryCount, MarshalMethodsEnabled = EnableMarshalMethods, IgnoreSplitConfigs = ShouldIgnoreSplitConfigs (), + FastDevEnabled = FastDevEnabled, }; LLVMIR.LlvmIrModule appConfigModule = appConfigAsmGen.Construct (); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs index 5a135444ca7..ca698cf584a 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs @@ -137,34 +137,30 @@ public void BuildAotApplicationWithSpecialCharactersInProject (string testName, new object[] { /* supportedAbis */ "arm64-v8a", /* enableLLVM */ false, - /* usesAssemblyBlobs */ false, }, new object[] { /* supportedAbis */ "armeabi-v7a;x86", /* enableLLVM */ true, - /* usesAssemblyBlobs */ true, }, new object[] { /* supportedAbis */ "armeabi-v7a;arm64-v8a;x86;x86_64", /* enableLLVM */ false, - /* usesAssemblyBlobs */ true, }, new object[] { /* supportedAbis */ "armeabi-v7a;arm64-v8a;x86;x86_64", /* enableLLVM */ true, - /* usesAssemblyBlobs */ false, }, }; [Test] [TestCaseSource (nameof (AotChecks))] - public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAbis, bool enableLLVM, bool usesAssemblyBlobs) + public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAbis, bool enableLLVM) { if (IsWindows) Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625"); var abisSanitized = supportedAbis.Replace (";", "").Replace ("-", "").Replace ("_", ""); - var path = Path.Combine ("temp", string.Format ("BuildAotNdk AndÜmläüts_{0}_{1}_{2}", abisSanitized, enableLLVM, usesAssemblyBlobs)); + var path = Path.Combine ("temp", string.Format ("BuildAotNdk AndÜmläüts_{0}_{1}", abisSanitized, enableLLVM)); var proj = new XamarinAndroidApplicationProject () { IsRelease = true, AotAssemblies = true, @@ -174,7 +170,6 @@ public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAb proj.SetProperty ("AndroidNdkDirectory", AndroidNdkPath); proj.SetRuntimeIdentifiers (supportedAbis.Split (';')); proj.SetProperty ("EnableLLVM", enableLLVM.ToString ()); - proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyBlobs.ToString ()); bool checkMinLlvmPath = enableLLVM && (supportedAbis == "armeabi-v7a" || supportedAbis == "x86"); if (checkMinLlvmPath) { // Set //uses-sdk/@android:minSdkVersion so that LLVM uses the right libc.so @@ -195,7 +190,7 @@ public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAb var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - var helper = new ArchiveAssemblyHelper (apk, usesAssemblyBlobs); + var helper = new ArchiveAssemblyHelper (apk); Assert.IsTrue (helper.Exists ($"assemblies/{abi}/UnnamedProject.dll"), $"{abi}/UnnamedProject.dll should be in {proj.PackageName}-Signed.apk"); using (var zipFile = ZipHelper.OpenZip (apk)) { Assert.IsNotNull (ZipHelper.ReadFileFromZip (zipFile, @@ -215,13 +210,13 @@ public void BuildAotApplicationWithNdkAndBundleAndÜmläüts (string supportedAb [Test] [TestCaseSource (nameof (AotChecks))] - public void BuildAotApplicationAndÜmläüts (string supportedAbis, bool enableLLVM, bool usesAssemblyBlobs) + public void BuildAotApplicationAndÜmläüts (string supportedAbis, bool enableLLVM) { if (IsWindows) Assert.Ignore ("https://github.com/dotnet/runtime/issues/88625"); var abisSanitized = supportedAbis.Replace (";", "").Replace ("-", "").Replace ("_", ""); - var path = Path.Combine ("temp", string.Format ("BuildAot AndÜmläüts_{0}_{1}_{2}", abisSanitized, enableLLVM, usesAssemblyBlobs)); + var path = Path.Combine ("temp", string.Format ("BuildAot AndÜmläüts_{0}_{1}", abisSanitized, enableLLVM)); var proj = new XamarinAndroidApplicationProject () { IsRelease = true, AotAssemblies = true, @@ -229,7 +224,6 @@ public void BuildAotApplicationAndÜmläüts (string supportedAbis, bool enableL }; proj.SetRuntimeIdentifiers (supportedAbis.Split (';')); proj.SetProperty ("EnableLLVM", enableLLVM.ToString ()); - proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyBlobs.ToString ()); using (var b = CreateApkBuilder (path)) { b.ThrowOnBuildFailure = false; Assert.IsTrue (b.Build (proj), "Build should have succeeded."); @@ -240,7 +234,7 @@ public void BuildAotApplicationAndÜmläüts (string supportedAbis, bool enableL var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - var helper = new ArchiveAssemblyHelper (apk, usesAssemblyBlobs); + var helper = new ArchiveAssemblyHelper (apk); Assert.IsTrue (helper.Exists ($"assemblies/{abi}/UnnamedProject.dll"), $"{abi}/UnnamedProject.dll should be in {proj.PackageName}-Signed.apk"); using (var zipFile = ZipHelper.OpenZip (apk)) { Assert.IsNotNull (ZipHelper.ReadFileFromZip (zipFile, diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs index f30f2f2388d..40b233b3a59 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs @@ -16,97 +16,81 @@ public partial class BuildTest : BaseTest /* runtimeIdentifiers */ "android-arm", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ true, }, new object [] { /* runtimeIdentifiers */ "android-arm64", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-x86", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-x64", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ false, - /* usesAssemblyStore */ true, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ true, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm", /* isRelease */ true, /* aot */ true, - /* usesAssemblyStore */ true, }, new object [] { /* runtimeIdentifiers */ "android-arm64", /* isRelease */ true, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ false, /* aot */ false, - /* usesAssemblyStore */ true, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86", /* isRelease */ true, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ true, /* aot */ false, - /* usesAssemblyStore */ false, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ true, /* aot */ false, - /* usesAssemblyStore */ true, }, new object [] { /* runtimeIdentifiers */ "android-arm;android-arm64;android-x86;android-x64", /* isRelease */ true, /* aot */ true, - /* usesAssemblyStore */ false, }, }; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 8cc76792220..d324c02f5e3 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -26,7 +26,7 @@ public partial class BuildTest : BaseTest [Category ("SmokeTests")] [TestCaseSource (nameof (DotNetBuildSource))] [NonParallelizable] // On MacOS, parallel /restore causes issues - public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bool usesAssemblyStore) + public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot) { var proj = new XamarinAndroidApplicationProject { IsRelease = isRelease, @@ -66,7 +66,6 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo }; proj.MainActivity = proj.DefaultMainActivity.Replace (": Activity", ": AndroidX.AppCompat.App.AppCompatActivity") .Replace ("//${AFTER_ONCREATE}", @"button.Text = Resource.CancelButton;"); - proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyStore.ToString ()); proj.SetProperty ("RunAOTCompilation", aot.ToString ()); proj.OtherBuildItems.Add (new AndroidItem.InputJar ("javaclasses.jar") { BinaryContent = () => ResourceData.JavaSourceJarTestJar, @@ -162,7 +161,7 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo bool expectEmbeddedAssembies = !(TestEnvironment.CommercialBuildAvailable && !isRelease); var apkPath = Path.Combine (outputPath, $"{proj.PackageName}-Signed.apk"); FileAssert.Exists (apkPath); - var helper = new ArchiveAssemblyHelper (apkPath, usesAssemblyStore, rids); + var helper = new ArchiveAssemblyHelper (apkPath, rids); helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.dll", shouldContainEntry: expectEmbeddedAssembies); helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.pdb", shouldContainEntry: !TestEnvironment.CommercialBuildAvailable && !isRelease); helper.AssertContainsEntry ($"assemblies/Mono.Android.dll", shouldContainEntry: expectEmbeddedAssembies); @@ -267,7 +266,6 @@ public void CheckAssemblyCounts (bool isRelease, bool aot) var abis = new [] { "armeabi-v7a", "x86" }; proj.SetRuntimeIdentifiers (abis); - proj.SetProperty (proj.ActiveConfigurationProperties, "AndroidUseAssemblyStore", "True"); using (var b = CreateApkBuilder ()) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); @@ -284,7 +282,7 @@ public void CheckAssemblyCounts (bool isRelease, bool aot) } string apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - var helper = new ArchiveAssemblyHelper (apk, useAssemblyStores: true); + var helper = new ArchiveAssemblyHelper (apk); foreach (string abi in abis) { AndroidTargetArch arch = MonoAndroidHelper.AbiToTargetArch (abi); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 058269ceaa4..b11f4e11da7 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -154,7 +154,6 @@ public void BuildReleaseArm64 ([Values (false, true)] bool forms) proj.AotAssemblies = false; // Release defaults to Profiled AOT for .NET 6 proj.SetAndroidSupportedAbis ("arm64-v8a"); proj.SetProperty ("LinkerDumpDependencies", "True"); - proj.SetProperty ("AndroidUseAssemblyStore", "False"); var flavor = (forms ? "XForms" : "Simple") + "DotNet"; var apkDescFilename = $"BuildReleaseArm64{flavor}.apkdesc"; @@ -319,7 +318,7 @@ public void XA1037PropertyDeprecatedWarning (string property, string value, bool XamarinAndroidProject proj = isBindingProject ? new XamarinAndroidBindingProject () : new XamarinAndroidApplicationProject (); proj.IsRelease = isRelease; proj.SetProperty (property, value); - + using (ProjectBuilder b = isBindingProject ? CreateDllBuilder (Path.Combine ("temp", TestName)) : CreateApkBuilder (Path.Combine ("temp", TestName))) { Assert.IsTrue (b.Build (proj), "Build should have succeeded."); Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, $"The '{property}' MSBuild property is deprecated and will be removed"), @@ -1369,7 +1368,7 @@ public Class2 () }; string apkPath = Path.Combine (outputPath, proj.PackageName + "-Signed.apk"); - var helper = new ArchiveAssemblyHelper (apkPath, useAssemblyStores: false, proj.GetRuntimeIdentifiers ().ToArray ()); + var helper = new ArchiveAssemblyHelper (apkPath, proj.GetRuntimeIdentifiers ().ToArray ()); foreach (string abi in proj.GetRuntimeIdentifiersAsAbis ()) { foreach ((string fileName, bool existsInBin) in fileNames) { EnsureFilesAreTheSame (intermediate, existsInBin ? outputPath : null, fileName, abi, helper, uncompressIfNecessary: fileName.EndsWith (".dll", StringComparison.Ordinal)); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs index f9394a98ca1..6fceb9c370f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs @@ -66,14 +66,13 @@ public void CheckDebugModeWithTrimming () EmbedAssembliesIntoApk = true, }; proj.SetProperty ("PublishTrimmed", "true"); - proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyStores.ToString ()); using var b = CreateApkBuilder (); Assert.IsTrue (b.Build (proj), "build should have succeeded."); var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - var helper = new ArchiveAssemblyHelper (apk, usesAssemblyStores); + var helper = new ArchiveAssemblyHelper (apk); helper.Contains (["Mono.Android.dll", $"{proj.ProjectName}.dll"], out _, out var missingFiles, out _, [AndroidTargetArch.Arm64, AndroidTargetArch.X86_64]); Assert.IsTrue (missingFiles == null || missingFiles.Count == 0, @@ -83,7 +82,7 @@ public void CheckDebugModeWithTrimming () [Test] [NonParallelizable] // Commonly fails NuGet restore - public void CheckIncludedAssemblies ([Values (false, true)] bool usesAssemblyStores) + public void CheckIncludedAssemblies () { var proj = new XamarinAndroidApplicationProject { IsRelease = true @@ -93,7 +92,6 @@ public void CheckIncludedAssemblies ([Values (false, true)] bool usesAssemblySto AndroidTargetArch.Arm, }; - proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyStores.ToString ()); proj.SetRuntimeIdentifiers (supportedArches); proj.PackageReferences.Add (new Package { Id = "Humanizer.Core", @@ -136,7 +134,7 @@ public void CheckIncludedAssemblies ([Values (false, true)] bool usesAssemblySto Assert.IsTrue (b.Build (proj), "build should have succeeded."); var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - var helper = new ArchiveAssemblyHelper (apk, usesAssemblyStores); + var helper = new ArchiveAssemblyHelper (apk); List existingFiles; List missingFiles; List additionalFiles; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs index 17af700809a..82ba16d8661 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs @@ -261,21 +261,20 @@ public void WarnAboutAppDomains ([Values (true, false)] bool isRelease) } [Test] - public void RemoveDesigner ([Values (true, false)] bool useAssemblyStore) + public void RemoveDesigner () { var proj = new XamarinAndroidApplicationProject { IsRelease = true, }; proj.SetProperty ("AndroidEnableAssemblyCompression", "False"); proj.SetProperty ("AndroidLinkResources", "True"); - proj.SetProperty ("AndroidUseAssemblyStore", useAssemblyStore.ToString ()); string assemblyName = proj.ProjectName; using var b = CreateApkBuilder (); Assert.IsTrue (b.Build (proj), "build should have succeeded."); var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); FileAssert.Exists (apk); - var helper = new ArchiveAssemblyHelper (apk, useAssemblyStore); + var helper = new ArchiveAssemblyHelper (apk); foreach (string abi in proj.GetRuntimeIdentifiersAsAbis ()) { Assert.IsTrue (helper.Exists ($"assemblies/{abi}/{assemblyName}.dll"), $"{assemblyName}.dll should exist in apk!"); @@ -297,7 +296,7 @@ public void RemoveDesigner ([Values (true, false)] bool useAssemblyStore) } [Test] - public void LinkDescription ([Values (true, false)] bool useAssemblyStore) + public void LinkDescription () { string assembly_name = "System.Console"; string linker_xml = ""; @@ -312,7 +311,6 @@ public void LinkDescription ([Values (true, false)] bool useAssemblyStore) }; // So we can use Mono.Cecil to open assemblies directly proj.SetProperty ("AndroidEnableAssemblyCompression", "False"); - proj.SetProperty ("AndroidUseAssemblyStore", useAssemblyStore.ToString ()); using (var b = CreateApkBuilder ()) { Assert.IsTrue (b.Build (proj), "first build should have succeeded."); @@ -331,7 +329,7 @@ public void LinkDescription ([Values (true, false)] bool useAssemblyStore) var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); FileAssert.Exists (apk); - var helper = new ArchiveAssemblyHelper (apk, useAssemblyStore); + var helper = new ArchiveAssemblyHelper (apk); foreach (string abi in proj.GetRuntimeIdentifiersAsAbis ()) { Assert.IsTrue (helper.Exists ($"assemblies/{abi}/{assembly_name}.dll"), $"{assembly_name}.dll should exist in apk!"); } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs index 59b2b4e6fca..245979d3965 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/ArchiveAssemblyHelper.cs @@ -27,20 +27,18 @@ public class ArchiveAssemblyHelper readonly string archivePath; readonly string assembliesRootDir; - bool useAssemblyStores; bool haveMultipleRids; List archiveContents; public string ArchivePath => archivePath; - public ArchiveAssemblyHelper (string archivePath, bool useAssemblyStores = true, string[] rids = null) + public ArchiveAssemblyHelper (string archivePath, string[] rids = null) { if (String.IsNullOrEmpty (archivePath)) { throw new ArgumentException ("must not be null or empty", nameof (archivePath)); } this.archivePath = archivePath; - this.useAssemblyStores = useAssemblyStores; haveMultipleRids = rids != null && rids.Length > 1; string extension = Path.GetExtension (archivePath) ?? String.Empty; @@ -57,13 +55,7 @@ public ArchiveAssemblyHelper (string archivePath, bool useAssemblyStores = true, public Stream? ReadEntry (string path, AndroidTargetArch arch = AndroidTargetArch.None, bool uncompressIfNecessary = false) { - Stream? ret; - if (useAssemblyStores) { - ret = ReadStoreEntry (path, arch, uncompressIfNecessary); - } else { - ret = ReadZipEntry (path, arch, uncompressIfNecessary); - } - + Stream? ret = ReadStoreEntry (path, arch, uncompressIfNecessary); if (ret == null) { return null; } @@ -117,29 +109,6 @@ public ArchiveAssemblyHelper (string archivePath, bool useAssemblyStores = true, return payload; } - Stream? ReadZipEntry (string path, AndroidTargetArch arch, bool uncompressIfNecessary) - { - List? potentialEntries = TransformArchiveAssemblyPath (path, arch); - if (potentialEntries == null || potentialEntries.Count == 0) { - return null; - } - - using var zip = ZipHelper.OpenZip (archivePath); - foreach (string assemblyPath in potentialEntries) { - if (!zip.ContainsEntry (assemblyPath)) { - continue; - } - - ZipEntry entry = zip.ReadEntry (assemblyPath); - var ret = new MemoryStream (); - entry.Extract (ret); - ret.Flush (); - return ret; - } - - return null; - } - Stream? ReadStoreEntry (string path, AndroidTargetArch arch, bool uncompressIfNecessary) { string name = Path.GetFileNameWithoutExtension (path); @@ -199,11 +168,6 @@ public List ListArchiveContents (string storeEntryPrefix = DefaultAssemb } archiveContents = entries; - if (!useAssemblyStores) { - Console.WriteLine ("Not using assembly stores"); - return entries; - } - Console.WriteLine ($"Creating AssemblyStoreExplorer for archive '{archivePath}'"); (IList? explorers, string? errorMessage) = AssemblyStoreExplorer.Open (archivePath); @@ -448,11 +412,7 @@ public void Contains (ICollection fileNames, out List existingFi throw new ArgumentException ("must not be empty", nameof (fileNames)); } - if (useAssemblyStores) { - StoreContains (fileNames, out existingFiles, out missingFiles, out additionalFiles, targetArches); - } else { - ArchiveContains (fileNames, out existingFiles, out missingFiles, out additionalFiles, targetArches); - } + StoreContains (fileNames, out existingFiles, out missingFiles, out additionalFiles, targetArches); } List GetSupportedArches (IEnumerable? runtimeIdentifiers) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs index 075f0154f98..7069d8f60e2 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs @@ -46,7 +46,7 @@ public sealed class ApplicationConfig public bool broken_exception_transitions; public bool jni_add_native_method_registration_attribute_present; public bool have_runtime_config_blob; - public bool have_assemblies_blob; + public bool fastdev_enabled; public bool marshal_methods_enabled; public bool ignore_split_configs; public byte bound_stream_io_exception_type; @@ -54,7 +54,6 @@ public sealed class ApplicationConfig public uint environment_variable_count; public uint system_property_count; public uint number_of_assemblies_in_apk; - public uint bundled_assembly_name_width; public uint number_of_assembly_store_files; public uint number_of_dso_cache_entries; public uint number_of_aot_cache_entries; @@ -67,7 +66,7 @@ public sealed class ApplicationConfig public string android_package_name = String.Empty; } - const uint ApplicationConfigFieldCount = 26; + const uint ApplicationConfigFieldCount = 25; const string ApplicationConfigSymbolName = "application_config"; const string AppEnvironmentVariablesSymbolName = "app_environment_variables"; @@ -241,9 +240,9 @@ static ApplicationConfig ReadApplicationConfig (EnvironmentFile envFile) ret.have_runtime_config_blob = ConvertFieldToBool ("have_runtime_config_blob", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 7: // have_assemblies_blob: bool / .byte + case 7: // fastdev_enabled: bool / .byte AssertFieldType (envFile.Path, parser.SourceFilePath, ".byte", field [0], item.LineNumber); - ret.have_assemblies_blob = ConvertFieldToBool ("have_assemblies_blob", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); + ret.fastdev_enabled = ConvertFieldToBool ("fastdev_enabled", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; case 8: // marshal_methods_enabled: bool / .byte @@ -281,57 +280,52 @@ static ApplicationConfig ReadApplicationConfig (EnvironmentFile envFile) ret.number_of_assemblies_in_apk = ConvertFieldToUInt32 ("number_of_assemblies_in_apk", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 15: // bundled_assembly_name_width: uint32_t / .word | .long - Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); - ret.bundled_assembly_name_width = ConvertFieldToUInt32 ("bundled_assembly_name_width", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); - break; - - case 16: // number_of_assembly_store_files: uint32_t / .word | .long + case 15: // number_of_assembly_store_files: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.number_of_assembly_store_files = ConvertFieldToUInt32 ("number_of_assembly_store_files", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 17: // number_of_dso_cache_entries: uint32_t / .word | .long + case 16: // number_of_dso_cache_entries: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.number_of_dso_cache_entries = ConvertFieldToUInt32 ("number_of_dso_cache_entries", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 18: // number_of_aot_cache_entries: uint32_t / .word | .long + case 17: // number_of_aot_cache_entries: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.number_of_aot_cache_entries = ConvertFieldToUInt32 ("number_of_aot_cache_entries", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 19: // android_runtime_jnienv_class_token: uint32_t / .word | .long + case 18: // android_runtime_jnienv_class_token: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.android_runtime_jnienv_class_token = ConvertFieldToUInt32 ("android_runtime_jnienv_class_token", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 20: // jnienv_initialize_method_token: uint32_t / .word | .long + case 19: // jnienv_initialize_method_token: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.jnienv_initialize_method_token = ConvertFieldToUInt32 ("jnienv_initialize_method_token", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 21: // jnienv_registerjninatives_method_token: uint32_t / .word | .long + case 20: // jnienv_registerjninatives_method_token: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.jnienv_registerjninatives_method_token = ConvertFieldToUInt32 ("jnienv_registerjninatives_method_token", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 22: // jni_remapping_replacement_type_count: uint32_t / .word | .long + case 21: // jni_remapping_replacement_type_count: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.jni_remapping_replacement_type_count = ConvertFieldToUInt32 ("jni_remapping_replacement_type_count", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 23: // jni_remapping_replacement_method_index_entry_count: uint32_t / .word | .long + case 22: // jni_remapping_replacement_method_index_entry_count: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.jni_remapping_replacement_method_index_entry_count = ConvertFieldToUInt32 ("jni_remapping_replacement_method_index_entry_count", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 24: // mono_components_mask: uint32_t / .word | .long + case 23: // mono_components_mask: uint32_t / .word | .long Assert.IsTrue (expectedUInt32Types.Contains (field [0]), $"Unexpected uint32_t field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); ret.mono_components_mask = ConvertFieldToUInt32 ("mono_components_mask", envFile.Path, parser.SourceFilePath, item.LineNumber, field [1]); break; - case 25: // android_package_name: string / [pointer type] + case 24: // android_package_name: string / [pointer type] Assert.IsTrue (expectedPointerTypes.Contains (field [0]), $"Unexpected pointer field type in '{envFile.Path}:{item.LineNumber}': {field [0]}"); pointers.Add (field [1].Trim ()); break; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc index 7245c6f39a5..6adb8681167 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64SimpleDotNet.apkdesc @@ -5,49 +5,22 @@ "Size": 3036 }, "classes.dex": { - "Size": 389672 - }, - "lib/arm64-v8a/lib__Microsoft.Android.Resource.Designer.dll.so": { - "Size": 18208 - }, - "lib/arm64-v8a/lib_Java.Interop.dll.so": { - "Size": 86256 - }, - "lib/arm64-v8a/lib_Mono.Android.dll.so": { - "Size": 115344 - }, - "lib/arm64-v8a/lib_Mono.Android.Runtime.dll.so": { - "Size": 22400 - }, - "lib/arm64-v8a/lib_System.Console.dll.so": { - "Size": 24384 - }, - "lib/arm64-v8a/lib_System.Linq.dll.so": { - "Size": 26480 - }, - "lib/arm64-v8a/lib_System.Private.CoreLib.dll.so": { - "Size": 633920 - }, - "lib/arm64-v8a/lib_System.Runtime.dll.so": { - "Size": 20048 - }, - "lib/arm64-v8a/lib_System.Runtime.InteropServices.dll.so": { - "Size": 21592 - }, - "lib/arm64-v8a/lib_UnnamedProject.dll.so": { - "Size": 20024 + "Size": 389636 }, "lib/arm64-v8a/libarc.bin.so": { "Size": 18776 }, + "lib/arm64-v8a/libassemblies.arm64-v8a.blob.so": { + "Size": 836792 + }, "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { "Size": 87432 }, "lib/arm64-v8a/libmonodroid.so": { - "Size": 485400 + "Size": 456888 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3196336 + "Size": 3196512 }, "lib/arm64-v8a/libSystem.Globalization.Native.so": { "Size": 67248 @@ -62,16 +35,16 @@ "Size": 160232 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 12648 + "Size": 11984 }, "META-INF/BNDLTOOL.RSA": { "Size": 1223 }, "META-INF/BNDLTOOL.SF": { - "Size": 3266 + "Size": 2228 }, "META-INF/MANIFEST.MF": { - "Size": 3139 + "Size": 2101 }, "res/drawable-hdpi-v4/icon.png": { "Size": 2178 @@ -98,5 +71,5 @@ "Size": 1904 } }, - "PackageSize": 2865685 + "PackageSize": 2840305 } \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc index 3fdac7611d2..26c6761af39 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc @@ -5,7 +5,7 @@ "Size": 6652 }, "classes.dex": { - "Size": 9448924 + "Size": 9448884 }, "classes2.dex": { "Size": 154180 @@ -31,227 +31,20 @@ "kotlin/reflect/reflect.kotlin_builtins": { "Size": 2396 }, - "lib/arm64-v8a/lib__Microsoft.Android.Resource.Designer.dll.so": { - "Size": 19456 - }, - "lib/arm64-v8a/lib_FormsViewGroup.dll.so": { - "Size": 25184 - }, - "lib/arm64-v8a/lib_Java.Interop.dll.so": { - "Size": 94640 - }, - "lib/arm64-v8a/lib_Mono.Android.dll.so": { - "Size": 521824 - }, - "lib/arm64-v8a/lib_Mono.Android.Runtime.dll.so": { - "Size": 22400 - }, - "lib/arm64-v8a/lib_mscorlib.dll.so": { - "Size": 21440 - }, - "lib/arm64-v8a/lib_netstandard.dll.so": { - "Size": 23080 - }, - "lib/arm64-v8a/lib_System.Collections.Concurrent.dll.so": { - "Size": 29800 - }, - "lib/arm64-v8a/lib_System.Collections.dll.so": { - "Size": 36288 - }, - "lib/arm64-v8a/lib_System.Collections.NonGeneric.dll.so": { - "Size": 25760 - }, - "lib/arm64-v8a/lib_System.Collections.Specialized.dll.so": { - "Size": 23848 - }, - "lib/arm64-v8a/lib_System.ComponentModel.dll.so": { - "Size": 19584 - }, - "lib/arm64-v8a/lib_System.ComponentModel.Primitives.dll.so": { - "Size": 21296 - }, - "lib/arm64-v8a/lib_System.ComponentModel.TypeConverter.dll.so": { - "Size": 42448 - }, - "lib/arm64-v8a/lib_System.Console.dll.so": { - "Size": 24416 - }, - "lib/arm64-v8a/lib_System.Core.dll.so": { - "Size": 19456 - }, - "lib/arm64-v8a/lib_System.Diagnostics.DiagnosticSource.dll.so": { - "Size": 28440 - }, - "lib/arm64-v8a/lib_System.Diagnostics.TraceSource.dll.so": { - "Size": 24688 - }, - "lib/arm64-v8a/lib_System.dll.so": { - "Size": 19856 - }, - "lib/arm64-v8a/lib_System.Drawing.dll.so": { - "Size": 19432 - }, - "lib/arm64-v8a/lib_System.Drawing.Primitives.dll.so": { - "Size": 30048 - }, - "lib/arm64-v8a/lib_System.Formats.Asn1.dll.so": { - "Size": 49936 - }, - "lib/arm64-v8a/lib_System.IO.Compression.Brotli.dll.so": { - "Size": 29480 - }, - "lib/arm64-v8a/lib_System.IO.Compression.dll.so": { - "Size": 33784 - }, - "lib/arm64-v8a/lib_System.IO.IsolatedStorage.dll.so": { - "Size": 28288 - }, - "lib/arm64-v8a/lib_System.Linq.dll.so": { - "Size": 38736 - }, - "lib/arm64-v8a/lib_System.Linq.Expressions.dll.so": { - "Size": 185808 - }, - "lib/arm64-v8a/lib_System.Net.Http.dll.so": { - "Size": 89496 - }, - "lib/arm64-v8a/lib_System.Net.Primitives.dll.so": { - "Size": 41120 - }, - "lib/arm64-v8a/lib_System.Net.Requests.dll.so": { - "Size": 21552 - }, - "lib/arm64-v8a/lib_System.ObjectModel.dll.so": { - "Size": 27072 - }, - "lib/arm64-v8a/lib_System.Private.CoreLib.dll.so": { - "Size": 956408 - }, - "lib/arm64-v8a/lib_System.Private.DataContractSerialization.dll.so": { - "Size": 216688 - }, - "lib/arm64-v8a/lib_System.Private.Uri.dll.so": { - "Size": 62192 - }, - "lib/arm64-v8a/lib_System.Private.Xml.dll.so": { - "Size": 237104 - }, - "lib/arm64-v8a/lib_System.Private.Xml.Linq.dll.so": { - "Size": 35584 - }, - "lib/arm64-v8a/lib_System.Runtime.dll.so": { - "Size": 20200 - }, - "lib/arm64-v8a/lib_System.Runtime.InteropServices.dll.so": { - "Size": 21592 - }, - "lib/arm64-v8a/lib_System.Runtime.Numerics.dll.so": { - "Size": 54408 - }, - "lib/arm64-v8a/lib_System.Runtime.Serialization.dll.so": { - "Size": 19352 - }, - "lib/arm64-v8a/lib_System.Runtime.Serialization.Formatters.dll.so": { - "Size": 20336 - }, - "lib/arm64-v8a/lib_System.Runtime.Serialization.Primitives.dll.so": { - "Size": 21448 - }, - "lib/arm64-v8a/lib_System.Security.Cryptography.dll.so": { - "Size": 80504 - }, - "lib/arm64-v8a/lib_System.Text.RegularExpressions.dll.so": { - "Size": 183592 - }, - "lib/arm64-v8a/lib_System.Xml.dll.so": { - "Size": 19256 - }, - "lib/arm64-v8a/lib_System.Xml.Linq.dll.so": { - "Size": 19272 - }, - "lib/arm64-v8a/lib_UnnamedProject.dll.so": { - "Size": 22096 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Activity.dll.so": { - "Size": 34760 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.AppCompat.AppCompatResources.dll.so": { - "Size": 24296 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.AppCompat.dll.so": { - "Size": 163072 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.CardView.dll.so": { - "Size": 24560 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.CoordinatorLayout.dll.so": { - "Size": 35680 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Core.dll.so": { - "Size": 151216 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.CursorAdapter.dll.so": { - "Size": 27168 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.DrawerLayout.dll.so": { - "Size": 33760 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Fragment.dll.so": { - "Size": 72224 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Legacy.Support.Core.UI.dll.so": { - "Size": 23896 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Lifecycle.Common.dll.so": { - "Size": 25072 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Lifecycle.LiveData.Core.dll.so": { - "Size": 24864 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Lifecycle.ViewModel.dll.so": { - "Size": 25208 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.Loader.dll.so": { - "Size": 31592 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.RecyclerView.dll.so": { - "Size": 111896 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.SavedState.dll.so": { - "Size": 23144 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.SwipeRefreshLayout.dll.so": { - "Size": 31672 - }, - "lib/arm64-v8a/lib_Xamarin.AndroidX.ViewPager.dll.so": { - "Size": 37752 - }, - "lib/arm64-v8a/lib_Xamarin.Forms.Core.dll.so": { - "Size": 581000 - }, - "lib/arm64-v8a/lib_Xamarin.Forms.Platform.Android.dll.so": { - "Size": 390464 - }, - "lib/arm64-v8a/lib_Xamarin.Forms.Platform.dll.so": { - "Size": 35848 - }, - "lib/arm64-v8a/lib_Xamarin.Forms.Xaml.dll.so": { - "Size": 80632 - }, - "lib/arm64-v8a/lib_Xamarin.Google.Android.Material.dll.so": { - "Size": 84400 - }, "lib/arm64-v8a/libarc.bin.so": { "Size": 18776 }, + "lib/arm64-v8a/libassemblies.arm64-v8a.blob.so": { + "Size": 4529760 + }, "lib/arm64-v8a/libmono-component-marshal-ilgen.so": { "Size": 87432 }, "lib/arm64-v8a/libmonodroid.so": { - "Size": 485400 + "Size": 456888 }, "lib/arm64-v8a/libmonosgen-2.0.so": { - "Size": 3196336 + "Size": 3196512 }, "lib/arm64-v8a/libSystem.Globalization.Native.so": { "Size": 67248 @@ -266,7 +59,7 @@ "Size": 160232 }, "lib/arm64-v8a/libxamarin-app.so": { - "Size": 119928 + "Size": 113240 }, "META-INF/androidx.activity_activity.version": { "Size": 6 @@ -422,7 +215,7 @@ "Size": 1221 }, "META-INF/BNDLTOOL.SF": { - "Size": 98661 + "Size": 90279 }, "META-INF/com.android.tools/proguard/coroutines.pro": { "Size": 1345 @@ -449,7 +242,7 @@ "Size": 5 }, "META-INF/MANIFEST.MF": { - "Size": 98534 + "Size": 90152 }, "META-INF/maven/com.google.guava/listenablefuture/pom.properties": { "Size": 96 @@ -2489,5 +2282,5 @@ "Size": 812848 } }, - "PackageSize": 10673477 + "PackageSize": 10556306 } \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfig.cs b/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfig.cs index 9a2335f9e75..b792d1d3eb7 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfig.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfig.cs @@ -31,7 +31,7 @@ sealed class ApplicationConfig public bool broken_exception_transitions; public bool jni_add_native_method_registration_attribute_present; public bool have_runtime_config_blob; - public bool have_assemblies_blob; + public bool fastdev_enabled; public bool marshal_methods_enabled; public bool ignore_split_configs; public byte bound_stream_io_exception_type; @@ -39,7 +39,6 @@ sealed class ApplicationConfig public uint environment_variable_count; public uint system_property_count; public uint number_of_assemblies_in_apk; - public uint bundled_assembly_name_width; public uint number_of_dso_cache_entries; public uint number_of_aot_cache_entries; public uint number_of_shared_libraries; diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigNativeAssemblyGenerator.cs b/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigNativeAssemblyGenerator.cs index 9a0bc213d6c..7c6511457c7 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigNativeAssemblyGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/ApplicationConfigNativeAssemblyGenerator.cs @@ -175,9 +175,7 @@ sealed class XamarinAndroidBundledAssembly public global::Android.Runtime.BoundExceptionType BoundExceptionType { get; set; } public bool JniAddNativeMethodRegistrationAttributePresent { get; set; } public bool HaveRuntimeConfigBlob { get; set; } - public bool HaveAssemblyStore { get; set; } public int NumberOfAssembliesInApk { get; set; } - public int BundledAssemblyNameWidth { get; set; } // including the trailing NUL public int AndroidRuntimeJNIEnvToken { get; set; } public int JNIEnvInitializeToken { get; set; } public int JNIEnvRegisterJniNativesToken { get; set; } @@ -188,6 +186,7 @@ sealed class XamarinAndroidBundledAssembly public List NativeLibraries { get; set; } public bool MarshalMethodsEnabled { get; set; } public bool IgnoreSplitConfigs { get; set; } + public bool FastDevEnabled { get; set; } public ApplicationConfigNativeAssemblyGenerator (IDictionary environmentVariables, IDictionary systemProperties, TaskLoggingHelper log) : base (log) @@ -227,7 +226,7 @@ protected override void Construct (LlvmIrModule module) broken_exception_transitions = BrokenExceptionTransitions, jni_add_native_method_registration_attribute_present = JniAddNativeMethodRegistrationAttributePresent, have_runtime_config_blob = HaveRuntimeConfigBlob, - have_assemblies_blob = HaveAssemblyStore, + fastdev_enabled = FastDevEnabled, marshal_methods_enabled = MarshalMethodsEnabled, ignore_split_configs = IgnoreSplitConfigs, bound_stream_io_exception_type = (byte)BoundExceptionType, @@ -236,7 +235,6 @@ protected override void Construct (LlvmIrModule module) system_property_count = (uint)(systemProperties == null ? 0 : systemProperties.Count * 2), number_of_assemblies_in_apk = (uint)NumberOfAssembliesInApk, number_of_shared_libraries = (uint)NativeLibraries.Count, - bundled_assembly_name_width = (uint)BundledAssemblyNameWidth, number_of_dso_cache_entries = (uint)dsoCache.Count, number_of_aot_cache_entries = (uint)aotDsoCache.Count, android_runtime_jnienv_class_token = (uint)AndroidRuntimeJNIEnvToken, @@ -269,36 +267,12 @@ protected override void Construct (LlvmIrModule module) }; module.Add (dso_apk_entries); - if (!HaveAssemblyStore) { - xamarinAndroidBundledAssemblies = new List> (NumberOfAssembliesInApk); - - var emptyBundledAssemblyData = new XamarinAndroidBundledAssembly { - file_fd = -1, - data_offset = 0, - data_size = 0, - data = 0, - name_length = (uint)BundledAssemblyNameWidth, - name = null, - }; - - for (int i = 0; i < NumberOfAssembliesInApk; i++) { - xamarinAndroidBundledAssemblies.Add (new StructureInstance (xamarinAndroidBundledAssemblyStructureInfo, emptyBundledAssemblyData)); - } - } - - string bundledBuffersSize = xamarinAndroidBundledAssemblies == null ? "empty (unused when assembly stores are enabled)" : $"{BundledAssemblyNameWidth} bytes long"; - var bundled_assemblies = new LlvmIrGlobalVariable (typeof(List>), "bundled_assemblies", LlvmIrVariableOptions.GlobalWritable) { - Value = xamarinAndroidBundledAssemblies, - Comment = $" Bundled assembly name buffers, all {bundledBuffersSize}", - }; - module.Add (bundled_assemblies); - AddAssemblyStores (module); } void AddAssemblyStores (LlvmIrModule module) { - ulong itemCount = (ulong)(HaveAssemblyStore ? NumberOfAssembliesInApk : 0); + ulong itemCount = (ulong)NumberOfAssembliesInApk; var assembly_store_bundled_assemblies = new LlvmIrGlobalVariable (typeof(List>), "assembly_store_bundled_assemblies", LlvmIrVariableOptions.GlobalWritable) { ZeroInitializeArray = true, ArrayItemCount = itemCount, diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index e4deccf9ab0..d32b742e5f5 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1,4 +1,4 @@ -

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy