Skip to content

Commit 9bb00af

Browse files
committed
Always use assembly stores when assemblies are to be embedded
All the non-fastdev builds will use assembly stores unconditionally now.
1 parent be53aed commit 9bb00af

File tree

2 files changed

+4
-57
lines changed

2 files changed

+4
-57
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ public class BuildApk : AndroidTask
101101

102102
public string RuntimeConfigBinFilePath { get; set; }
103103

104-
public bool UseAssemblyStore { get; set; }
105-
106104
public string ZipFlushFilesLimit { get; set; }
107105

108106
public string ZipFlushSizeLimit { get; set; }
@@ -423,24 +421,15 @@ void AddRuntimeConfigBlob (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchi
423421
void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk, bool debug, bool compress, IDictionary<AndroidTargetArch, Dictionary<string, CompressedAssemblyInfo>> compressedAssembliesInfo, string assemblyStoreApkName)
424422
{
425423
string sourcePath;
426-
AssemblyCompression.AssemblyData compressedAssembly = null;
427424
string compressedOutputDir = Path.GetFullPath (Path.Combine (Path.GetDirectoryName (ApkOutputPath), "..", "lz4"));
428-
AssemblyStoreBuilder? storeBuilder = null;
429-
430-
if (UseAssemblyStore) {
431-
storeBuilder = new AssemblyStoreBuilder (Log);
432-
}
425+
var storeBuilder = new AssemblyStoreBuilder (Log);
433426

434427
// Add user assemblies
435428
AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedUserAssemblies, DoAddAssembliesFromArchCollection);
436429

437430
// Add framework assemblies
438431
AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedFrameworkAssemblies, DoAddAssembliesFromArchCollection);
439432

440-
if (!UseAssemblyStore) {
441-
return;
442-
}
443-
444433
Dictionary<AndroidTargetArch, string> assemblyStorePaths = storeBuilder.Generate (AppSharedLibrariesDir);
445434

