From 01c23eae4bf7dd117bb711936e3e5524a6005933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 31 Jan 2023 14:42:34 +0100 Subject: [PATCH 01/22] Drop WasmMainJSPath. --- .../sample/wasm/DefaultBrowserSample.targets | 1 - src/mono/sample/wasm/Directory.Build.targets | 14 ++++++---- .../Wasm.Advanced.Sample.csproj | 1 + .../Wasm.Browser.Bench.Sample.csproj | 2 +- .../Wasm.Browser.NextJs.Sample.csproj | 1 - .../Wasm.BrowserProfile.Sample.csproj | 2 +- .../Wasm.Browser.WebPack.Sample.csproj | 2 +- .../wasm/browser/Wasm.Browser.Sample.csproj | 3 +++ .../Wasm.Console.Node.TS.Sample.csproj | 2 -- .../Wasm.Console.Node.Sample.csproj | 1 + .../console-v8/Wasm.Console.V8.Sample.csproj | 3 +++ .../wasm/simple-raytracer/RayTracer.csproj | 1 - src/mono/wasm/build/WasmApp.targets | 2 -- src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 26 ------------------- 14 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/mono/sample/wasm/DefaultBrowserSample.targets b/src/mono/sample/wasm/DefaultBrowserSample.targets index fa32db87a92678..ce72d3a8a960fd 100644 --- a/src/mono/sample/wasm/DefaultBrowserSample.targets +++ b/src/mono/sample/wasm/DefaultBrowserSample.targets @@ -1,7 +1,6 @@ true - main.js true embedded diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index 9ef8935b4969c0..0b847d0012e160 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -31,24 +31,28 @@ bin/$(Configuration)/AppBundle/dotnet.wasm; bin/$(Configuration)/AppBundle/$(_WasmMainJSFileName); "> - <_ScriptExt Condition="'$(OS)' == 'Windows_NT'">.cmd <_ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh <_Dotnet>$(RepoRoot)dotnet$(_ScriptExt) <_AOTFlag Condition="'$(RunAOTCompilation)' != ''">/p:RunAOTCompilation=$(RunAOTCompilation) - <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)')) $(BuildAdditionalArgs) /p:MonoDiagnosticsMock=$(MonoDiagnosticsMock) - + + + + <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)')) + + + - + - + diff --git a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj index ef4c5f2dda2f8f..5716c8a7a1e19a 100644 --- a/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj +++ b/src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj @@ -12,6 +12,7 @@ browser; + diff --git a/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj b/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj index a1209a7715be0e..d6ddd4750cb75f 100644 --- a/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj +++ b/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj @@ -3,7 +3,6 @@ $(NetCoreAppCurrent) false - main.js true true $(EnableAOTAndTrimming) @@ -14,6 +13,7 @@ + diff --git a/src/mono/sample/wasm/browser-nextjs/Wasm.Browser.NextJs.Sample.csproj b/src/mono/sample/wasm/browser-nextjs/Wasm.Browser.NextJs.Sample.csproj index 53eae5c03d7e18..429a02868346e2 100644 --- a/src/mono/sample/wasm/browser-nextjs/Wasm.Browser.NextJs.Sample.csproj +++ b/src/mono/sample/wasm/browser-nextjs/Wasm.Browser.NextJs.Sample.csproj @@ -1,7 +1,6 @@ false - package.json public diff --git a/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj b/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj index 7319738a6a0e1f..ddf26a06303657 100644 --- a/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj +++ b/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj @@ -1,7 +1,6 @@ true - main.js aot; true false @@ -9,6 +8,7 @@ + diff --git a/src/mono/sample/wasm/browser-webpack/Wasm.Browser.WebPack.Sample.csproj b/src/mono/sample/wasm/browser-webpack/Wasm.Browser.WebPack.Sample.csproj index 7eb6e7ac4f8c22..cc956fb3e9ef4d 100644 --- a/src/mono/sample/wasm/browser-webpack/Wasm.Browser.WebPack.Sample.csproj +++ b/src/mono/sample/wasm/browser-webpack/Wasm.Browser.WebPack.Sample.csproj @@ -1,11 +1,11 @@ false - main.js + diff --git a/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj b/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj index 76ec8950104ab5..48b71a73399d71 100644 --- a/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj +++ b/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj @@ -3,4 +3,7 @@ <_SampleProject>Wasm.Browser.Sample.csproj + + + diff --git a/src/mono/sample/wasm/console-node-ts/Wasm.Console.Node.TS.Sample.csproj b/src/mono/sample/wasm/console-node-ts/Wasm.Console.Node.TS.Sample.csproj index 10369cb62c1bc2..4228528a9aa29e 100644 --- a/src/mono/sample/wasm/console-node-ts/Wasm.Console.Node.TS.Sample.csproj +++ b/src/mono/sample/wasm/console-node-ts/Wasm.Console.Node.TS.Sample.csproj @@ -1,8 +1,6 @@ false - - tsconfig.json diff --git a/src/mono/sample/wasi/Directory.Build.targets b/src/mono/sample/wasi/Directory.Build.targets index 1e6a5fff8268f8..dc6f7bda6d2076 100644 --- a/src/mono/sample/wasi/Directory.Build.targets +++ b/src/mono/sample/wasi/Directory.Build.targets @@ -23,7 +23,6 @@ <_ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh <_Dotnet>$(RepoRoot)dotnet$(_ScriptExt) <_AOTFlag Condition="'$(RunAOTCompilation)' != ''">/p:RunAOTCompilation=$(RunAOTCompilation) - <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)')) diff --git a/src/mono/wasm/build/README.md b/src/mono/wasm/build/README.md index 5f312ad07b5852..e9552c8eaeee6c 100644 --- a/src/mono/wasm/build/README.md +++ b/src/mono/wasm/build/README.md @@ -90,7 +90,6 @@ The various task inputs correspond to properties as: AppDir : $(WasmAppDir) MainAssembly : $(WasmMainAssemblyPath) - MainJS : $(WasmMainJSPath) InvariantGlobalization : $(WasmInvariantGlobalization) SatelliteAssemblies : @(WasmSatelliteAssemblies) FilesToIncludeInFileSystem : @(WasmFilesToIncludeInFileSystem) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 62190929ba477d..c9caa75f286700 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -5,11 +5,10 @@ diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj index 732efffc9f4fdf..49cd1111455acf 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj @@ -6,7 +6,6 @@ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER 42 - main.js diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj index 80d3df9875d74b..0aa2332eca806f 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj @@ -6,7 +6,6 @@ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER 42 - main.js true From afbf3f529ad9b121c8b11b3b1d93d1dc9598f85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 1 Feb 2023 17:21:21 +0100 Subject: [PATCH 03/22] Include test-main in tests. --- eng/testing/tests.wasm.targets | 1 + src/mono/wasm/build/WasmApp.targets | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 486be5fda5da58..78de3dee1b0203 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -267,6 +267,7 @@ <_SatelliteAssemblies TargetPath="%(CultureName)\%(FileName)%(Extension)" /> + diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index c9caa75f286700..614598debe766c 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -381,7 +381,7 @@ - + From 50b7390b07b06bb5ce82d223ad2fcfcb0aac5f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 3 Feb 2023 12:58:11 +0100 Subject: [PATCH 04/22] Fix WBT. --- src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index f0b1776d0333c6..a2e2989e1f8fa0 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -343,6 +343,9 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp extraProperties += "true\n"; } + extraItems += ""; + extraItems += ""; + string projectContents = projectTemplate .Replace("##EXTRA_PROPERTIES##", extraProperties) .Replace("##EXTRA_ITEMS##", extraItems) @@ -378,6 +381,8 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp File.Copy(Path.Combine(AppContext.BaseDirectory, options.TargetFramework == "net8.0" ? "test-main.js" : "data/test-main-7.0.js"), Path.Combine(_projectDir, "test-main.js")); + + File.WriteAllText(Path.Combine(_projectDir!, "index.html"), @""); } else if (_projectDir is null) { From 5af5b18ff9c9e8ce3b2b2c7e1c8a1037625f27c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Fri, 3 Feb 2023 13:54:01 +0100 Subject: [PATCH 05/22] Hotfix tests. Needs a better solution.. --- eng/testing/tests.wasm.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index adb52dcd0cc567..47282c3384ef8c 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -269,6 +269,7 @@ + @@ -290,6 +291,8 @@ TargetPath="%(WasmFilesToIncludeFromPublishDir.Identity)" Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" /> + + From caf956666d50a367e632a73293b7d263eb0b2911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 7 Feb 2023 13:31:16 +0100 Subject: [PATCH 10/22] Fix debugger tests. --- src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj index ca7622136601c0..c9ebba9ce67c1d 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj @@ -57,7 +57,6 @@ false $(AppDir) - debugger-main.js -1 true @@ -78,6 +77,7 @@ + From d3cbbbf9446993de285f9f09f9b21ff0724b7bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 8 Feb 2023 17:30:12 +0100 Subject: [PATCH 11/22] Fix WBT. --- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 29 ++++++++++++++----- .../Wasm.Build.Tests/WasmTemplateTests.cs | 12 +++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index a2e2989e1f8fa0..8cb30e5fca98aa 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -436,7 +436,8 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp options.TargetFramework ?? DefaultTargetFramework, options.HasIcudt, options.DotnetWasmFromRuntimePack ?? !buildArgs.AOT, - UseWebcil); + UseWebcil, + options.IsBrowserProject); } if (options.UseCache) @@ -504,7 +505,15 @@ public string CreateWasmTemplateProject(string id, string template = "wasmbrowse extraProperties += "true"; if (UseWebcil) extraProperties += "true"; - AddItemsPropertiesToProject(projectfile, extraProperties); + + // TODO: Can be removed after updated templates propagate in. + string extraItems = string.Empty; + if (template == "wasmbrowser") + extraItems += ""; + else + extraItems += ""; + + AddItemsPropertiesToProject(projectfile, extraProperties, extraItems); return projectfile; } @@ -640,17 +649,22 @@ protected static void AssertBasicAppBundle(string bundleDir, string targetFramework, bool hasIcudt = true, bool dotnetWasmFromRuntimePack = true, - bool useWebcil = true) + bool useWebcil = true, + bool isBrowserProject = true) { - AssertFilesExist(bundleDir, new [] + var filesToExist = new List() { - "index.html", mainJS, "dotnet.timezones.blat", "dotnet.wasm", "mono-config.json", "dotnet.js" - }); + }; + + if (isBrowserProject) + filesToExist.Add("index.html"); + + AssertFilesExist(bundleDir, filesToExist); AssertFilesExist(bundleDir, new[] { "run-v8.sh" }, expectToExist: hasV8Script); AssertFilesExist(bundleDir, new[] { "icudt.dat" }, expectToExist: hasIcudt); @@ -698,7 +712,7 @@ protected static void AssertDotNetJsSymbols(string bundleDir, bool fromRuntimePa protected static void AssertFilesDontExist(string dir, string[] filenames, string? label = null) => AssertFilesExist(dir, filenames, label, expectToExist: false); - protected static void AssertFilesExist(string dir, string[] filenames, string? label = null, bool expectToExist=true) + protected static void AssertFilesExist(string dir, IEnumerable filenames, string? label = null, bool expectToExist=true) { string prefix = label != null ? $"{label}: " : string.Empty; if (!Directory.Exists(dir)) @@ -1125,6 +1139,7 @@ public record BuildProjectOptions string? Label = null, string? TargetFramework = null, string? MainJS = null, + bool IsBrowserProject = true, IDictionary? ExtraBuildEnvironmentVariables = null ); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs index 706ddc9b0b58ec..63bb4ff0bff964 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs @@ -148,7 +148,8 @@ public void ConsoleBuildThenPublish(string config) HasV8Script: false, MainJS: "main.mjs", Publish: false, - TargetFramework: BuildTestBase.DefaultTargetFramework + TargetFramework: BuildTestBase.DefaultTargetFramework, + IsBrowserProject: false )); AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "AppBundle"), fromRuntimePack: true, targetFramework: DefaultTargetFramework); @@ -174,7 +175,8 @@ public void ConsoleBuildThenPublish(string config) MainJS: "main.mjs", Publish: true, TargetFramework: BuildTestBase.DefaultTargetFramework, - UseCache: false)); + UseCache: false, + IsBrowserProject: false)); AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "AppBundle"), fromRuntimePack: !expectRelinking, targetFramework: DefaultTargetFramework); } @@ -216,7 +218,8 @@ private void ConsoleBuildAndRun(string config, bool relinking, string extraNewAr HasV8Script: false, MainJS: "main.mjs", Publish: false, - TargetFramework: expectedTFM + TargetFramework: expectedTFM, + IsBrowserProject: false )); AssertDotNetJsSymbols(Path.Combine(GetBinDir(config, expectedTFM), "AppBundle"), fromRuntimePack: !relinking, targetFramework: expectedTFM); @@ -388,7 +391,8 @@ public void ConsolePublishAndRun(string config, bool aot, bool relinking) MainJS: "main.mjs", Publish: true, TargetFramework: BuildTestBase.DefaultTargetFramework, - UseCache: false)); + UseCache: false, + IsBrowserProject: false)); if (!aot) { From 1cf8669c960a0406fffed1fbb3690077b6c6b7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 9 Feb 2023 14:33:48 +0100 Subject: [PATCH 12/22] Fix functional tests. --- eng/testing/tests.browser.targets | 2 +- .../ApplyUpdateReferencedAssembly.csproj | 1 + .../WebAssembly.Browser.HotReload.Test.csproj | 18 --------------- ...Assembly.Browser.RuntimeConfig.Test.csproj | 23 +------------------ ...ebAssembly.Browser.StartupHook.Test.csproj | 20 +--------------- .../WebAssembly/Directory.Build.props | 20 ++++++++++++++++ 6 files changed, 24 insertions(+), 60 deletions(-) diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index c3e311e59f1d4f..6017e36ad45045 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -303,7 +303,7 @@ Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" /> - + false + false diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj index 55c0bb98a7bc9a..01a153a36cd5c4 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj @@ -3,23 +3,11 @@ true false false - true - WasmTestOnBrowser - $(TestArchiveRoot)browseronly/ - $(TestArchiveTestsRoot)$(OSPlatformConfig)/ - $(DefineConstants);TARGET_BROWSER - 42 false - - - Always - - - @@ -49,10 +37,4 @@ - - - - - - diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj index 7b7d6a514e9e17..6b512ec9245ec3 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj @@ -1,22 +1 @@ - - - true - WasmTestOnBrowser - $(TestArchiveRoot)browseronly/ - $(TestArchiveTestsRoot)$(OSPlatformConfig)/ - $(DefineConstants);TARGET_BROWSER - 42 - - - - - - - - - - - - - - + diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj index e11e29a96b0f17..0acd55e74ce806 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/StartupHook/WebAssembly.Browser.StartupHook.Test.csproj @@ -1,28 +1,10 @@ - true - WasmTestOnBrowser - $(TestArchiveRoot)browseronly/ - $(TestArchiveTestsRoot)$(OSPlatformConfig)/ - $(DefineConstants);TARGET_BROWSER - 42 true - - - - - - - - - - - - - + diff --git a/src/tests/FunctionalTests/WebAssembly/Directory.Build.props b/src/tests/FunctionalTests/WebAssembly/Directory.Build.props index 5ecbfbf8fc5346..d53be47fcd50a0 100644 --- a/src/tests/FunctionalTests/WebAssembly/Directory.Build.props +++ b/src/tests/FunctionalTests/WebAssembly/Directory.Build.props @@ -3,10 +3,30 @@ Release Exe + + true + WasmTestOnBrowser + $(TestArchiveRoot)browseronly/ + $(TestArchiveTestsRoot)$(OSPlatformConfig)/ + $(DefineConstants);TARGET_BROWSER + 42 + + + + + + + + + + + + + $(NetCoreAppCurrent) $(RepoRoot)artifacts\bin\$(MSBuildProjectName) From abef2645f18617a1fdf5edf4aac8c8eba5dc4c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 14 Feb 2023 11:33:58 +0100 Subject: [PATCH 13/22] Try to fix runtime-tests? --- src/tests/Common/wasm-test-runner/WasmTestRunner.proj | 1 + src/tests/Directory.Build.targets | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj index 55152eed202c84..3573d6097dd42d 100644 --- a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj +++ b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj @@ -33,6 +33,7 @@ + diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 597faa1406078f..857e00eec8c0ee 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -531,6 +531,8 @@ + + + + From 0561ac928a9aab80a0c400ec8ee8c62ffc332cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 15 Feb 2023 11:04:56 +0100 Subject: [PATCH 14/22] Try to fix runtime-tests? (2) --- src/tests/Common/Directory.Build.targets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index c7386e7de3306d..9462d99403cf6b 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -125,6 +125,8 @@ TargetDir="crossgen2/" /> + + + + From 20d7bf31e795c571c5a3fd74eb1d7880008e1724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 15 Feb 2023 13:25:29 +0100 Subject: [PATCH 15/22] Try to fix runtime-tests? (3) --- src/tests/Common/wasm-test-runner/WasmTestRunner.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj index 3573d6097dd42d..781c4935194360 100644 --- a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj +++ b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj @@ -34,6 +34,7 @@ + From d1945eb61c5a6b052c49976b79a7f52f7ab48dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 15 Feb 2023 18:01:05 +0100 Subject: [PATCH 16/22] Deduplicate index.html. --- eng/testing/tests.browser.targets | 3 ++- src/tests/Common/Directory.Build.targets | 4 +--- src/tests/Common/wasm-test-runner/index.html | 1 + src/tests/Directory.Build.targets | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 src/tests/Common/wasm-test-runner/index.html diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index fd476f71feb4aa..aa89977adab75d 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -132,6 +132,7 @@ $(BundleDir) WasmTestRunner.dll $(MonoProjectRoot)\wasm\test-main.js + $([System.IO.Path]::GetFileName('$(WasmMainJSPath)')) $(PublishDir)index.html $(InvariantGlobalization) true @@ -171,7 +172,7 @@ Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" /> - + diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 9462d99403cf6b..7996b72521ae47 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -125,8 +125,6 @@ TargetDir="crossgen2/" /> - - \ No newline at end of file diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 857e00eec8c0ee..1261e18994a134 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -531,8 +531,6 @@ - - Date: Thu, 16 Feb 2023 11:07:19 +0100 Subject: [PATCH 17/22] Try to put test-index.html beside test-main.js --- .../wasm-test-runner/index.html => mono/wasm/test-index.html} | 0 src/tests/Common/Directory.Build.targets | 3 ++- src/tests/Directory.Build.targets | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) rename src/{tests/Common/wasm-test-runner/index.html => mono/wasm/test-index.html} (100%) diff --git a/src/tests/Common/wasm-test-runner/index.html b/src/mono/wasm/test-index.html similarity index 100% rename from src/tests/Common/wasm-test-runner/index.html rename to src/mono/wasm/test-index.html diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 7996b72521ae47..e12efd0dfc569d 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -165,7 +165,8 @@ TargetDir="runtime-test/"/> Date: Thu, 16 Feb 2023 13:27:22 +0100 Subject: [PATCH 18/22] Revert "Try to put test-index.html beside test-main.js" This reverts commit dc2582486cd2ae63c8d02dc737c2dec80bc952a0. --- src/tests/Common/Directory.Build.targets | 3 +-- .../Common/wasm-test-runner/index.html} | 0 src/tests/Directory.Build.targets | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) rename src/{mono/wasm/test-index.html => tests/Common/wasm-test-runner/index.html} (100%) diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index e12efd0dfc569d..7996b72521ae47 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -165,8 +165,7 @@ TargetDir="runtime-test/"/> Date: Wed, 22 Feb 2023 11:40:58 +0100 Subject: [PATCH 19/22] Feedback. --- src/mono/sample/wasm/Directory.Build.targets | 8 ++++---- src/mono/wasm/build/WasmApp.targets | 6 +++++- .../ApplyUpdateReferencedAssembly.csproj | 2 +- .../FunctionalTests/WebAssembly/Directory.Build.props | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index e414757707e5b8..abe39656509a41 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -45,19 +45,19 @@ - + <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)')) - + - + - + diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 643edd5686f12c..d5d5b2f15fa67a 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -341,7 +341,7 @@ @@ -352,6 +352,10 @@ <_WasmPThreadPoolSize Condition="'$(_WasmPThreadPoolSize)' == '' and ('$(WasmEnableThreads)' == 'true' or '$(WasmEnablePerfTracing)' == 'true')">-1 + + + + false false - false + false diff --git a/src/tests/FunctionalTests/WebAssembly/Directory.Build.props b/src/tests/FunctionalTests/WebAssembly/Directory.Build.props index d53be47fcd50a0..3b9e4d47c9492a 100644 --- a/src/tests/FunctionalTests/WebAssembly/Directory.Build.props +++ b/src/tests/FunctionalTests/WebAssembly/Directory.Build.props @@ -20,7 +20,7 @@ - + From 1f2d7b052cdacc050e46b5a9517aee77bef0818e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Wed, 22 Feb 2023 14:38:01 +0100 Subject: [PATCH 20/22] Drop docs for WasmMainJSPath. --- src/mono/wasm/build/WasmApp.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index d5d5b2f15fa67a..c8d66dfc804d6d 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -8,7 +8,6 @@ - $(EMSDK_PATH) - points to the emscripten sdk location. Public properties (optional): - - $(WasmMainJSPath) - Main JavaScript for execution on V8/node - $(WasmAppDir) - AppBundle dir (Defaults to `$(OutputPath)\$(Configuration)\AppBundle`) - $(WasmMainAssemblyFileName)- Defaults to $(TargetFileName) - $(WasmBuildNative) - Whenever to build the native executable. Defaults to false. From d8e06002566389ce1fa0e1587fe617772a4e7e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Thu, 23 Feb 2023 12:07:18 +0100 Subject: [PATCH 21/22] Add WasmMainJSPath to WasmExtraFilesToDeploy. --- src/mono/wasm/build/WasmApp.targets | 5 +++-- src/mono/wasm/templates/templates/console/console.0.csproj | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index c8d66dfc804d6d..166277a7b1c436 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -351,8 +351,9 @@ <_WasmPThreadPoolSize Condition="'$(_WasmPThreadPoolSize)' == '' and ('$(WasmEnableThreads)' == 'true' or '$(WasmEnablePerfTracing)' == 'true')">-1 - - + + + diff --git a/src/mono/wasm/templates/templates/console/console.0.csproj b/src/mono/wasm/templates/templates/console/console.0.csproj index 5e1c6b8ae28c29..fe5c61c88fe06e 100644 --- a/src/mono/wasm/templates/templates/console/console.0.csproj +++ b/src/mono/wasm/templates/templates/console/console.0.csproj @@ -2,8 +2,12 @@ net7.0 browser-wasm - main.mjs Exe true + main.mjs + + + + From 0b77fdbbd9edaf5805e5a4b5440af47b0f8d09b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Mon, 27 Feb 2023 11:19:52 +0100 Subject: [PATCH 22/22] Drop not necessary WasmExtraFilesToDeploy. --- .../sample/wasm/console-node/Wasm.Console.Node.Sample.csproj | 1 - src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj | 4 ---- src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs | 1 - src/mono/wasm/templates/templates/console/console.0.csproj | 4 ---- 4 files changed, 10 deletions(-) diff --git a/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj b/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj index 515143867dc5b4..7234698ff22837 100644 --- a/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj +++ b/src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj @@ -10,7 +10,6 @@ - diff --git a/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj b/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj index 2b31d2cbbe72c8..13ed38bfe63e4c 100644 --- a/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj +++ b/src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj @@ -8,9 +8,5 @@ $(ExecXHarnessCmd) wasm test --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --engine-arg=--module --js-file=main.mjs --output-directory=$(XHarnessOutput) -- --run $(MSBuildProjectName).dll - - - - diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs index 3e23c272aa654c..dc367b2e12089c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs @@ -349,7 +349,6 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp extraProperties += "true\n"; } - extraItems += ""; extraItems += ""; string projectContents = projectTemplate diff --git a/src/mono/wasm/templates/templates/console/console.0.csproj b/src/mono/wasm/templates/templates/console/console.0.csproj index fe5c61c88fe06e..e2704722e95661 100644 --- a/src/mono/wasm/templates/templates/console/console.0.csproj +++ b/src/mono/wasm/templates/templates/console/console.0.csproj @@ -6,8 +6,4 @@ true main.mjs - - - -