diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets index 1ba8ed737f4dfe..9687763d2fdee6 100644 --- a/eng/testing/linker/SupportFiles/Directory.Build.targets +++ b/eng/testing/linker/SupportFiles/Directory.Build.targets @@ -3,13 +3,14 @@ - $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'AppBundle')) + $([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'publish', 'wwwroot')) project.dll + true diff --git a/eng/testing/linker/project.csproj.template b/eng/testing/linker/project.csproj.template index 7498d355dfcee5..e10ac4fbe5b5d2 100644 --- a/eng/testing/linker/project.csproj.template +++ b/eng/testing/linker/project.csproj.template @@ -41,6 +41,9 @@ {WasmAppBuilderTasksAssemblyPath} {MonoTargetsTasksAssemblyPath} {MicrosoftNetCoreAppRuntimePackRidDir} + <_WebAssemblyPropsFile>{WasmSdkPackBuildPath}Microsoft.NET.Sdk.WebAssembly.Browser.props + <_WebAssemblyTargetsFile>{WasmSdkPackBuildPath}Microsoft.NET.Sdk.WebAssembly.Browser.targets + <_WebAssemblySdkToolsDirectory>{WasmSdkPackTasksPath} {ProductVersion} diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 8454ef52940f35..0418d28da14dbd 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -30,9 +30,9 @@ %(ProjectDir)project.csproj $([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'project')) - $([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'AppBundle', 'run-v8.sh')) + $([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'wwwroot', 'run-v8.sh')) $([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish')) - $([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'AppBundle')) + $([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'wwwroot')) @@ -114,6 +114,8 @@ .Replace('{MonoTargetsTasksAssemblyPath}', '$(MonoTargetsTasksAssemblyPath)') .Replace('{WasmAppBuilderTasksAssemblyPath}', '$(WasmAppBuilderTasksAssemblyPath)') .Replace('{MicrosoftNetCoreAppRuntimePackRidDir}', '$(MicrosoftNetCoreAppRuntimePackRidDir)') + .Replace('{WasmSdkPackBuildPath}', '$(MonoProjectRoot)nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/') + .Replace('{WasmSdkPackTasksPath}', '$(ArtifactsBinDir)Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/$(RuntimeConfiguration)/') .Replace('{ProductVersion}', '$(ProductVersion)') .Replace('{NetCoreAppCurrent}', '$(NetCoreAppCurrent)') .Replace('{NetCoreAppToolCurrent}', '$(NetCoreAppToolCurrent)') diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index 3c5a83a93d255d..8b5079717d3b65 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -7,6 +7,11 @@ true + false + false + true + false + <_WasmInTreeDefaults>false $([MSBuild]::NormalizeDirectory($(BrowserProjectRoot), 'emsdk')) @@ -36,6 +41,11 @@ true + + + + + @@ -134,7 +144,7 @@ - @@ -181,6 +191,7 @@ + <_CopyLocalPaths diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 1c0ed5772ab653..b85f6ee3394665 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -1,7 +1,8 @@ - $([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle')) + $([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle')) + $([MSBuild]::NormalizeDirectory('$(OutDir)', 'wwwroot')) $(AppBundleRoot)tests\$(AssemblyName) $(AppBundleRoot)runonly\$(AssemblyName) $([MSBuild]::NormalizeDirectory('$(PublishDir)', 'AppBundle')) @@ -120,6 +121,7 @@ @@ -136,6 +138,17 @@ <_runnerFilesToPublishToFileName Remove="@(_resolvedFilesToPublishToFileName)" /> + + + + + <_ReferenceCopyLocalPathsFileName Include="@(ReferenceCopyLocalPaths -> '%(FileName)%(Extension)')" /> + + <_runnerReferenceCopyLocalPathsFileName Include="@(_runnerFilesToPublish -> '%(FileName)%(Extension)')"> + %(Identity) + + <_runnerReferenceCopyLocalPathsFileName Remove="@(_ReferenceCopyLocalPathsFileName)" /> + diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index f0d99fa6d2872f..a70b72eaf9232b 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -2,7 +2,6 @@ true - true false $(BundleTestAppTargets);BundleTestWasmApp true @@ -90,9 +89,11 @@ - - - + + + + + diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj index 8780fd5f0aafa4..074b415a5c787d 100644 --- a/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj +++ b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj @@ -54,4 +54,8 @@ + + + + diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj index b8769e957b1580..526494c9d30f42 100644 --- a/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj +++ b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj @@ -19,4 +19,8 @@ + + + + diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj index 340819fc688edb..b498d57b5d9256 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj @@ -47,6 +47,8 @@ + + diff --git a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj index de52d1f916203d..3556062c504ab9 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj +++ b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj @@ -22,6 +22,8 @@ + + diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj index c978c7bf0f49b1..cc479711471034 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -44,6 +44,9 @@ + + + diff --git a/src/libraries/sendtohelix-browser.targets b/src/libraries/sendtohelix-browser.targets index eba7ec0e95f2c7..dcb844a5c579c3 100644 --- a/src/libraries/sendtohelix-browser.targets +++ b/src/libraries/sendtohelix-browser.targets @@ -211,6 +211,9 @@ + + + diff --git a/src/mono/browser/build/BrowserWasmApp.props b/src/mono/browser/build/BrowserWasmApp.props index 6de307e2d5f7d0..688df3fbe6522c 100644 --- a/src/mono/browser/build/BrowserWasmApp.props +++ b/src/mono/browser/build/BrowserWasmApp.props @@ -1,5 +1,6 @@ + false browser browser-wasm _WasmGenerateAppBundle diff --git a/src/mono/browser/build/WasmApp.InTree.props b/src/mono/browser/build/WasmApp.InTree.props index d81cd25b023b40..94647a0a4f5f0d 100644 --- a/src/mono/browser/build/WasmApp.InTree.props +++ b/src/mono/browser/build/WasmApp.InTree.props @@ -1,12 +1,26 @@ + true + + + $(MSBuildThisFileDirectory) $([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'build')) + + <_WebAssemblyPropsFile Condition="'$(_WebAssemblyPropsFile)' == ''">$(MonoProjectRoot)\nuget\Microsoft.NET.Sdk.WebAssembly.Pack\build\Microsoft.NET.Sdk.WebAssembly.Browser.props + <_WebAssemblyTargetsFile Condition="'$(_WebAssemblyTargetsFile)' == ''">$(MonoProjectRoot)\nuget\Microsoft.NET.Sdk.WebAssembly.Pack\build\Microsoft.NET.Sdk.WebAssembly.Browser.targets + <_WebAssemblySdkToolsDirectory Condition="'$(_WebAssemblySdkToolsDirectory)' == ''">$(ArtifactsBinDir)\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks\$(RuntimeConfiguration)\ + - + + + library + + + true AnyCPU false diff --git a/src/mono/browser/build/WasmApp.InTree.targets b/src/mono/browser/build/WasmApp.InTree.targets index 76de4a1b97410a..3820b4d800ae35 100644 --- a/src/mono/browser/build/WasmApp.InTree.targets +++ b/src/mono/browser/build/WasmApp.InTree.targets @@ -3,24 +3,14 @@ + + - - - - <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)')) - - - - - - - - diff --git a/src/mono/browser/test-index.html b/src/mono/browser/test-index.html new file mode 100644 index 00000000000000..d3e8e0e62f2f9a --- /dev/null +++ b/src/mono/browser/test-index.html @@ -0,0 +1 @@ + diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index b8c831e44c1516..c6bb6751c57af4 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -55,10 +55,10 @@ Copyright (c) .NET Foundation. All rights reserved. - $(MSBuildThisFileDirectory)..\ + <_WebAssemblySdkToolsDirectory Condition="'$(_WebAssemblySdkToolsDirectory)'==''">$(MSBuildThisFileDirectory)..\tools\ <_WebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net10.0 <_WebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net472 - <_WebAssemblySdkTasksAssembly>$(WebAssemblySdkDirectoryRoot)tools\$(_WebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.dll + <_WebAssemblySdkTasksAssembly Condition="'$(_WebAssemblySdkTasksAssembly)' == ''">$(_WebAssemblySdkToolsDirectory)\$(_WebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.dll $(CompressionIncludePatterns);_framework\** @@ -232,15 +232,7 @@ Copyright (c) .NET Foundation. All rights reserved. - - - <_WasmRuntimePackVersion>%(ResolvedRuntimePack.NuGetPackageVersion) - - - - - - + <_WasmNativeAssetFileNames>;@(WasmNativeAsset->'%(FileName)%(Extension)'); @@ -578,7 +570,7 @@ Copyright (c) .NET Foundation. All rights reserved. BeforeTargets="PrepareForPublish" /> - + @@ -45,6 +47,7 @@ + <_VFSFiles Include="$(VFSFilesPath)**\*" /> diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs index e35479120284dd..2eafa784282373 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs @@ -66,6 +66,7 @@ public override bool Execute() { var filesToRemove = new List(); var assetCandidates = new List(); + var uniqueFileNames = new HashSet(StringComparer.OrdinalIgnoreCase); try { @@ -151,6 +152,14 @@ public override bool Execute() Log.LogMessage(MessageImportance.Low, "Found satellite assembly '{0}' asset for inferred candidate '{1}' with culture '{2}'", candidate.ItemSpec, relatedAssetPath, culture); } + // Check for unique file name before adding candidate + var candidateFileName = Path.GetFileName(candidate.ItemSpec); + if (!uniqueFileNames.Add(candidateFileName)) + { + Log.LogMessage(MessageImportance.Low, "Skipping duplicate file name '{0}' for candidate '{1}'", candidateFileName, candidate.ItemSpec); + continue; + } + assetCandidates.Add(candidate); } diff --git a/src/tests/FunctionalTests/TestAssets/StartupHookForFunctionalTest/StartupHookForFunctionalTest.csproj b/src/tests/FunctionalTests/TestAssets/StartupHookForFunctionalTest/StartupHookForFunctionalTest.csproj index 4f3961903db695..c041131dfb9dfd 100644 --- a/src/tests/FunctionalTests/TestAssets/StartupHookForFunctionalTest/StartupHookForFunctionalTest.csproj +++ b/src/tests/FunctionalTests/TestAssets/StartupHookForFunctionalTest/StartupHookForFunctionalTest.csproj @@ -5,6 +5,7 @@ false false false + true diff --git a/src/tests/FunctionalTests/WebAssembly/Directory.Build.props b/src/tests/FunctionalTests/WebAssembly/Directory.Build.props index f0095527e9c471..04203e471d2a40 100644 --- a/src/tests/FunctionalTests/WebAssembly/Directory.Build.props +++ b/src/tests/FunctionalTests/WebAssembly/Directory.Build.props @@ -19,6 +19,8 @@ + +