446435
if (assemblyStorePaths.Count == 0) {
@@ -467,46 +456,7 @@ void DoAddAssembliesFromArchCollection (TaskLoggingHelper log, AndroidTargetArch
467456
// Thus, we no longer just store them in the apk but we call the `GetCompressionMethod` method to find out whether
468457
// or not we're supposed to compress .so files.
469458
sourcePath = CompressAssembly (assembly);
470-
if (UseAssemblyStore) {
471-
storeBuilder.AddAssembly (sourcePath, assembly, includeDebugSymbols: debug);
472-
return;
473-
}
474-
475-
// Add assembly
476-
(string assemblyPath, string assemblyDirectory) = GetInArchiveAssemblyPath (assembly);
477-
string wrappedSourcePath = DSOWrapperGenerator.WrapIt (Log, dsoWrapperConfig, arch, sourcePath, Path.GetFileName (assemblyPath));
478-
AddFileToArchiveIfNewer (apk, wrappedSourcePath, assemblyPath, compressionMethod: GetCompressionMethod (assemblyPath));
479-
480-
// Try to add config if exists
481-
var config = Path.ChangeExtension (assembly.ItemSpec, "dll.config");
482-
AddAssemblyConfigEntry (dsoWrapperConfig, apk, arch, assemblyDirectory, config);
483-
484-
// Try to add symbols if Debug
485-
if (!debug) {
486-
return;
487-
}
488-
489-
string symbols = Path.ChangeExtension (assembly.ItemSpec, "pdb");
490-
if (!File.Exists (symbols)) {
491-
return;
492-
}
493-
494-
string archiveSymbolsPath = assemblyDirectory + MonoAndroidHelper.MakeDiscreteAssembliesEntryName (Path.GetFileName (symbols));
495-
string wrappedSymbolsPath = DSOWrapperGenerator.WrapIt (Log, dsoWrapperConfig, arch, symbols, Path.GetFileName (archiveSymbolsPath));
496-
AddFileToArchiveIfNewer (
497-
apk,
498-
wrappedSymbolsPath,
499-
archiveSymbolsPath,
500-
compressionMethod: GetCompressionMethod (archiveSymbolsPath)
501-
);
502-
}
503-
504-
void EnsureCompressedAssemblyData (string sourcePath, uint descriptorIndex)
505-
{
506-
if (compressedAssembly == null)
507-
compressedAssembly = new AssemblyCompression.AssemblyData (sourcePath, descriptorIndex);
508-
else
509-
compressedAssembly.SetData (sourcePath, descriptorIndex);
459+
storeBuilder.AddAssembly (sourcePath, assembly, includeDebugSymbols: debug);
510460
}
511461

512462
string CompressAssembly (ITaskItem assembly)

src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
320320

321321
<PropertyGroup>
322322
<_AndroidAotStripLibraries Condition=" '$(_AndroidAotStripLibraries)' == '' And '$(AndroidIncludeDebugSymbols)' != 'true' ">True</_AndroidAotStripLibraries>
323-
<AndroidUseAssemblyStore Condition=" '$(AndroidUseAssemblyStore)' == '' and ('$(EmbedAssembliesIntoApk)' != 'true' or '$(AndroidIncludeDebugSymbols)' == 'true') ">false</AndroidUseAssemblyStore>
324-
<AndroidUseAssemblyStore Condition=" '$(AndroidUseAssemblyStore)' == '' ">true</AndroidUseAssemblyStore>
323+
<AndroidUseAssemblyStore Condition=" '$(EmbedAssembliesIntoApk)' != 'true' ">false</AndroidUseAssemblyStore>
324+
<AndroidUseAssemblyStore Condition=" '$(EmbedAssembliesIntoApk)' != 'true' ">true</AndroidUseAssemblyStore>
325325
<AndroidAotEnableLazyLoad Condition=" '$(AndroidAotEnableLazyLoad)' == '' And '$(AotAssemblies)' == 'true' And '$(AndroidIncludeDebugSymbols)' != 'true' ">True</AndroidAotEnableLazyLoad>
326326
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' and ('$(UsingMicrosoftNETSdkRazor)' == 'true') ">False</AndroidEnableMarshalMethods>
327327
<AndroidEnableMarshalMethods Condition=" '$(AndroidEnableMarshalMethods)' == '' ">False</AndroidEnableMarshalMethods>
@@ -1588,7 +1588,6 @@ because xbuild doesn't support framework reference assemblies.
15881588
<PropertyGroup>
15891589
<AndroidStoreUncompressedFileExtensions Condition=" '$(_EmbeddedDSOsEnabled)' == 'True' ">.so;$(AndroidStoreUncompressedFileExtensions)</AndroidStoreUncompressedFileExtensions>
15901590
<AndroidStoreUncompressedFileExtensions Condition=" '$(_UseEmbeddedDex)' == 'True' ">.dex;$(AndroidStoreUncompressedFileExtensions)</AndroidStoreUncompressedFileExtensions>
1591-
<AndroidStoreUncompressedFileExtensions Condition=" '$(AndroidUseAssemblyStore)' == 'True' ">.blob;$(AndroidStoreUncompressedFileExtensions)</AndroidStoreUncompressedFileExtensions>
15921591
</PropertyGroup>
15931592
</Target>
15941593

@@ -2108,7 +2107,6 @@ because xbuild doesn't support framework reference assemblies.
21082107
ZipFlushFilesLimit="$(_ZipFlushFilesLimit)"
21092108
ZipFlushSizeLimit="$(_ZipFlushSizeLimit)"
21102109
ZipAlignmentPages="$(AndroidZipAlignment)"
2111-
UseAssemblyStore="$(AndroidUseAssemblyStore)"
21122110
AndroidBinUtilsDirectory="$(AndroidBinUtilsDirectory)"
21132111
IntermediateOutputPath="$(IntermediateOutputPath)">
21142112
<Output TaskParameter="OutputFiles" ItemName="ApkFiles" />
@@ -2148,7 +2146,6 @@ because xbuild doesn't support framework reference assemblies.
21482146
ZipFlushFilesLimit="$(_ZipFlushFilesLimit)"
21492147
ZipFlushSizeLimit="$(_ZipFlushSizeLimit)"
21502148
ZipAlignmentPages="$(AndroidZipAlignment)"
2151-
UseAssemblyStore="$(AndroidUseAssemblyStore)"
21522149
AndroidBinUtilsDirectory="$(AndroidBinUtilsDirectory)"
21532150
IntermediateOutputPath="$(IntermediateOutputPath)">
21542151
<Output TaskParameter="OutputFiles" ItemName="BaseZipFile" />

0 commit comments

Comments
 (0)