Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
2efd571
In-tree SDK
maraf Oct 2, 2025
31cf8c4
Auto import SDK
maraf Oct 2, 2025
9fffe67
Transform basic Sample
maraf Oct 2, 2025
99d3bc5
Connect Wasm SDK with Native Build
maraf Oct 2, 2025
450a853
Library tests with Wasm SDK
maraf Oct 2, 2025
404bf8a
WasmGenerateAppBundle=false for browser
maraf Oct 2, 2025
e11f277
Bypass SWA build error in NetCoreServer and RemoteLoopServer
maraf Oct 2, 2025
3bfe660
Transform WasmExtraFilesToDeploy to Content in tests
maraf Oct 2, 2025
c6e9875
TrimmingTests
maraf Oct 3, 2025
f6dbc7d
InTree override optional
maraf Oct 7, 2025
b7b2677
Trimming AppBundle
maraf Oct 7, 2025
ac6c542
Trimming tests run-v8.sh
maraf Oct 8, 2025
2ac24a4
Trimming publish dir; Use original way to generate run-v8.sh
maraf Oct 9, 2025
8627a8f
Trimming test working dir
maraf Oct 9, 2025
d2c6b2e
Disable compression
maraf Oct 9, 2025
f8f2f03
Fix System.Net.Security.Tests duplicate reference
maraf Oct 9, 2025
50d112a
Remove probing for runtime version as it's not used anymore
maraf Oct 9, 2025
63a4f28
Fix *.Tests duplicate reference
maraf Oct 9, 2025
c53fcfd
Remove probing for runtime version as it's not used anymore
maraf Oct 9, 2025
85e2db8
Skip diplicates in ComputeWasmBuildAssets
maraf Oct 10, 2025
f9e2632
Remove condition in tests for browser
maraf Oct 10, 2025
c88e92f
Merge branch 'main' into WasmSdkInTree2
maraf Oct 20, 2025
251910a
Move OutputType=library to InTree targets for IsTestProject
maraf Oct 20, 2025
b05f208
Override WasmSDK in LocalBuild targets
maraf Oct 21, 2025
6adb6a9
Skip WasmSymbolicator from AOT compilation
maraf Oct 22, 2025
86026c3
Disable compression harder
maraf Oct 22, 2025
2ea5756
WasmBuildNative=false to library tests
maraf Oct 22, 2025
d563155
WasmBuildNative optional
maraf Oct 23, 2025
b0f4ebd
Run Build target for ProxyProjectForAOTOnHelix
maraf Oct 23, 2025
289ad7a
ProxyProjectForAOTOnHelix use WasmSDK
maraf Oct 23, 2025
2884877
PublishTrimmed=false to skip default relink
maraf Oct 23, 2025
69d3b78
Fit paths to WasmSDK in AOTonHelix
maraf Oct 24, 2025
498fa6d
StartupHookForFunctionalTest OutputType library
maraf Oct 24, 2025
2d1d4aa
HOTFIX set TargetFramework for AOT on Helix
maraf Oct 24, 2025
a755ece
HOTFIX set TargetFramework for AOT on Helix
maraf Oct 29, 2025
23105ce
WasmBuildNative for samples
maraf Oct 29, 2025
d4c1016
Escape hatch from wasm bundling in-tree
maraf Oct 29, 2025
d71ea30
HOTFIX remove Wasm.Console.Bench.Sample from CI
maraf Oct 29, 2025
bd9f55c
Do not hook any WasmSDK targets for WasmBuildingForNestedPublish
maraf Oct 30, 2025
e612054
Make samples working. Fix target order for trimming tests
maraf Oct 30, 2025
9c8dae9
Merge remote-tracking branch 'upstream/main' into WasmSdkInTree2
maraf Nov 3, 2025
2dc86da
InvariantGlobalization=false when empty
maraf Nov 3, 2025
4731f85
Remove double path separator
maraf Nov 5, 2025
2e27191
Include Content in VFS
maraf Nov 6, 2025
21a3c8e
Link project local Content items to wwwroot
maraf Nov 6, 2025
b21e4d7
Load full ICU if not invariant
maraf Nov 6, 2025
6ca5050
Use task for LinkContentToWwwroot
maraf Nov 12, 2025
b24e956
Use WasmIncludeFullIcuData
maraf Nov 12, 2025
db60c87
Link files from next directory
maraf Nov 13, 2025
d128f42
Skip default html+test-main for functional tests
maraf Nov 13, 2025
a52e73a
Postpone VFS items computation. Allow to compute them from all SWA, n…
maraf Nov 13, 2025
1ea3211
Support IncludeSatelliteAssembliesInVFS
maraf Nov 13, 2025
1fd921f
Fix WasmMainJS for samples
maraf Nov 13, 2025
23b929e
Support WasmFilesToIncludeFromPublishDir
maraf Nov 13, 2025
b555fbd
Shuffle around
maraf Nov 13, 2025
770eb2f
Merge branch 'main' into WasmSdkInTree2
maraf Nov 13, 2025
094b011
WasmTriggerPublishApp before BootConfig. Read tests assembly from Was…
maraf Nov 14, 2025
60a9f53
Don't LinkPublishContentToWwwroot in nested publish
maraf Nov 19, 2025
c859641
System.Reflection.MetadataLoadContext.Tests
maraf Nov 19, 2025
90e130f
Wasm.Advanced.Sample
maraf Nov 19, 2025
e827514
Set TargetPath on VFS if it's sub path of current project directory
maraf Nov 19, 2025
c802efe
WasmNestedPublishApp before ResolveWasmOutputs. Fix WasmNativeAsset.O…
maraf Nov 20, 2025
cf05805
Clean up
maraf Nov 20, 2025
b224035
WasmMainJSPath for Wasm.Browser.Bench.Sample.csproj
maraf Nov 20, 2025
ba7c3b3
buildAOTOnHelix=false
maraf Nov 20, 2025
c695dec
Samples
maraf Nov 20, 2025
4553c8c
PublishTrimmed=true for AOT
maraf Nov 20, 2025
c969957
Remove WasmExtraFilesToDeploy
maraf Nov 20, 2025
e9c3df8
Remove WasmAppBuilder
maraf Nov 20, 2025
993a9a0
Comments
maraf Nov 20, 2025
370c88f
Clean up
maraf Nov 20, 2025
ee4f980
Copy wwwroot to build output for samples
maraf Nov 21, 2025
d0f6c57
Remove WasmMainHtmlPath
maraf Nov 21, 2025
929f156
Fix path in WasmRunWasmOpt
maraf Nov 21, 2025
7c25066
Remove unused RebuildWasmAppBuilder target
maraf Nov 21, 2025
2ce47ad
Deleted too much in last commit
maraf Nov 21, 2025
ad277c9
AOT in build
maraf Nov 21, 2025
7dc9f26
Merge branch 'main' into WasmSdkInTree2
maraf Nov 21, 2025
b7deaa1
Fix casing for linux
maraf Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ extends:
platforms:
- browser_wasm
nameSuffix: _EAT
buildAOTOnHelix: false
runAOT: false
shouldRunSmokeOnly: false
alwaysRun: ${{ variables.isRollingBuild }}
Expand All @@ -867,6 +868,7 @@ extends:
- browser_wasm_win
nameSuffix: _Smoke_AOT
runAOT: true
buildAOTOnHelix: false
shouldRunSmokeOnly: true
alwaysRun: ${{ variables.isRollingBuild }}
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
Expand Down
5 changes: 3 additions & 2 deletions eng/testing/linker/SupportFiles/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />

<PropertyGroup>
<BundleDir>$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'AppBundle'))</BundleDir>
<BundleDir>$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'publish', 'wwwroot'))</BundleDir>
<WasmMainAssemblyFileName>project.dll</WasmMainAssemblyFileName>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>
</PropertyGroup>

<Target Name="CreateTestWasmAppBundle"
AfterTargets="Publish"
DependsOnTargets="BundleTestWasmApp"
DependsOnTargets="PrepareForWasmBuildApp;_WasmGenerateRunV8Script;BundleTestWasmApp"
Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi'" />

<PropertyGroup Condition="'$(PublishAot)' == 'true'">
Expand Down
5 changes: 5 additions & 0 deletions eng/testing/linker/project.csproj.template
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<WasmAppBuilderTasksAssemblyPath>{WasmAppBuilderTasksAssemblyPath}</WasmAppBuilderTasksAssemblyPath>
<MonoTargetsTasksAssemblyPath>{MonoTargetsTasksAssemblyPath}</MonoTargetsTasksAssemblyPath>
<MicrosoftNetCoreAppRuntimePackRidDir>{MicrosoftNetCoreAppRuntimePackRidDir}</MicrosoftNetCoreAppRuntimePackRidDir>
<_WebAssemblyPropsFile>{WasmSdkPackBuildPath}Microsoft.NET.Sdk.WebAssembly.Browser.props</_WebAssemblyPropsFile>
<_WebAssemblyTargetsFile>{WasmSdkPackBuildPath}Microsoft.NET.Sdk.WebAssembly.Browser.targets</_WebAssemblyTargetsFile>
<_WebAssemblySdkToolsDirectory>{WasmSdkPackTasksPath}</_WebAssemblySdkToolsDirectory>
<UsingBrowserRuntimeWorkload>true</UsingBrowserRuntimeWorkload>
<UsingBlazorAOTWorkloadManifest>true</UsingBlazorAOTWorkloadManifest>

