Skip to content

Commit

Permalink
Merge pull request #825 from unoplatform/dev/eb/xaml-trimming
Browse files Browse the repository at this point in the history
fix: Specify root mode for root assembly
  • Loading branch information
ebariche authored Feb 15, 2024
2 parents 17f3ee7 + 5cee302 commit 07dbe6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ private void RunPackager()
linkerParams.Add("--keep-metadata all ");

linkerParams.Add(GetLinkerFeatureConfiguration());
linkerParams.Add($"--verbose -b true -a \"{assemblyPath}\" -d \"{_managedPath}\"");
linkerParams.Add($"--verbose -b true -a \"{assemblyPath}\" entrypoint -d \"{_managedPath}\"");
linkerParams.Add($"-out \"{_managedPath}\"");

File.WriteAllLines(linkerResponse, linkerParams);
Expand Down
12 changes: 11 additions & 1 deletion src/Uno.Wasm.Packager/packager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ int Run (string[] args) {
} else {
foreach (var assembly in root_assemblies) {
string filename = Path.GetFileName (assembly);
linker_args.Add($"-a linker-in/{filename} ");
linker_args.Add($"-a linker-in/{filename} {(IsSupportAssembly(filename) ? string.Empty : "entrypoint")} ");
}
}

Expand Down Expand Up @@ -1982,6 +1982,16 @@ private bool IsResourceAssembly(string f, out string culture)
return false;
}

private static bool IsSupportAssembly(string filename)
=>
filename switch
{
"Uno.Wasm.AotProfiler.dll" => true,
"Uno.Wasm.LogProfiler.dll" => true,
"Uno.Wasm.MetadataUpdater.dll" => true,
_ => false
};

static void CopyFile(string sourceFileName, string destFileName, CopyType copyType, string typeFile = "")
{
Console.WriteLine($"{typeFile}cp: {copyType} - {sourceFileName} -> {destFileName}");
Expand Down

0 comments on commit 07dbe6f

Please sign in to comment.