Skip to content

Commit

Permalink
Add some debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
grendello committed Oct 23, 2024
1 parent 0a1ff37 commit c450cb6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,28 +408,35 @@ static Regex FileGlobToRegEx (string fileGlob, RegexOptions options)

void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx apk, bool debug, bool compress, IDictionary<AndroidTargetArch, Dictionary<string, CompressedAssemblyInfo>> compressedAssembliesInfo, string assemblyStoreApkName)
{
Log.LogDebugMessage ("g#: in AddAssemblies");
string sourcePath;
AssemblyStoreBuilder? storeBuilder = null;

if (UseAssemblyStore) {
Log.LogDebugMessage ("g#: assembly store used");
if (AssemblyStoreEmbeddedInRuntime) {
Log.LogDebugMessage ("g#: assembly store embedded in the runtime");
// We don't need to do anything here, the store is in `libxamarin-app.so`
return;
}

storeBuilder = new AssemblyStoreBuilder (Log);
}

Log.LogDebugMessage ("g#: adding user assemblies");
// Add user assemblies
AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedUserAssemblies, DoAddAssembliesFromArchCollection);

Log.LogDebugMessage ("g#: adding framework assemblies");
// Add framework assemblies
AssemblyPackagingHelper.AddAssembliesFromCollection (Log, SupportedAbis, ResolvedFrameworkAssemblies, DoAddAssembliesFromArchCollection);

if (!UseAssemblyStore) {
Log.LogDebugMessage ("g#: assembly store not used, returning");
return;
}

Log.LogDebugMessage ("g#: generating assembly stores");
Dictionary<AndroidTargetArch, string> assemblyStorePaths = storeBuilder.Generate (AppSharedLibrariesDir);

if (assemblyStorePaths.Count == 0) {
Expand All @@ -440,6 +447,7 @@ void AddAssemblies (DSOWrapperGenerator.Config dsoWrapperConfig, ZipArchiveEx ap
throw new InvalidOperationException ("Internal error: assembly store did not generate store for each supported ABI");
}

Log.LogDebugMessage ($"g#: {assemblyStorePaths.Count} assembly stores added");
string inArchivePath;
foreach (var kvp in assemblyStorePaths) {
string abi = MonoAndroidHelper.ArchToAbi (kvp.Key);
Expand All @@ -457,6 +465,7 @@ void DoAddAssembliesFromArchCollection (TaskLoggingHelper log, AndroidTargetArch
// or not we're supposed to compress .so files.
sourcePath = CompressAssembly (assembly);
if (UseAssemblyStore) {
Log.LogDebugMessage ($"g#: adding '{assembly}' to the store");
storeBuilder.AddAssembly (sourcePath, assembly, includeDebugSymbols: debug);
return;
}
Expand Down

0 comments on commit c450cb6

Please sign in to comment.