<!-- Needed for targetingpacks.targets -->
<ProductVersion>{ProductVersion}</ProductVersion>
Expand Down
6 changes: 4 additions & 2 deletions eng/testing/linker/trimmingTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<TestConsoleAppSourceFiles>
<ProjectFile>%(ProjectDir)project.csproj</ProjectFile>
<TestCommand Condition="'$(TargetArchitecture)' != 'wasm' or '$(TargetOS)' != 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'project'))</TestCommand>
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'AppBundle', 'run-v8.sh'))</TestCommand>
<TestCommand Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizePath('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'wwwroot', 'run-v8.sh'))</TestCommand>
<TestExecutionDirectory Condition="'$(TargetArchitecture)' != 'wasm' or '$(TargetOS)' != 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish'))</TestExecutionDirectory>
<TestExecutionDirectory Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'AppBundle'))</TestExecutionDirectory>
<TestExecutionDirectory Condition="'$(TargetArchitecture)' == 'wasm' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizeDirectory('%(ProjectDir)', 'bin', '$(Configuration)', '%(TargetFramework)', '%(TestRuntimeIdentifier)', 'publish', 'wwwroot'))</TestExecutionDirectory>
</TestConsoleAppSourceFiles>
</ItemGroup>

Expand Down Expand Up @@ -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)')
Expand Down
138 changes: 102 additions & 36 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
<!-- We need to set this in order to get extensibility on xunit category traits and other arguments we pass down to xunit via MSBuild properties -->
<PropertyGroup>
<IsBrowserWasmProject Condition="'$(IsBrowserWasmProject)' == ''">true</IsBrowserWasmProject>
<WasmEnableHotReload>false</WasmEnableHotReload>
<CompressionEnabled>false</CompressionEnabled>
<DisableBuildCompression>true</DisableBuildCompression>
<PublishTrimmed>false</PublishTrimmed>
<PublishTrimmed Condition="'$(RunAOTCompilation)' == 'true'">true</PublishTrimmed>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(InvariantGlobalization)' == 'false' and '$(WasmIncludeFullIcuData)' == 'true'">true</BlazorWebAssemblyLoadAllGlobalizationData>
<_WasmInTreeDefaults>false</_WasmInTreeDefaults>

<ResolveWasmOutputsDependsOn>
$(ResolveWasmOutputsDependsOn);
WasmTriggerPublishApp;
UpdateWasmNativeAssetOriginalItemSpec
</ResolveWasmOutputsDependsOn>

