Skip to content

Commit

Permalink
Fix for hardcoded .bin searching for satellite assembly files.
Browse files Browse the repository at this point in the history
  • Loading branch information
stavroskasidis committed Dec 13, 2022
1 parent 6a3223c commit 5746166
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,23 @@ public class RecompressSatelliteAssemblies : Task
public string BrotliCompressToolPath { get; set; }

public string CompressionLevel { get; set; }
public string RenameDllsTo { get; set; } = "bin";
public bool DisableRenamingDlls { get; set; }

public override bool Execute()
{
//#if DEBUG
// System.Diagnostics.Debugger.Launch();
//#endif
//#if DEBUG
// System.Diagnostics.Debugger.Launch();
//#endif

var assembyFilesExtension = DisableRenamingDlls ? "dll" : RenameDllsTo;
Log.LogMessage(MessageImportance.High, $"BlazorWasmAntivirusProtection: Recompressing satellite assemblies");
var frameworkDirs = Directory.GetDirectories(PublishDir, "_framework", SearchOption.AllDirectories);
foreach(var frameworkDir in frameworkDirs)
{
foreach (var file in Directory.GetFiles(frameworkDir, "*.*", SearchOption.AllDirectories))
{
if (file.EndsWith(".resources.bin"))
if (file.EndsWith($".resources.{assembyFilesExtension}"))
{
var gzFile = $"{file}.gz";
if (File.Exists(gzFile))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
BlazorEnableCompression="$(BlazorEnableCompression)" CompressionLevel="$(_BlazorBrotliCompressionLevel)"
BrotliCompressToolPath="$(_BlazorWAPBrotliCompressDll)">
</RenameDlls>
<RecompressSatelliteAssemblies PublishDir="$(PublishDir)"
<RecompressSatelliteAssemblies PublishDir="$(PublishDir)" RenameDllsTo="$(RenameDllsTo)" DisableRenamingDlls="$(DisableRenamingDlls)"
BrotliCompressToolPath="$(_BlazorWAPBrotliCompressDll)"
CompressionLevel="$(_BlazorBrotliCompressionLevel)">
</RecompressSatelliteAssemblies>
Expand Down

0 comments on commit 5746166

Please sign in to comment.