Skip to content

Commit 4ba8661

Browse files
authored
Merge pull request #786 from unoplatform/dev/jela/extless-compression
fix: Ensure compression is enabled with nodots obfuscation
2 parents 4ed8910 + ffda070 commit 4ba8661

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/Uno.Wasm.Bootstrap/ShellTask.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,13 @@ private void TryCompressDist()
445445
Log.LogMessage(MessageImportance.Low, $"Compressing {string.Join(", ", compressibleExtensions)}");
446446

447447
var filesToCompress = compressibleExtensions
448+
.Select(e => {
449+
if (_assembliesFileNameObfuscationMode == FileNameObfuscationMode.NoDots)
450+
{
451+
e = e.Replace(".", "_");
452+
}
453+
return e;
454+
})
448455
.SelectMany(e => Directory.GetFiles(_finalPackagePath, "*" + e, SearchOption.AllDirectories))
449456
.Where(f => !Path.GetDirectoryName(f).Contains("_compressed_"))
450457
.Distinct()

src/Uno.Wasm.StaticLinking.Shared/Validations.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33

4+
<PropertyGroup>
5+
<!-- Used for validating file compression -->
6+
<WasmShellCompressionLayoutMode>InPlace</WasmShellCompressionLayoutMode>
7+
</PropertyGroup>
8+
49
<ItemGroup>
510
<PackageReference Include="System.Web.Services.Description" Version="4.10.0" />
611
</ItemGroup>
@@ -17,6 +22,17 @@
1722
<Error Condition="$(_duplicateValidation.Contains(';'))" Text="Duplicate System.Private.CoreLib.clr detected" />
1823

1924
<Message Importance="high" Text="Output dist validated" />
25+
26+
<ItemGroup>
27+
<_compressedItems Include="$(WasmShellOutputPackagePath)\**\*.br" />
28+
</ItemGroup>
29+
30+
<PropertyGroup>
31+
<_compressedItemsValidation>@(_compressedItems)</_compressedItemsValidation>
32+
</PropertyGroup>
33+
34+
<Error Condition="'$(WasmShellAssembliesFileNameObfuscationMode)'=='NoDots' and !$(_compressedItemsValidation.Contains(';'))"
35+
Text="Compressed files cannot found found with obfuscation mode NoDots enabled" />
2036
</Target>
2137

2238
</Project>

0 commit comments

Comments
 (0)