<!-- set this when provisioning emsdk on CI -->
<EMSDK_PATH Condition="'$(EMSDK_PATH)' == '' and '$(ContinuousIntegrationBuild)' == 'true' and '$(MonoProjectRoot)' != ''">$([MSBuild]::NormalizeDirectory($(BrowserProjectRoot), 'emsdk'))</EMSDK_PATH>
Expand Down Expand Up @@ -36,6 +50,11 @@
<NullabilityInfoContextSupport Condition="'$(NullabilityInfoContextSupport)' == ''">true</NullabilityInfoContextSupport>
</PropertyGroup>

<ItemGroup>
<Content Include="$(MonoProjectRoot)browser\test-main.js" Link="wwwroot\test-main.js" CopyToOutputDirectory="PreserveNewest" Condition="'$(IsFunctionalTest)' != 'true'" />
<Content Include="$(MonoProjectRoot)browser\test-index.html" Link="wwwroot\index.html" CopyToOutputDirectory="PreserveNewest" Condition="'$(IsFunctionalTest)' != 'true'" />
</ItemGroup>

<!-- We expect WASM users to indicate they would like to have bigger download size by adding WasmIncludeFullIcuData, -->
<!-- by default we make their icu small by sharding. -->
<!-- Trimming test InvariantGlobalizationFalse requires full ICU data. -->
Expand Down Expand Up @@ -134,10 +153,10 @@
</PropertyGroup>

<!-- Don't include InTree.props here, because the test projects themselves can set the target* properties -->
<Import Project="$(BrowserProjectRoot)build\BrowserWasmApp.props"
Condition="'$(BuildAOTTestsOn)' == 'local'" />
<Import Project="$(BrowserProjectRoot)build\WasmApp.InTree.props"
Condition="'$(BuildAOTTestsOn)' == 'local' and '$(IsWasmProject)' != 'false'" />
<Import Project="$(BrowserProjectRoot)build\WasmApp.InTree.targets"
Condition="'$(BuildAOTTestsOn)' == 'local'" />
Condition="'$(BuildAOTTestsOn)' == 'local' and '$(IsWasmProject)' != 'false'" />

<PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' == 'true'">
<!-- wasm targets are not imported at all, in this case, because we run the wasm build on helix -->
Expand All @@ -151,10 +170,87 @@
<WasmNestedPublishAppDependsOn>PrepareForWasmBuildApp;$(WasmNestedPublishAppDependsOn)</WasmNestedPublishAppDependsOn>
</PropertyGroup>

<Target Name="IncludeTestAssemblyInVFS" BeforeTargets="PrepareForWasmBuildApp">
<Target Name="UpdateWasmNativeAssetOriginalItemSpec">
<ItemGroup>
<!-- WasmNativeAsset OriginalItemSpec points to the .csproj it was built for, whereas we expect it to point to the file itself later in WasmSDK -->
<WasmNativeAsset Update="@(WasmNativeAsset)">
<OriginalItemSpec>%(Identity)</OriginalItemSpec>
</WasmNativeAsset>
</ItemGroup>
</Target>

<UsingTask TaskName="Microsoft.WebAssembly.Build.Tasks.LinkContentToWwwroot" AssemblyFile="$(WasmBuildTasksAssemblyPath)" />

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

Check failure on line 182 in eng/testing/tests.browser.targets

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

eng/testing/tests.browser.targets#L182

eng/testing/tests.browser.targets(182,80): error MSB4022: (NETCORE_ENGINEERING_TELEMETRY=Build) The result "" of evaluating the value "$(WasmBuildTasksAssemblyPath)" of the "AssemblyFile" attribute in element <UsingTask> is not valid.

