From 1b87a11061f4447cf0437aa7193df545c749f352 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 27 Jul 2024 14:51:02 +0000 Subject: [PATCH] [main] Update dependencies from dotnet/runtime (#42262) [main] Update dependencies from dotnet/runtime - Coherency Updates: - Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport: from 9.0.0-preview.7.24365.1 to 9.0.0-rc.1.24373.3 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Microsoft.SourceBuild.Intermediate.emsdk: from 9.0.0-preview.7.24365.1 to 9.0.0-rc.1.24373.3 (parent: Microsoft.NETCore.App.Runtime.win-x64) - Merge branch 'main' into darc-main-f291a482-3bda-49b6-8005-dd1ec1224b1b - Merge branch 'main' into darc-main-f291a482-3bda-49b6-8005-dd1ec1224b1b - Merge branch 'main' into darc-main-f291a482-3bda-49b6-8005-dd1ec1224b1b - Merge branch 'main' into darc-main-f291a482-3bda-49b6-8005-dd1ec1224b1b - Disable fingerprinting for wasm assets and skip failing tests - Disable fingerprinting for AoT tests - Additional fix - Merge branch 'main' into darc-main-f291a482-3bda-49b6-8005-dd1ec1224b1b - Update aspnetcore dependencies - Merge branch 'main' into darc-main-f291a482-3bda-49b6-8005-dd1ec1224b1b --- eng/Version.Details.xml | 220 ++++++++--------- eng/Versions.props | 94 ++++---- .../WasmAoTPublishIntegrationTest.cs | 29 ++- ...lazorWasmStaticWebAssetsIntegrationTest.cs | 57 ++++- ...nitialization.Publish.staticwebassets.json | 14 +- ...ublishModules.Publish.staticwebassets.json | 14 +- ...tJsonManifest.Publish.staticwebassets.json | 14 +- ...Minimal_Works.Publish.staticwebassets.json | 14 +- .../WasmBuildIncrementalismTest.cs | 28 ++- .../WasmBuildIntegrationTest.cs | 93 ++++++- .../WasmBuildLazyLoadTest.cs | 16 ++ .../WasmCompressionTests.cs | 26 +- .../WasmJsModulesIntegrationTests.cs | 59 ++++- .../WasmPublishIntegrationTest.cs | 228 ++++++++++++++++-- .../WasmPwaManifestTests.cs | 1 + .../StaticWebAssetEndpointsIntegrationTest.cs | 38 ++- 16 files changed, 704 insertions(+), 241 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c4b219f7e9d1..be2aaa0b4ab6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -15,42 +15,42 @@ c67e8d0e8e7bdcaf12e9c17692d05a7e891992a4 - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af @@ -59,14 +59,14 @@ https://github.com/dotnet/core-setup 7d57652f33493fa022125b7f63aad0d70c52d810 - + https://github.com/dotnet/emsdk - 99ea0c06b84d3084d090da537080dd35d2a193cf + 40781ca2fc6be1dd81143d8773105a0f9f77d923 - + https://github.com/dotnet/emsdk - 99ea0c06b84d3084d090da537080dd35d2a193cf + 40781ca2fc6be1dd81143d8773105a0f9f77d923 @@ -131,13 +131,13 @@ https://github.com/dotnet/roslyn e8c1ac069182453b2274f48109024f2d884bb312 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 https://github.com/nuget/nuget.client @@ -226,25 +226,25 @@ a1f5a6500b8cfefa81adbb652a84ad0ba884c140 - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af https://github.com/dotnet/windowsdesktop @@ -267,54 +267,54 @@ https://github.com/dotnet/wpf b9046d9c2181882c53db3c7215e8672032a7c57a - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 @@ -335,21 +335,21 @@ 6cf62038c2c42e72901b9fb759f1be7b2779fd3e - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 https://github.com/dotnet/test-templates @@ -495,89 +495,89 @@ - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/aspnetcore - 98ee50279acfacff2b4ae4b6863956f3c65f34b2 + 25db9495d1c3a84667f62fe62d9b7c0c6db5dcb9 - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af @@ -611,9 +611,9 @@ 3e18bd4f62388b829d0b9dcd1ee131431674aa5f - + https://github.com/dotnet/runtime - 1f70f0cc663b5d45f77840e9728386e5fa7944f9 + 827c83497bf4eb9816de2c223ea5c054e19954af https://github.com/dotnet/arcade-services diff --git a/eng/Versions.props b/eng/Versions.props index 4baeafa10729..18e1547371fb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -121,43 +121,43 @@ - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 8.0.0-rc.1.23414.4 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 2.1.0 - 9.0.0-preview.7.24366.18 + 9.0.0-rc.1.24376.16 8.0.0 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 8.0.0 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 - 9.0.0-preview.7.24366.18 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 + 9.0.0-rc.1.24376.16 @@ -241,19 +241,19 @@ - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 - 9.0.0-rc.1.24375.10 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 + 9.0.0-rc.1.24376.4 @@ -355,7 +355,7 @@ 14.2.9714-net9-p6 17.2.9714-net9-p6 - 9.0.0-preview.7.24365.1 + 9.0.0-rc.1.24373.3 $(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportPackageVersion) 9.0.100$([System.Text.RegularExpressions.Regex]::Match($(EmscriptenWorkloadManifestVersion), `-[A-z]*[\.]*\d*`)) diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/WasmAoTPublishIntegrationTest.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/WasmAoTPublishIntegrationTest.cs index c1e211c4757d..4de750b63a8b 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/WasmAoTPublishIntegrationTest.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/WasmAoTPublishIntegrationTest.cs @@ -16,7 +16,14 @@ public void AoT_Publish_InRelease_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAssetWithAot(testAppName, new[] { "blazorwasm" }); + var testInstance = CreateAspNetSdkTestAssetWithAot(testAppName, new[] { "blazorwasm" }) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + doc.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); var publishCommand = new PublishCommand(testInstance, "blazorwasm"); @@ -52,7 +59,13 @@ public void AoT_Publish_WithExistingWebConfig_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAssetWithAot(testAppName, new[] { "blazorwasm" }); + var testInstance = CreateAspNetSdkTestAssetWithAot(testAppName, new[] { "blazorwasm" }) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + doc.Root.Add(itemGroup); + }); var webConfigContents = "test webconfig contents"; File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "web.config"), webConfigContents); @@ -74,7 +87,17 @@ public void AoT_Publish_HostedAppWithScopedCss_VisualStudio() { // Simulates publishing the same way VS does by setting BuildProjectReferences=false. var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAssetWithAot(testAppName, new[] { "blazorwasm", "blazorhosted" }); + var testInstance = CreateAspNetSdkTestAssetWithAot(testAppName, new[] { "blazorwasm", "blazorhosted" }) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + doc.Root.Add(itemGroup); + } + }); + File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); // VS builds projects individually and then a publish with BuildDependencies=false, but building the main project is a close enough approximation for this test. diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmStaticWebAssetsIntegrationTest.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmStaticWebAssetsIntegrationTest.cs index 16fc10df76f7..b9113daca9ae 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmStaticWebAssetsIntegrationTest.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmStaticWebAssetsIntegrationTest.cs @@ -13,11 +13,20 @@ public void StaticWebAssets_BuildMinimal_Works() // Arrange // Minimal has no project references, service worker etc. This is pretty close to the project template. var testAsset = "BlazorWasmMinimal"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); + ProjectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "App.razor.css"), "h1 { font-size: 16px; }"); File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "appsettings.development.json"), "{}"); var build = CreateBuildCommand(ProjectDirectory); + var buildResult = ExecuteCommand(build); buildResult.Should().Pass(); @@ -46,7 +55,15 @@ public void StaticWebAssets_PublishMinimal_Works() // Arrange // Minimal has no project references, service worker etc. This is pretty close to the project template. var testAsset = "BlazorWasmMinimal"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); + ProjectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "App.razor.css"), "h1 { font-size: 16px; }"); File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "appsettings.development.json"), "{}"); @@ -74,7 +91,17 @@ public void StaticWebAssets_Build_Hosted_Works() { // Arrange var testAppName = "BlazorHosted"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAppName); + ProjectDirectory = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var build = CreateBuildCommand(ProjectDirectory, "blazorhosted"); var buildResult = ExecuteCommand(build); @@ -104,7 +131,17 @@ public void StaticWebAssets_Publish_Hosted_Works() { // Arrange var testAppName = "BlazorHosted"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAppName); + ProjectDirectory = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); // Check that static web assets is correctly configured by setting up a css file to triger css isolation. // The list of publish files should not include bundle.scp.css and should include blazorwasm.styles.css @@ -134,7 +171,17 @@ public void StaticWebAssets_Publish_DoesNotIncludeXmlDocumentationFiles_AsAssets { // Arrange var testAppName = "BlazorHosted"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAppName); + ProjectDirectory = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); // Check that static web assets is correctly configured by setting up a css file to triger css isolation. // The list of publish files should not include bundle.scp.css and should include blazorwasm.styles.css diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanCustomizeBlazorInitialization.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanCustomizeBlazorInitialization.Publish.staticwebassets.json index f99bc168ede3..9113c294a1a6 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanCustomizeBlazorInitialization.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanCustomizeBlazorInitialization.Publish.staticwebassets.json @@ -56,7 +56,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js", @@ -77,7 +77,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm", @@ -98,7 +98,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.wasm" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js", @@ -119,7 +119,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.runtime.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat", @@ -140,7 +140,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_CJK.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat", @@ -161,7 +161,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_EFIGS.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat", @@ -182,7 +182,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_no_CJK.dat" }, { "Identity": "${ProjectPath}\\obj\\Debug\\${Tfm}\\blazor.publish.boot.json", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanHaveDifferentBuildAndPublishModules.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanHaveDifferentBuildAndPublishModules.Publish.staticwebassets.json index 221bbbb2d8b5..24b38ead3caa 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanHaveDifferentBuildAndPublishModules.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JsModules_CanHaveDifferentBuildAndPublishModules.Publish.staticwebassets.json @@ -56,7 +56,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js", @@ -77,7 +77,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm", @@ -98,7 +98,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.wasm" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js", @@ -119,7 +119,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.runtime.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat", @@ -140,7 +140,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_CJK.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat", @@ -161,7 +161,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_EFIGS.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat", @@ -182,7 +182,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_no_CJK.dat" }, { "Identity": "${ProjectPath}\\obj\\Debug\\${Tfm}\\blazor.publish.boot.json", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/Publish_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJsonManifest.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/Publish_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJsonManifest.Publish.staticwebassets.json index 9084450bd245..3e654b0cb3fd 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/Publish_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJsonManifest.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/Publish_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJsonManifest.Publish.staticwebassets.json @@ -56,7 +56,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js", @@ -77,7 +77,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm", @@ -98,7 +98,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.wasm" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js", @@ -119,7 +119,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.runtime.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat", @@ -140,7 +140,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_CJK.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat", @@ -161,7 +161,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_EFIGS.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat", @@ -182,7 +182,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_no_CJK.dat" }, { "Identity": "${ProjectPath}\\obj\\Debug\\${Tfm}\\blazor.publish.boot.json", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json index 2aa5f73ac738..6e5dabd6252b 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_PublishMinimal_Works.Publish.staticwebassets.json @@ -56,7 +56,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js", @@ -77,7 +77,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm", @@ -98,7 +98,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.native.wasm" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.native.wasm" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js", @@ -119,7 +119,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\dotnet.runtime.js" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\dotnet.runtime.js" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat", @@ -140,7 +140,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_CJK.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat", @@ -161,7 +161,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_EFIGS.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_EFIGS.dat" }, { "Identity": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat", @@ -182,7 +182,7 @@ "Integrity": "__integrity__", "CopyToOutputDirectory": "Never", "CopyToPublishDirectory": "PreserveNewest", - "OriginalItemSpec": "${ProjectPath}\\bin\\Debug\\${Tfm}\\wwwroot\\_framework\\icudt_no_CJK.dat" + "OriginalItemSpec": "${RestorePath}\\microsoft.netcore.app.runtime.mono.browser-wasm\\${RuntimeVersion}\\runtimes\\browser-wasm\\native\\icudt_no_CJK.dat" }, { "Identity": "${ProjectPath}\\obj\\Debug\\${Tfm}\\blazor.publish.boot.json", diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIncrementalismTest.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIncrementalismTest.cs index 339d1555d8fd..f727d627a0cf 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIncrementalismTest.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIncrementalismTest.cs @@ -98,7 +98,15 @@ public void Build_SatelliteAssembliesFileIsPreserved() { // Arrange var testAsset = "BlazorWasmWithLibrary"; - var projectDirectory = CreateAspNetSdkTestAsset(testAsset); + var projectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); + File.Move(Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resources.ja.resx.txt"), Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx")); var build = CreateBuildCommand(projectDirectory, "blazorwasm"); @@ -153,7 +161,14 @@ public void Build_SatelliteAssembliesFileIsCreated_IfNewFileIsAdded() { // Arrange var testAsset = "BlazorWasmWithLibrary"; - var projectDirectory = CreateAspNetSdkTestAsset(testAsset); + var projectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); var build = CreateBuildCommand(projectDirectory, "blazorwasm"); build.Execute("/bl:build1-msbuild.binlog") @@ -196,7 +211,14 @@ public void Build_SatelliteAssembliesFileIsDeleted_IfAllSatelliteFilesAreRemoved { // Arrange var testAsset = "BlazorWasmWithLibrary"; - var projectDirectory = CreateAspNetSdkTestAsset(testAsset); + var projectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); File.Move(Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resources.ja.resx.txt"), Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx")); var build = CreateBuildCommand(projectDirectory, "blazorwasm"); diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs index 0570a9a28ee9..15e34c3267a7 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs @@ -24,7 +24,15 @@ public void BuildMinimal_Works() // Arrange // Minimal has no project references, service worker etc. This is pretty close to the project template. var testAsset = "BlazorWasmMinimal"; - var testInstance = CreateAspNetSdkTestAsset(testAsset); + var testInstance = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(testInstance.TestRoot, "App.razor.css"), "h1 { font-size: 16px; }"); var build = CreateBuildCommand(testInstance); @@ -48,7 +56,14 @@ public void Build_Works(string identifier) { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName, identifier: identifier); + var testInstance = CreateAspNetSdkTestAsset(testAppName, identifier: identifier) + .WithProjectChanges((path, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); var buildCommand = CreateBuildCommand(testInstance, "blazorwasm"); ExecuteCommand(buildCommand) @@ -82,6 +97,9 @@ public void Build_Works_WithLibraryUsingHintPath() { if (Path.GetFileNameWithoutExtension(project) == "blazorwasm") { + document.Root.Add(new XElement("PropertyGroup", + new XElement("WasmFingerprintAssets", false))); + var reference = document .Descendants() .Single(e => @@ -125,7 +143,17 @@ public void Build_InRelease_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var buildCommand = CreateBuildCommand(testInstance, "blazorwasm"); ExecuteCommand(buildCommand, "/p:Configuration=Release") @@ -153,7 +181,17 @@ public void Build_ProducesBootJsonDataWithExpectedContent() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var wwwroot = Path.Combine(testInstance.TestRoot, "blazorwasm", "wwwroot"); File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); @@ -190,7 +228,17 @@ public void Build_InRelease_ProducesBootJsonDataWithExpectedContent() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var wwwroot = Path.Combine(testInstance.TestRoot, "blazorwasm", "wwwroot"); File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); @@ -231,10 +279,10 @@ public void Build_WithBlazorEnableTimeZoneSupportDisabled_DoesNotCopyTimeZoneInf var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("BlazorEnableTimeZoneSupport", false)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); - var buildCommand = CreateBuildCommand(testInstance, "blazorwasm"); ExecuteCommand(buildCommand) .Should().Pass(); @@ -263,6 +311,7 @@ public void Build_WithInvariantGlobalizationEnabled_DoesNotCopyGlobalizationData var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("InvariantGlobalization", true)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); @@ -300,6 +349,7 @@ public void Publish_WithInvariantGlobalizationEnabled_DoesNotCopyGlobalizationDa var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("InvariantGlobalization", true)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); @@ -337,6 +387,7 @@ public void Build_WithBlazorWebAssemblyLoadCustomGlobalizationData_SetsGlobaliza var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("BlazorIcuDataFileName", customIcuFilename)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); @@ -379,6 +430,7 @@ public void Publish_WithBlazorWebAssemblyLoadCustomGlobalizationData_SetsGlobali var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("BlazorIcuDataFileName", customIcuFilename)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); @@ -422,6 +474,7 @@ public void Build_WithBlazorWebAssemblyLoadAllGlobalizationData_SetsICUDataMode( var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("BlazorWebAssemblyLoadAllGlobalizationData", true)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); @@ -465,6 +518,7 @@ public void Publish_WithBlazorWebAssemblyLoadAllGlobalizationData_SetsGlobalizat var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("BlazorWebAssemblyLoadAllGlobalizationData", true)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); }); @@ -511,7 +565,7 @@ public void Build_Hosted_Works() new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "_bin", "blazorwasm.wasm")).Should().NotExist(); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/runtime/issues/105399")] public void Build_SatelliteAssembliesAreCopiedToBuildOutput() { // Arrange @@ -525,6 +579,7 @@ public void Build_SatelliteAssembliesAreCopiedToBuildOutput() var ns = project.Root.Name.Namespace; var propertyGroup = new XElement(ns + "PropertyGroup"); propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies")); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); var itemGroup = new XElement(ns + "ItemGroup"); itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj"))); project.Root.Add(propertyGroup); @@ -556,7 +611,6 @@ public void Build_SatelliteAssembliesAreCopiedToBuildOutput() outputPath, intermediateOutputPath); - new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.wasm")).Should().Exist(); new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "Microsoft.CodeAnalysis.CSharp.wasm")).Should().Exist(); @@ -606,6 +660,13 @@ public void Build_WithTransitiveReference_Works() testInstance.WithProjectChanges((path, project) => { + if (path.Contains("blazorwasm.csproj")) + { + var propertyGroup = new XElement(project.Root.Name.Namespace + "PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); + } + if (path.Contains("razorclasslibrary")) { var ns = project.Root.Name.Namespace; @@ -643,7 +704,17 @@ public class TestReference public void Build_WithReference_Works() { // Regression test for https://github.com/dotnet/aspnetcore/issues/37574. - var testInstance = CreateAspNetSdkTestAsset("BlazorWasmWithLibrary"); + var testInstance = CreateAspNetSdkTestAsset("BlazorWasmWithLibrary") + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm.csproj")) + { + var ns = project.Root.Name.Namespace; + var propertyGroup = new XElement(ns + "PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); + } + }); var buildCommand = CreateBuildCommand(testInstance, "classlibrarywithsatelliteassemblies"); ExecuteCommand(buildCommand).Should().Pass(); @@ -667,6 +738,10 @@ public void Build_WithReference_Works() new XAttribute("HintPath", referenceAssemblyPath))); project.Root.Add(itemGroup); + + var propertyGroup = new XElement(ns + "PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); } }); diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildLazyLoadTest.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildLazyLoadTest.cs index abeb1b9a8697..1ba27e1bb268 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildLazyLoadTest.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildLazyLoadTest.cs @@ -24,6 +24,10 @@ public void Build_LazyLoadExplicitAssembly_Debug_Works() itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad", new XAttribute("Include", "RazorClassLibrary.wasm"))); project.Root.Add(itemGroup); + + var propertyGroup = new XElement("PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); }); // Act @@ -72,6 +76,10 @@ public void Build_LazyLoadExplicitAssembly_Release_Works() itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad", new XAttribute("Include", "RazorClassLibrary.wasm"))); project.Root.Add(itemGroup); + + var propertyGroup = new XElement("PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); }); // Act @@ -120,6 +128,10 @@ public void Publish_LazyLoadExplicitAssembly_Debug_Works() itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad", new XAttribute("Include", "RazorClassLibrary.wasm"))); project.Root.Add(itemGroup); + + var propertyGroup = new XElement("PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); }); // Act @@ -168,6 +180,10 @@ public void Publish_LazyLoadExplicitAssembly_Release_Works() itemGroup.Add(new XElement("BlazorWebAssemblyLazyLoad", new XAttribute("Include", "RazorClassLibrary.wasm"))); project.Root.Add(itemGroup); + + var propertyGroup = new XElement("PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); }); // Act diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmCompressionTests.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmCompressionTests.cs index 869f689672a1..b99e39fb7eb9 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmCompressionTests.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmCompressionTests.cs @@ -12,7 +12,18 @@ public void Publish_UpdatesFilesWhenSourcesChange() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var serviceWorkerAssetsManifest = new XElement("ServiceWorkerAssetsManifest", "service-worker-assets.js"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + itemGroup.Add(serviceWorkerAssetsManifest); + doc.Root.Add(itemGroup); + } + }); var publishCommand = new PublishCommand(testInstance, "blazorhosted"); publishCommand.Execute().Should().Pass(); @@ -54,7 +65,18 @@ public void Publish_WithoutLinkerAndCompression_UpdatesFilesWhenSourcesChange() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var serviceWorkerAssetsManifest = new XElement("ServiceWorkerAssetsManifest", "service-worker-assets.js"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + itemGroup.Add(serviceWorkerAssetsManifest); + doc.Root.Add(itemGroup); + } + }); var publishCommand = new PublishCommand(testInstance, "blazorhosted"); publishCommand.Execute("/p:BlazorWebAssemblyEnableLinking=false").Should().Pass(); diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmJsModulesIntegrationTests.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmJsModulesIntegrationTests.cs index 1884ef72971e..04a237960a0c 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmJsModulesIntegrationTests.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmJsModulesIntegrationTests.cs @@ -13,7 +13,15 @@ public void Build_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJsonM { // Arrange var testAsset = "BlazorWasmMinimal"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); + ProjectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Hello initializer')"); var build = CreateBuildCommand(ProjectDirectory); @@ -43,7 +51,18 @@ public void JSModules_ManifestIncludesModuleTargetPaths() { // Arrange var testAsset = "BlazorHosted"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); + ProjectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); + File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "wwwroot", "blazorwasm.lib.module.js"), "console.log('Hello initializer')"); File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "razorclasslibrary", "wwwroot", "razorclasslibrary.lib.module.js"), "console.log('Hello RCL initializer')"); @@ -78,7 +97,15 @@ public void Publish_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJso { // Arrange var testAsset = "BlazorWasmMinimal"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); + ProjectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Hello initializer')"); var publish = CreatePublishCommand(ProjectDirectory); @@ -117,13 +144,25 @@ public void JsModules_CanHaveDifferentBuildAndPublishModules() { // Arrange var testAsset = "BlazorWasmMinimal"; - ProjectDirectory = CreateAspNetSdkTestAsset(testAsset); + ProjectDirectory = CreateAspNetSdkTestAsset(testAsset) + .WithProjectChanges((p, doc) => + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + }); File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Publish initializer')"); File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.build.js"), "console.log('Build initializer')"); ProjectDirectory.WithProjectChanges(document => { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + document.Root.Add(itemGroup); + document.Root.Add(new XElement("ItemGroup", new XElement("Content", new XAttribute("Update", "wwwroot\\blazorwasm-minimal.lib.module.build.js"), @@ -131,7 +170,6 @@ public void JsModules_CanHaveDifferentBuildAndPublishModules() new XAttribute("TargetPath", "wwwroot\\blazorwasm-minimal.lib.module.js")))); }); - var publish = CreatePublishCommand(ProjectDirectory); var publishResult = ExecuteCommand(publish); publishResult.Should().Pass(); @@ -173,7 +211,7 @@ static JsonElement GetLibraryInitializer(string path) } } - [Fact] + [Fact(Skip = "https://github.com/dotnet/runtime/issues/105393")] public void JsModules_CanCustomizeBlazorInitialization() { // Arrange @@ -183,6 +221,8 @@ public void JsModules_CanCustomizeBlazorInitialization() ProjectDirectory.WithProjectChanges(document => { + document.Root.Add(new XElement("PropertyGroup", + new XElement("WasmFingerprintAssets", false))); document.Root.Add( XElement.Parse(@" @@ -236,7 +276,7 @@ public void JsModules_CanCustomizeBlazorInitialization() intermediateOutputPath); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/runtime/issues/105393")] public void JsModules_Hosted_CanCustomizeBlazorInitialization() { // Arrange @@ -248,6 +288,11 @@ public void JsModules_Hosted_CanCustomizeBlazorInitialization() { if (Path.GetFileNameWithoutExtension(path) == "blazorwasm") { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + document.Root.Add(itemGroup); + document.Root.Add( XElement.Parse(@" diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPublishIntegrationTest.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPublishIntegrationTest.cs index f9b7453969e1..6a4496d51fd6 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPublishIntegrationTest.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPublishIntegrationTest.cs @@ -17,7 +17,14 @@ public void Publish_MinimalApp_Works() { // Arrange var testAppName = "BlazorWasmMinimal"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); var publishCommand = CreatePublishCommand(testInstance); ExecuteCommand(publishCommand).Should().Pass() @@ -49,7 +56,14 @@ public void Publish_WithDefaultSettings_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); var publishCommand = CreatePublishCommand(testInstance, "blazorwasm"); ExecuteCommand(publishCommand).Should().Pass(); @@ -94,7 +108,14 @@ public void Publish_Works_WithLibraryUsingHintPath() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); testInstance.WithProjectChanges((project, document) => { @@ -140,7 +161,14 @@ public void Publish_WithScopedCss_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); var publishCommand = CreatePublishCommand(testInstance, "blazorwasm"); @@ -182,7 +210,15 @@ public void Publish_InRelease_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); + File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); var publishCommand = CreatePublishCommand(testInstance, "blazorwasm"); @@ -238,7 +274,13 @@ public void Publish_WithNoBuild_Works() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var itemGroup = new XElement("PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); var buildCommand = CreateBuildCommand(testInstance, "blazorwasm"); ExecuteCommand(buildCommand) @@ -292,6 +334,7 @@ public void Publish_WithStaticWebBasePathWorks(string basePath) var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("StaticWebAssetBasePath", basePath)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); } @@ -353,6 +396,7 @@ public void Publish_Hosted_WithStaticWebBasePathWorks(string basePath) var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("StaticWebAssetBasePath", basePath)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); } @@ -419,9 +463,9 @@ public void Publish_WithTrimmingdDisabled_Works() var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); itemGroup.Add(new XElement("PublishTrimmed", false)); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); project.Root.Add(itemGroup); } - }); var publishCommand = CreatePublishCommand(testInstance, "blazorwasm"); @@ -476,12 +520,22 @@ public void Publish_WithTrimmingdDisabled_Works() VerifyAssemblyHasTypes(loggingAssemblyPath, new[] { "Microsoft.Extensions.Logging.Abstractions.NullLogger" }); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/runtime/issues/105399")] public void Publish_SatelliteAssemblies_AreCopiedToBuildOutput() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); testInstance.WithProjectChanges((path, project) => { @@ -489,6 +543,7 @@ public void Publish_SatelliteAssemblies_AreCopiedToBuildOutput() { var ns = project.Root.Name.Namespace; var propertyGroup = new XElement(ns + "PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies")); var itemGroup = new XElement(ns + "ItemGroup"); itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj"))); @@ -522,7 +577,17 @@ public void Publish_HostedApp_DefaultSettings_Works() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); var publishCommand = CreatePublishCommand(testInstance, "blazorhosted"); ExecuteCommand(publishCommand).Should().Pass(); @@ -605,7 +670,17 @@ public void Publish_HostedApp_ProducesBootJsonDataWithExpectedContent() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); var wwwroot = Path.Combine(testInstance.TestRoot, "blazorwasm", "wwwroot"); File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); @@ -632,12 +707,22 @@ public void Publish_HostedApp_ProducesBootJsonDataWithExpectedContent() bootJsonData.config.Should().Contain("../appsettings.development.json"); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/runtime/issues/105399")] public void Publish_HostedApp_WithSatelliteAssemblies() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); testInstance.WithProjectChanges((path, project) => { @@ -648,6 +733,7 @@ public void Publish_HostedApp_WithSatelliteAssemblies() var propertyGroup = new XElement(ns + "PropertyGroup"); propertyGroup.Add(new XElement("PublishTrimmed", false)); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies")); var itemGroup = new XElement(ns + "ItemGroup"); itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj"))); @@ -694,7 +780,7 @@ public void Publish_HostedApp_WithoutTrimming_Works() { var ns = project.Root.Name.Namespace; var propertyGroup = new XElement(ns + "PropertyGroup"); - + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); propertyGroup.Add(new XElement("PublishTrimmed", false)); project.Root.Add(propertyGroup); } @@ -786,7 +872,17 @@ public void Publish_HostedApp_WithNoBuild_Works() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); var buildCommand = CreateBuildCommand(testInstance, "blazorhosted"); ExecuteCommand(buildCommand).Should().Pass(); @@ -839,7 +935,17 @@ public void Publish_HostedApp_VisualStudio() // Simulates publishing the same way VS does by setting BuildProjectReferences=false. // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); // VS builds projects individually and then a publish with BuildDependencies=false, but building the main project is a close enough approximation for this test. var buildCommand = CreateBuildCommand(testInstance, "blazorwasm"); @@ -922,7 +1028,18 @@ public void Publish_HostedAppWithScopedCss_VisualStudio() { // Simulates publishing the same way VS does by setting BuildProjectReferences=false. var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); + File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); // VS builds projects individually and then a publish with BuildDependencies=false, but building the main project is a close enough approximation for this test. @@ -1009,11 +1126,21 @@ public void Publish_HostedAppWithScopedCss_VisualStudio() // Regression test to verify satellite assemblies from the blazor app are copied to the published app's wwwroot output directory as // part of publishing in VS - [Fact] + [Fact(Skip = "https://github.com/dotnet/runtime/issues/105399")] public void Publish_HostedApp_VisualStudio_WithSatelliteAssemblies() { var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); testInstance.WithProjectChanges((path, project) => { @@ -1021,6 +1148,7 @@ public void Publish_HostedApp_VisualStudio_WithSatelliteAssemblies() { var ns = project.Root.Name.Namespace; var propertyGroup = new XElement(ns + "PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); propertyGroup.Add(new XElement("DefineConstants", @"$(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies")); var itemGroup = new XElement(ns + "ItemGroup"); itemGroup.Add(new XElement("ProjectReference", new XAttribute("Include", @"..\classlibrarywithsatelliteassemblies\classlibrarywithsatelliteassemblies.csproj"))); @@ -1064,7 +1192,17 @@ public void Publish_HostedApp_WithRidSpecifiedInCLI_Works() { // Arrange var testAppName = "BlazorHostedRID"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); var publishCommand = CreatePublishCommand(testInstance, "blazorhosted"); ExecuteCommand(publishCommand, "/p:RuntimeIdentifier=linux-x64").Should().Pass(); @@ -1091,6 +1229,14 @@ public void Publish_HostedApp_WithRidSpecifiedAsArgument_NoSelfContained_Works() """)); } + + if (Path.GetFileName(project) == "blazorwasm.csproj") + { + var ns = doc.Root.Name.Namespace; + var propertyGroup = new XElement(ns + "PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + doc.Root.Add(propertyGroup); + } }); var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); publishCommand.WithRuntime("linux-x64"); @@ -1105,7 +1251,17 @@ public void Publish_HostedApp_WithRidSpecifiedAsArgument_Works() { // Arrange var testAppName = "BlazorHostedRID"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); publishCommand.WithRuntime("linux-x64"); @@ -1121,7 +1277,17 @@ public void Publish_HostedApp_WithRid_Works() { // Arrange var testAppName = "BlazorHostedRID"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + if (path.Contains("blazorwasm")) + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + } + }); var publishCommand = CreatePublishCommand(testInstance, "blazorhosted"); ExecuteCommand(publishCommand).Should().Pass(); @@ -1237,7 +1403,6 @@ private void AssertRIDPublishOuput(DotnetPublishCommand command, TestAsset testI "wwwroot/_framework/System.Text.Json.wasm" }); - publishDirectory.Should().HaveFiles(new[] { // Verify project references appear as static web assets @@ -1303,6 +1468,7 @@ public void Publish_WithInvariantGlobalizationEnabled_DoesNotCopyGlobalizationDa { var ns = project.Root.Name.Namespace; var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); itemGroup.Add(new XElement("InvariantGlobalization", true)); project.Root.Add(itemGroup); }); @@ -1333,7 +1499,14 @@ public void Publish_HostingMultipleBlazorWebApps_Works() // Regression test for https://github.com/dotnet/aspnetcore/issues/29264 // Arrange var testAppName = "BlazorMultiApp"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((path, project) => + { + var ns = project.Root.Name.Namespace; + var itemGroup = new XElement(ns + "PropertyGroup"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(itemGroup); + }); var publishCommand = CreatePublishCommand(testInstance, "BlazorMultipleApps.Server"); ExecuteCommand(publishCommand).Should().Pass(); @@ -1410,6 +1583,13 @@ public void Publish_WithTransitiveReference_Works() project.Root.Add(itemGroup); } + + if (path.Contains("blazorwasm")) + { + var propertyGroup = new XElement("PropertyGroup"); + propertyGroup.Add(new XElement("WasmFingerprintAssets", false)); + project.Root.Add(propertyGroup); + } }); // Ensure a compile time reference exists between the project and the assembly added as a reference. This is required for diff --git a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPwaManifestTests.cs b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPwaManifestTests.cs index 446138729526..ce6cb8965a43 100644 --- a/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPwaManifestTests.cs +++ b/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmPwaManifestTests.cs @@ -23,6 +23,7 @@ public void Build_ServiceWorkerAssetsManifest_Works() { var itemGroup = new XElement("PropertyGroup"); var serviceWorkerAssetsManifest = new XElement("ServiceWorkerAssetsManifest", "service-worker-assets.js"); + itemGroup.Add(new XElement("WasmFingerprintAssets", false)); itemGroup.Add(serviceWorkerAssetsManifest); doc.Root.Add(itemGroup); } diff --git a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetEndpointsIntegrationTest.cs b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetEndpointsIntegrationTest.cs index 6f4133660742..e3ad65c252ed 100644 --- a/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetEndpointsIntegrationTest.cs +++ b/test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetEndpointsIntegrationTest.cs @@ -409,7 +409,9 @@ public void Build_EndpointManifest_ContainsEndpoints() { var itemGroup = new XElement("PropertyGroup"); var serviceWorkerAssetsManifest = new XElement("ServiceWorkerAssetsManifest", "service-worker-assets.js"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); itemGroup.Add(serviceWorkerAssetsManifest); + itemGroup.Add(fingerprintAssets); doc.Root.Add(itemGroup); } }); @@ -426,7 +428,17 @@ public void BuildHosted_EndpointManifest_ContainsEndpoints() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var buildCommand = CreateBuildCommand(testInstance, "blazorhosted"); buildCommand.Execute() @@ -442,7 +454,17 @@ public void Publish_EndpointManifestContainsEndpoints() { // Arrange var testAppName = "BlazorWasmWithLibrary"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var publishCommand = CreatePublishCommand(testInstance, "blazorwasm"); publishCommand.Execute().Should().Pass(); @@ -457,7 +479,17 @@ public void PublishHosted_EndpointManifest_ContainsEndpoints() { // Arrange var testAppName = "BlazorHosted"; - var testInstance = CreateAspNetSdkTestAsset(testAppName); + var testInstance = CreateAspNetSdkTestAsset(testAppName) + .WithProjectChanges((p, doc) => + { + if (Path.GetFileName(p) == "blazorwasm.csproj") + { + var itemGroup = new XElement("PropertyGroup"); + var fingerprintAssets = new XElement("WasmFingerprintAssets", false); + itemGroup.Add(fingerprintAssets); + doc.Root.Add(itemGroup); + } + }); var publishCommand = CreatePublishCommand(testInstance, "blazorhosted"); publishCommand.Execute().Should().Pass();