Skip to content

Commit

Permalink
Log debug messages for 'ShouldFallbackToLibZipSharp` outcomes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpobst committed Jan 10, 2025
1 parent fc4cb32 commit efef036
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Xamarin.Android.Build.Tasks/Tasks/BuildArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,22 @@ bool ShouldFallbackToLibZipSharp ()
}

// .NET 6+ handles uncompressed files correctly, so we don't need to fallback.
if (RuntimeInformation.FrameworkDescription == ".NET")
if (RuntimeInformation.FrameworkDescription == ".NET") {
Log.LogDebugMessage ("Using System.IO.Compression because we're running on .NET 6+.");
return false;
}

// Nothing is going to get written uncompressed, so we don't need to fallback.
if (uncompressedMethod != CompressionMethod.Store)
if (uncompressedMethod != CompressionMethod.Store) {
Log.LogDebugMessage ("Using System.IO.Compression because uncompressedMethod isn't 'Store'.");
return false;
}

// No uncompressed file extensions were specified, so we don't need to fallback.
if (UncompressedFileExtensionsSet.Count == 0)
if (UncompressedFileExtensionsSet.Count == 0) {
Log.LogDebugMessage ("Using System.IO.Compression because no uncompressed file extensions were specified.");
return false;
}

// See if any of the files to be added need to be uncompressed.
foreach (var file in FilesToAddToArchive) {
Expand All @@ -244,6 +250,7 @@ bool ShouldFallbackToLibZipSharp ()
}
}

Log.LogDebugMessage ("Using System.IO.Compression because no files need to be stored uncompressed.");
return false;
}

Expand Down

0 comments on commit efef036

Please sign in to comment.