<Target Name="LinkContentToWwwroot" BeforeTargets="ResolveProjectStaticWebAssets" Condition="'$(TargetOS)' == 'browser' and '$(WasmBuildingForNestedPublish)' != 'true'">
<!-- StaticWebAssetsSDK expects all "files accessible from web" to be in wwwroot folder -->
<!-- Here we are adding Link/TargetPath for all Content items and adding them to WasmFilesToIncludeInFileSystem -->
<LinkContentToWwwroot Content="@(Content)" MSBuildProjectDirectory="$(MSBuildProjectDirectory)">
<Output TaskParameter="WasmFilesToIncludeInFileSystem" ItemName="WasmFilesToIncludeInFileSystem" />
<Output TaskParameter="ContentOut" ItemName="_LinkedContent" />
</LinkContentToWwwroot>
<ItemGroup>
<Content Remove="@(_LinkedContent)" />
<Content Include="@(_LinkedContent)" />
</ItemGroup>
</Target>

<Target Name="LinkPublishContentToWwwroot" BeforeTargets="ComputeWasmVfs" DependsOnTargets="GetCopyToOutputDirectoryItems" Condition="'$(TargetOS)' == 'browser' and '$(WasmBuildingForNestedPublish)' != 'true'">
<!-- StaticWebAssetsSDK doesn't have support for adding generated files during publish as "files accessible from web" -->
<!-- Here we are adding Link/TargetPath for various files generated during publish, adding them to WasmFilesToIncludeInFileSystem and defining them as StaticWebAsset with StaticWebAssetEndpoint -->
<ItemGroup>
<_WasmFilesForVfs Include="$(PublishDir)%(WasmFilesToIncludeFromPublishDir.Identity)"
TargetPath="%(WasmFilesToIncludeFromPublishDir.TargetDir)/%(WasmFilesToIncludeFromPublishDir.Identity)"
CopyToOutputDirectory="PreserveNewest"
Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != '' and '%(WasmFilesToIncludeFromPublishDir.TargetDir)' != ''" />
<_WasmFilesForVfs Include="$(PublishDir)%(WasmFilesToIncludeFromPublishDir.Identity)"
TargetPath="%(WasmFilesToIncludeFromPublishDir.Identity)"
CopyToOutputDirectory="PreserveNewest"
Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != '' and '%(WasmFilesToIncludeFromPublishDir.TargetDir)' == ''" />

<_WasmFilesForVfs Include="@(AllItemsFullPathWithTargetPath)" Condition="$([System.String]::new('%(AllItemsFullPathWithTargetPath.Identity)').EndsWith('.dmeta'))" />
<_WasmFilesForVfs Include="@(AllItemsFullPathWithTargetPath)" Condition="$([System.String]::new('%(AllItemsFullPathWithTargetPath.Identity)').EndsWith('.dil'))" />
<_WasmFilesForVfs Include="@(AllItemsFullPathWithTargetPath)" Condition="$([System.String]::new('%(AllItemsFullPathWithTargetPath.Identity)').EndsWith('.dpdb'))" />
<_WasmFilesForVfs Include="@(AllItemsFullPathWithTargetPath)" Condition="$([System.String]::new('%(AllItemsFullPathWithTargetPath.Identity)').EndsWith('.dpdb'))" />
<_WasmFilesForVfs Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.BuildReference)' == 'true' and $([System.String]::new('%(ReferenceCopyLocalPaths.Identity)').EndsWith('.dll')) and !$([System.String]::new('%(ReferenceCopyLocalPaths.Identity)').EndsWith('.resources.dll'))" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true' and '$(BuildAOTTestsOnHelix)' != 'true'">
<_SatelliteAssemblies Include="$(PublishDir)*\*.resources.dll" />
<_SatelliteAssemblies CultureName="$([System.IO.Directory]::GetParent('%(Identity)').Name)" />
<_SatelliteAssemblies TargetPath="%(CultureName)\%(FileName)%(Extension)" />

<_WasmFilesForVfs Include="@(_SatelliteAssemblies)" />
</ItemGroup>
<ItemGroup>
<WasmFilesToIncludeFromPublishDir Include="$(AssemblyName).dll" Exclude="@(WasmFilesToIncludeFromPublishDir)" />
<_WasmFilesForVfs CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<LinkContentToWwwroot Content="@(_WasmFilesForVfs->Distinct())" MSBuildProjectDirectory="$(MSBuildProjectDirectory)">
<Output TaskParameter="WasmFilesToIncludeInFileSystem" ItemName="WasmFilesToIncludeInFileSystem" />
<Output TaskParameter="ContentOut" ItemName="_WasmFilesForVfsLinked" />
</LinkContentToWwwroot>

