@@ -459,58 +459,46 @@ void AddAssemblies (ZipArchiveEx apk, bool debug, bool compress, IDictionary<And
459459 AddFileToArchiveIfNewer ( apk , wrappedSourcePath , inArchivePath , GetCompressionMethod ( inArchivePath ) ) ;
460460 }
461461
462- void DoAddAssembliesFromArchCollection ( AndroidTargetArch arch , Dictionary < string , ITaskItem > assemblies )
462+ void DoAddAssembliesFromArchCollection ( TaskLoggingHelper log , AndroidTargetArch arch , ITaskItem assembly )
463463 {
464464 // In the "all assemblies are per-RID" world, assemblies, pdb and config are disguised as shared libraries (that is,
465465 // their names end with the .so extension) so that Android allows us to put them in the `lib/{ARCH}` directory.
466466 // For this reason, they have to be treated just like other .so files, as far as compression rules are concerned.
467467 // Thus, we no longer just store them in the apk but we call the `GetCompressionMethod` method to find out whether
468468 // or not we're supposed to compress .so files.
469- foreach ( ITaskItem assembly in assemblies . Values ) {
470- if ( MonoAndroidHelper . IsReferenceAssembly ( assembly . ItemSpec , Log ) ) {
471- Log . LogCodedWarning ( "XA0107" , assembly . ItemSpec , 0 , Properties . Resources . XA0107 , assembly . ItemSpec ) ;
472- }
473-
474- sourcePath = CompressAssembly ( assembly ) ;
475- if ( UseAssemblyStore ) {
476- storeBuilder . AddAssembly ( sourcePath , assembly , includeDebugSymbols : debug ) ;
477- continue ;
478- }
469+ sourcePath = CompressAssembly ( assembly ) ;
470+ if ( UseAssemblyStore ) {
471+ storeBuilder . AddAssembly ( sourcePath , assembly , includeDebugSymbols : debug ) ;
472+ return ;
473+ }
479474
480- // Add assembly
481- ( string assemblyPath , string assemblyDirectory ) = GetInArchiveAssemblyPath ( assembly ) ;
482- string wrappedSourcePath = DSOWrapperGenerator . WrapIt ( arch , sourcePath , Path . GetFileName ( assemblyPath ) , this ) ;
483- AddFileToArchiveIfNewer ( apk , wrappedSourcePath , assemblyPath , compressionMethod : GetCompressionMethod ( assemblyPath ) ) ;
475+ // Add assembly
476+ ( string assemblyPath , string assemblyDirectory ) = GetInArchiveAssemblyPath ( assembly ) ;
477+ string wrappedSourcePath = DSOWrapperGenerator . WrapIt ( arch , sourcePath , Path . GetFileName ( assemblyPath ) , this ) ;
478+ AddFileToArchiveIfNewer ( apk , wrappedSourcePath , assemblyPath , compressionMethod : GetCompressionMethod ( assemblyPath ) ) ;
484479
485- // Try to add config if exists
486- var config = Path . ChangeExtension ( assembly . ItemSpec , "dll.config" ) ;
487- AddAssemblyConfigEntry ( apk , arch , assemblyDirectory , config ) ;
480+ // Try to add config if exists
481+ var config = Path . ChangeExtension ( assembly . ItemSpec , "dll.config" ) ;
482+ AddAssemblyConfigEntry ( apk , arch , assemblyDirectory , config ) ;
488483
489- // Try to add symbols if Debug
490- if ( ! debug ) {
491- continue ;
492- }
484+ // Try to add symbols if Debug
485+ if ( ! debug ) {
486+ return ;
487+ }
493488
494- string symbols = Path . ChangeExtension ( assembly . ItemSpec , "pdb" ) ;
495- if ( ! File . Exists ( symbols ) ) {
496- string archiveSymbolsPath = assemblyDirectory + MonoAndroidHelper . MakeDiscreteAssembliesEntryName ( Path . GetFileName ( symbols ) ) ;
497- string wrappedSymbolsPath = DSOWrapperGenerator . WrapIt ( arch , symbols , Path . GetFileName ( archiveSymbolsPath ) , this ) ;
498- AddFileToArchiveIfNewer (
499- apk ,
500- wrappedSymbolsPath ,
501- archiveSymbolsPath ,
502- compressionMethod : GetCompressionMethod ( archiveSymbolsPath )
503- ) ;
504- }
489+ string symbols = Path . ChangeExtension ( assembly . ItemSpec , "pdb" ) ;
490+ if ( ! File . Exists ( symbols ) ) {
491+ return ;
505492 }
506- }
507493
508- void EnsureCompressedAssemblyData ( string sourcePath , uint descriptorIndex )
509- {
510- if ( compressedAssembly == null )
511- compressedAssembly = new AssemblyCompression . AssemblyData ( sourcePath , descriptorIndex ) ;
512- else
513- compressedAssembly . SetData ( sourcePath , descriptorIndex ) ;
494+ string archiveSymbolsPath = assemblyDirectory + MonoAndroidHelper . MakeDiscreteAssembliesEntryName ( Path . GetFileName ( symbols ) ) ;
495+ string wrappedSymbolsPath = DSOWrapperGenerator . WrapIt ( arch , symbols , Path . GetFileName ( archiveSymbolsPath ) , this ) ;
496+ AddFileToArchiveIfNewer (
497+ apk ,
498+ wrappedSymbolsPath ,
499+ archiveSymbolsPath ,
500+ compressionMethod : GetCompressionMethod ( archiveSymbolsPath )
501+ ) ;
514502 }
515503
516504 string CompressAssembly ( ITaskItem assembly )
0 commit comments