From a1731a349e08f2808a2ff6a23522270c0ae99b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Thu, 19 Sep 2024 22:07:27 -0400 Subject: [PATCH 1/4] fix: Use relative path for project-local css/scripts --- src/Uno.Wasm.Bootstrap/ShellTask.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Uno.Wasm.Bootstrap/ShellTask.cs b/src/Uno.Wasm.Bootstrap/ShellTask.cs index d8727693..77b25a2c 100644 --- a/src/Uno.Wasm.Bootstrap/ShellTask.cs +++ b/src/Uno.Wasm.Bootstrap/ShellTask.cs @@ -352,7 +352,7 @@ private void ExtractAdditionalJS() { var (fullSourcePath, relativePath) = GetFilePaths(projectResource); - if (fullSourcePath.Contains("WasmScripts")) + if (relativePath.Contains("WasmScripts")) { var scriptName = Path.GetFileName(fullSourcePath); @@ -389,7 +389,7 @@ private void ExtractAdditionalCSS() { var (fullSourcePath, relativePath) = GetFilePaths(projectResource); - if (fullSourcePath.Contains("WasmCSS")) + if (relativePath.Contains("WasmCSS")) { var cssName = Path.GetFileName(fullSourcePath); From ea1643d4c8b1b88a55655f000512880e48bb03e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Thu, 19 Sep 2024 22:12:01 -0400 Subject: [PATCH 2/4] chore: Search both relative and full paths for script/css --- src/Uno.Wasm.Bootstrap/ShellTask.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Uno.Wasm.Bootstrap/ShellTask.cs b/src/Uno.Wasm.Bootstrap/ShellTask.cs index 77b25a2c..10070ea6 100644 --- a/src/Uno.Wasm.Bootstrap/ShellTask.cs +++ b/src/Uno.Wasm.Bootstrap/ShellTask.cs @@ -352,7 +352,7 @@ private void ExtractAdditionalJS() { var (fullSourcePath, relativePath) = GetFilePaths(projectResource); - if (relativePath.Contains("WasmScripts")) + if (fullSourcePath.Contains(WasmScriptsFolder) || relativePath.Contains(WasmScriptsFolder)) { var scriptName = Path.GetFileName(fullSourcePath); @@ -389,7 +389,7 @@ private void ExtractAdditionalCSS() { var (fullSourcePath, relativePath) = GetFilePaths(projectResource); - if (relativePath.Contains("WasmCSS")) + if (relativePath.Contains("WasmCSS") || fullSourcePath.Contains("WasmCSS")) { var cssName = Path.GetFileName(fullSourcePath); From 70c1d1831ffcca85e2bec1e15f80774aef8e29ad Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Thu, 19 Sep 2024 22:42:59 -0400 Subject: [PATCH 3/4] chore: Adjust lookup --- src/Uno.Wasm.Bootstrap/ShellTask.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Uno.Wasm.Bootstrap/ShellTask.cs b/src/Uno.Wasm.Bootstrap/ShellTask.cs index 10070ea6..4e2aed8d 100644 --- a/src/Uno.Wasm.Bootstrap/ShellTask.cs +++ b/src/Uno.Wasm.Bootstrap/ShellTask.cs @@ -352,9 +352,22 @@ private void ExtractAdditionalJS() { var (fullSourcePath, relativePath) = GetFilePaths(projectResource); - if (fullSourcePath.Contains(WasmScriptsFolder) || relativePath.Contains(WasmScriptsFolder)) + string? getPath() { - var scriptName = Path.GetFileName(fullSourcePath); + if (relativePath.Contains(WasmScriptsFolder)) + { + return WasmScriptsFolder; + } + else if (fullSourcePath.Contains(WasmScriptsFolder)) + { + return WasmScriptsFolder; + } + return null; + } + + if (getPath() is { Length: > 0 } path) + { + var scriptName = Path.GetFileName(path); Log.LogMessage($"Embedded resources JS {scriptName}"); From 0cae5d1c10d94436637fc8f6b4ba826b08a65fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Thu, 19 Sep 2024 22:54:45 -0400 Subject: [PATCH 4/4] chore: Adjust paths --- src/Uno.Wasm.Bootstrap/ShellTask.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Uno.Wasm.Bootstrap/ShellTask.cs b/src/Uno.Wasm.Bootstrap/ShellTask.cs index 4e2aed8d..13df15b4 100644 --- a/src/Uno.Wasm.Bootstrap/ShellTask.cs +++ b/src/Uno.Wasm.Bootstrap/ShellTask.cs @@ -356,11 +356,11 @@ private void ExtractAdditionalJS() { if (relativePath.Contains(WasmScriptsFolder)) { - return WasmScriptsFolder; + return relativePath; } else if (fullSourcePath.Contains(WasmScriptsFolder)) { - return WasmScriptsFolder; + return fullSourcePath; } return null; }