<DefineStaticWebAssets
CandidateAssets="@(_WasmFilesForVfsLinked->Distinct())"
FingerprintCandidates="$(StaticWebAssetsFingerprintContent)"
FingerprintPatterns="@(StaticWebAssetFingerprintPattern)"
RelativePathPattern="wwwroot/**"
SourceType="Discovered"
SourceId="$(PackageId)"
ContentRoot="$(MSBuildProjectDirectory)\wwwroot\"
BasePath="$(StaticWebAssetBasePath)"
AssetMergeSource="$(StaticWebAssetMergeTarget)"
CacheManifestPath="$(_ResolveProjectStaticWebAssetsCachePath)">
<Output TaskParameter="Assets" ItemName="StaticWebAsset" />
<Output TaskParameter="Assets" ItemName="_CurrentProjectStaticWebAsset" />
</DefineStaticWebAssets>

<DefineStaticWebAssetEndpoints
CandidateAssets="@(_CurrentProjectStaticWebAsset)"
ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"
>
<Output TaskParameter="Endpoints" ItemName="StaticWebAssetEndpoint" />
</DefineStaticWebAssetEndpoints>
</Target>

<Target Name="PrepareForWasmBuildApp">
Expand All @@ -163,44 +259,14 @@
<WasmMainAssemblyFileName Condition="'$(WasmMainAssemblyFileName)' == ''">WasmTestRunner.dll</WasmMainAssemblyFileName>
<WasmMainJSPath Condition="'$(WasmMainJSPath)' == ''">$(MonoProjectRoot)\browser\test-main.js</WasmMainJSPath>
<WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</WasmMainJSFileName>
<WasmMainHtmlPath>$(PublishDir)index.html</WasmMainHtmlPath>
<WasmInvariantGlobalization>$(InvariantGlobalization)</WasmInvariantGlobalization>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>
</PropertyGroup>

<ItemGroup Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true' and '$(BuildAOTTestsOnHelix)' != 'true'">
<_SatelliteAssemblies Include="$(PublishDir)*\*.resources.dll" />
<_SatelliteAssemblies CultureName="$([System.IO.Directory]::GetParent('%(Identity)').Name)" />
<_SatelliteAssemblies TargetPath="%(CultureName)\%(FileName)%(Extension)" />

<WasmFilesToIncludeInFileSystem Include="@(_SatelliteAssemblies)" />
</ItemGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="$(WasmMainJSPath)" />
<WasmExtraFilesToDeploy Include="$(WasmMainHtmlPath)" />

<WasmAssembliesToBundle Include="$(PublishDir)\**\*.dll" Condition="'$(BuildAOTTestsOnHelix)' == 'true'" />
<WasmFilesToIncludeInFileSystem Include="@(ContentWithTargetPath)" />

<_CopyLocalPaths
Include="@(PublishItemsOutputGroupOutputs)"
Condition="'%(PublishItemsOutputGroupOutputs.BuildReference)' == 'true' and
!$([System.String]::new('%(PublishItemsOutputGroupOutputs.Identity)').EndsWith('.resources.dll'))" />

<_CopyLocalPaths TargetPath="%(_CopyLocalPaths.RelativePath)" Condition="'%(_CopyLocalPaths.RelativePath)' != ''" />
<_CopyLocalPaths TargetPath="%(FileName)%(Extension)" Condition="'%(_CopyLocalPaths.RelativePath)' == ''" />
<WasmFilesToIncludeInFileSystem Include="@(_CopyLocalPaths)" />

<!-- Include files specified by test projects from publish dir -->
<WasmFilesToIncludeInFileSystem
Include="$(PublishDir)%(WasmFilesToIncludeFromPublishDir.Identity)"
TargetPath="%(WasmFilesToIncludeFromPublishDir.TargetDir)/%(WasmFilesToIncludeFromPublishDir.Identity)"
Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" />
<WasmAssembliesToBundle Condition="'%(WasmAssembliesToBundle.FileName)' == 'WasmSymbolicator'" AOT_InternalForceToInterpret="true" />
</ItemGroup>

<WriteLinesToFile File="$(WasmMainHtmlPath)" Lines="&lt;html&gt;&lt;body&gt;&lt;script type='module' src='$(WasmMainJSFileName)'&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;" Overwrite="True" Condition="!Exists('$(WasmMainHtmlPath)')"/>

<ForceMSBuildGC />
</Target>

Expand Down
15 changes: 14 additions & 1 deletion eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project>
<PropertyGroup>
<!-- OutDir is not set early enough to set this property in .props file. -->
<BundleDir Condition="'$(BundleDir)' == ''">$([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle'))</BundleDir>
<BundleDir Condition="'$(BundleDir)' == '' and '$(TargetOS)' != 'browser'">$([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle'))</BundleDir>
<BundleDir Condition="'$(BundleDir)' == '' and '$(TargetOS)' == 'browser'">$([MSBuild]::NormalizeDirectory('$(OutDir)', 'wwwroot'))</BundleDir>
<PublishDir Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true' and '$(IsFunctionalTest)' != 'true'">$(AppBundleRoot)tests\$(AssemblyName)</PublishDir>
<PublishDir Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true' and '$(IsFunctionalTest)' == 'true'">$(AppBundleRoot)runonly\$(AssemblyName)</PublishDir>
<BundleDir Condition="'$(UseAppBundleRootForBuildingTests)' == 'true' and '$(IgnoreForCI)' != 'true'">$([MSBuild]::NormalizeDirectory('$(PublishDir)', 'AppBundle'))</BundleDir>
Expand Down Expand Up @@ -120,6 +121,7 @@
</Target>

<Target Name="AddTestRunnersToPublishedFiles"
BeforeTargets="_ResolveWasmOutputs"
AfterTargets="ComputeResolvedFilesToPublishList"
Condition="'$(TestFramework)' == 'xunit'">
<ItemGroup>
Expand All @@ -136,6 +138,17 @@
<_runnerFilesToPublishToFileName Remove="@(_resolvedFilesToPublishToFileName)" />

<ResolvedFileToPublish Include="@(_runnerFilesToPublishToFileName -> '%(OriginalIdentity)')" RelativePath="%(FileName)%(Extension)" CopyToPublishDirectory="PreserveNewest" PostprocessAssembly="true" />

</ItemGroup>
<ItemGroup Condition="'$(TargetOS)' == 'Browser'">
<!-- Remove runner files that already exist in ResolvedFileToPublish to avoid double publishing -->
<_ReferenceCopyLocalPathsFileName Include="@(ReferenceCopyLocalPaths -> '%(FileName)%(Extension)')" />

<_runnerReferenceCopyLocalPathsFileName Include="@(_runnerFilesToPublish -> '%(FileName)%(Extension)')">
<OriginalIdentity>%(Identity)</OriginalIdentity>
</_runnerReferenceCopyLocalPathsFileName>
<_runnerReferenceCopyLocalPathsFileName Remove="@(_ReferenceCopyLocalPathsFileName)" />
<ReferenceCopyLocalPaths Include="@(_runnerReferenceCopyLocalPathsFileName -> '%(OriginalIdentity)')" />
</ItemGroup>
</Target>

Expand Down
1 change: 0 additions & 1 deletion eng/testing/tests.wasi.targets
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<Target Name="PrepareForWasiBuildApp">
<PropertyGroup>
<WasmAppDir>$(BundleDir)</WasmAppDir>
<WasmInvariantGlobalization>$(InvariantGlobalization)</WasmInvariantGlobalization>
</PropertyGroup>

<ItemGroup Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true' and '$(BuildAOTTestsOnHelix)' != 'true'">
Expand Down
Loading
Loading