|
3 | 3 | <PropertyGroup>
|
4 | 4 | <BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
|
5 | 5 | <DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
|
| 6 | + <!-- Some tests expect to load satellite assemblies by path, eg. System.Runtime.Loader.Tests, |
| 7 | + so, just setting it true by default --> |
| 8 | + <IncludeSatelliteAssembliesInVFS Condition="'$(IncludeSatelliteAssembliesInVFS)' == ''">true</IncludeSatelliteAssembliesInVFS> |
| 9 | + </PropertyGroup> |
| 10 | + |
| 11 | + <PropertyGroup> |
| 12 | + <BuildAOTTestsOn Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(Scenario)' == 'BuildWasmApps'">helix</BuildAOTTestsOn> |
| 13 | + <BuildAOTTestsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">helix</BuildAOTTestsOn> |
| 14 | + <BuildAOTTestsOn Condition="'$(BuildAOTTestsOn)' == ''">local</BuildAOTTestsOn> |
6 | 15 | </PropertyGroup>
|
7 | 16 |
|
8 | 17 | <PropertyGroup Condition="'$(RunScriptCommand)' == ''">
|
|
14 | 23 |
|
15 | 24 | <_XHarnessArgs Condition="'$(Scenario)' != 'WasmTestOnBrowser'">$(_XHarnessArgs) --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js</_XHarnessArgs>
|
16 | 25 | <_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)</_XHarnessArgs>
|
17 |
| - <_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != '' and '$(OS)' != 'Windows_NT'">$(_XHarnessArgs) $(WasmXHarnessArgs) %24WasmXHarnessArgs</_XHarnessArgs> |
18 |
| - <_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != '' and '$(OS)' == 'Windows_NT'">$(_XHarnessArgs) $(WasmXHarnessArgs) %WasmXHarnessArgs%</_XHarnessArgs> |
| 26 | + <_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)</_XHarnessArgs> |
19 | 27 |
|
20 | 28 | <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll</_AppArgs>
|
21 | 29 | <_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll --testing</_AppArgs>
|
22 | 30 |
|
23 |
| - <_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs) %24WasmTestAppArgs</_AppArgs> |
24 |
| - <RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs)</RunScriptCommand> |
25 |
| - <RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">%HARNESS_RUNNER% $(_XHarnessArgs) -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs)</RunScriptCommand> |
| 31 | + <_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)</_AppArgs> |
| 32 | + |
| 33 | + <RunScriptCommand Condition="'$(OS)' != 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) %24WasmXHarnessArgs -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs) %24WasmTestAppArgs</RunScriptCommand> |
| 34 | + <RunScriptCommand Condition="'$(OS)' == 'Windows_NT'">$HARNESS_RUNNER $(_XHarnessArgs) %WasmXHarnessArgs% -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs) %WasmTestAppArgs%</RunScriptCommand> |
| 35 | + </PropertyGroup> |
| 36 | + |
| 37 | + <PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' == 'true'"> |
| 38 | + <_AOTBuildCommand>dotnet msbuild publish/AOTTestProjectForHelix.proj /bl:$XHARNESS_OUT/AOTBuild.binlog</_AOTBuildCommand> |
| 39 | + |
| 40 | + <!-- running aot-helix tests locally, so we can test with the same project file as CI --> |
| 41 | + <_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)</_AOTBuildCommand> |
| 42 | + |
| 43 | + <_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation)</_AOTBuildCommand> |
| 44 | + <_AOTBuildCommand>$(_AOTBuildCommand) && cd wasm_build/AppBundle</_AOTBuildCommand> |
| 45 | + |
| 46 | + <RunScriptCommand Condition="'$(RunScriptCommand)' == ''">$(_AOTBuildCommand)</RunScriptCommand> |
| 47 | + <RunScriptCommand Condition="'$(RunScriptCommand)' != ''">$(_AOTBuildCommand) && $(RunScriptCommand)</RunScriptCommand> |
26 | 48 | </PropertyGroup>
|
27 | 49 |
|
28 | 50 | <PropertyGroup Condition="'$(UseDefaultBlazorWASMFeatureSwitches)' == 'true'">
|
29 | 51 | <EventSourceSupport>false</EventSourceSupport>
|
30 |
| - <UseSystemResourceKeys>true</UseSystemResourceKeys> |
| 52 | + <UseSystemResourceKeys>false</UseSystemResourceKeys> |
31 | 53 | <EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
|
32 | 54 | <HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
|
33 | 55 |
|
34 | 56 | <!-- we want to default to what Blazor has, except if we are building in Debug config -->
|
35 |
| - <DebuggerSupport Condition="'$(Configuration)' != 'Debug'">false</DebuggerSupport> |
| 57 | + <DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport> |
36 | 58 | </PropertyGroup>
|
37 | 59 |
|
38 | 60 | <!-- Don't include InTree.props here, because the test projects themselves can set the target* properties -->
|
39 |
| - <Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.props" /> |
40 |
| - <Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.InTree.targets" /> |
| 61 | + <Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.props" |
| 62 | + Condition="'$(BuildAOTTestsOn)' == 'local'" /> |
| 63 | + <Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.InTree.targets" |
| 64 | + Condition="'$(BuildAOTTestsOn)' == 'local'" /> |
| 65 | + |
41 | 66 | <PropertyGroup>
|
42 | 67 | <WasmBuildAppDependsOn>PrepareForWasmBuildApp;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
|
43 |
| - <EmSdkDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk'))</EmSdkDir> |
| 68 | + <EmSdkDirForHelixPayload>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'emsdk'))</EmSdkDirForHelixPayload> |
| 69 | + |
| 70 | + <BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOn)' == 'local'">WasmBuildApp</BundleTestWasmAppDependsOn> |
| 71 | + <BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOn)' == 'helix'">StageEmSdkForHelix</BundleTestWasmAppDependsOn> |
| 72 | + |
| 73 | + <BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">$(BundleTestWasmAppDependsOn);_BundleAOTTestWasmAppForHelix</BundleTestWasmAppDependsOn> |
44 | 74 | </PropertyGroup>
|
45 | 75 |
|
46 |
| - <Target Name="BundleTestWasmApp" DependsOnTargets="WasmBuildApp;StageEmSdkForHelix" /> |
| 76 | + <Target Name="BundleTestWasmApp" DependsOnTargets="$(BundleTestWasmAppDependsOn)" /> |
| 77 | + |
| 78 | + <UsingTask Condition="'$(BuildAOTTestsOnHelix)' == 'true'" |
| 79 | + TaskName="Microsoft.WebAssembly.Build.Tasks.GenerateAOTProps" |
| 80 | + AssemblyFile="$(WasmBuildTasksAssemblyPath)" /> |
| 81 | + |
| 82 | + <Target Name="_BundleAOTTestWasmAppForHelix" DependsOnTargets="PrepareForWasmBuildApp"> |
| 83 | + <ItemGroup> |
| 84 | + <BundleFiles Include="$(WasmMainJSPath)" TargetDir="publish" /> |
| 85 | + <BundleFiles Include="@(WasmSatelliteAssemblies)" TargetDir="publish/%(WasmSatelliteAssemblies.CultureName)" /> |
| 86 | + <BundleFiles Include="@(WasmAssembliesToBundle)" TargetDir="publish" /> |
| 87 | + |
| 88 | + <BundleFiles Include="$(MonoProjectRoot)\wasm\data\aot-tests\*" TargetDir="publish" /> |
| 89 | + </ItemGroup> |
| 90 | + |
| 91 | + <ItemGroup Condition="'$(DebuggerSupport)' == 'true'"> |
| 92 | + <!-- Add any pdb files, if available --> |
| 93 | + <_BundlePdbFiles Include="$([System.IO.Path]::ChangeExtension('%(WasmAssembliesToBundle.Identity)', '.pdb'))" /> |
| 94 | + <BundleFiles Include="@(_BundlePdbFiles)" TargetDir="publish" Condition="Exists(%(_BundlePdbFiles.Identity))" /> |
| 95 | + </ItemGroup> |
| 96 | + |
| 97 | + <!-- To recreate the original project on helix, we need to set the wasm properties also, same as the |
| 98 | + library test project. Eg. $(InvariantGlobalization) --> |
| 99 | + <ItemGroup> |
| 100 | + <_WasmPropertyNames Include="InvariantGlobalization" /> |
| 101 | + <_WasmPropertyNames Include="AOTMode" /> |
| 102 | + <_WasmPropertyNames Include="WasmDebugLevel" /> |
| 103 | + <_WasmPropertyNames Include="WasmBuildNative" /> |
| 104 | + <_WasmPropertyNames Include="_WasmDevel" /> |
| 105 | + <_WasmPropertyNames Include="WasmLinkIcalls" /> |
| 106 | + <_WasmPropertyNames Include="WasmDedup" /> |
| 107 | + <_WasmPropertyNames Include="IncludeSatelliteAssembliesInVFS" /> |
| 108 | + |
| 109 | + <_WasmPropertiesToPass |
| 110 | + Include="$(%(_WasmPropertyNames.Identity))" |
| 111 | + Name="%(_WasmPropertyNames.Identity)" |
| 112 | + ConditionToUse="%(_WasmPropertyNames.ConditionToUse)" /> |
| 113 | + |
| 114 | + <_WasmVFSFilesToCopy Include="@(WasmFilesToIncludeInFileSystem)" /> |
| 115 | + <_WasmVFSFilesToCopy TargetPath="%(FileName)%(Extension)" Condition="'%(TargetPath)' == ''" /> |
| 116 | + </ItemGroup> |
| 117 | + |
| 118 | + <!-- This file gets imported by the project file on helix --> |
| 119 | + <GenerateAOTProps |
| 120 | + Properties="@(_WasmPropertiesToPass)" |
| 121 | + OutputFile="$(BundleDir)publish\AOTTestProjectForHelix.props" /> |
| 122 | + |
| 123 | + <Copy SourceFiles="@(BundleFiles)" DestinationFolder="$(BundleDir)%(TargetDir)" /> |
| 124 | + <Copy SourceFiles="@(_WasmVFSFilesToCopy)" DestinationFiles="$(BundleDir)\extraFiles\%(_WasmVFSFilesToCopy.TargetPath)" /> |
| 125 | + </Target> |
47 | 126 |
|
48 | 127 | <!-- CI has emscripten provisioned in $(EMSDK_PATH) as `/usr/local/emscripten`. Because helix tasks will
|
49 | 128 | attempt to write a .payload file, we cannot use $(EMSDK_PATH) to package emsdk as a helix correlation
|
50 | 129 | payload. Instead, we copy over the files to a new directory `src/mono/wasm/emsdk` and use that. -->
|
51 |
| - <Target Name="StageEmSdkForHelix" Condition="'$(Scenario)' == 'BuildWasmApps' and '$(ContinuousIntegrationBuild)' == 'true' and !Exists($(EmSdkDir))"> |
52 |
| - <Error Condition="!Exists($(EMSDK_PATH))" Text="Could not find emscripten sdk in $(EmSdkDir) or in EMSDK_PATH=$(EMSDK_PATH)" /> |
| 130 | + <Target Name="StageEmSdkForHelix" Condition="'$(EmSdkDirForHelixPayload)' == '' or !Exists($(EmSdkDirForHelixPayload))"> |
| 131 | + <Error Condition="'$(EMSDK_PATH)' == '' or !Exists($(EMSDK_PATH))" Text="Could not find emscripten sdk in $(EmSdkDirForHelixPayload) or in EMSDK_PATH=$(EMSDK_PATH)" /> |
53 | 132 |
|
54 | 133 | <ItemGroup>
|
55 | 134 | <EmSdkFiles Include="$(EMSDK_PATH)\**\*" Exclude="$(EMSDK_PATH)\.git\**\*" />
|
56 | 135 | </ItemGroup>
|
57 | 136 |
|
58 |
| - <MakeDir Directories="$(EmSdkDir)" /> |
59 |
| - <Copy SourceFiles="@(EmSdkFiles)" DestinationFolder="$(EmSdkDir)\%(RecursiveDir)" /> |
| 137 | + <MakeDir Directories="$(EmSdkDirForHelixPayload)" /> |
| 138 | + <Copy SourceFiles="@(EmSdkFiles)" DestinationFolder="$(EmSdkDirForHelixPayload)\%(RecursiveDir)" /> |
60 | 139 | </Target>
|
61 | 140 |
|
62 | 141 | <Target Name="PrepareForWasmBuildApp">
|
|
74 | 153 |
|
75 | 154 | <ItemGroup>
|
76 | 155 | <WasmSatelliteAssemblies Include="$(PublishDir)*\*.resources.dll" />
|
77 |
| - <WasmSatelliteAssemblies> |
78 |
| - <CultureName>$([System.IO.Directory]::GetParent('%(Identity)').Name)</CultureName> |
79 |
| - </WasmSatelliteAssemblies> |
| 156 | + <WasmSatelliteAssemblies CultureName="$([System.IO.Directory]::GetParent('%(Identity)').Name)" /> |
80 | 157 |
|
81 | 158 | <WasmAssembliesToBundle Include="$(PublishDir)\*.dll"/>
|
82 | 159 |
|
83 | 160 | <WasmFilesToIncludeInFileSystem Include="@(ContentWithTargetPath)" />
|
84 |
| - <WasmFilesToIncludeInFileSystem Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.BuildReference)' == 'true' and !$([System.String]::new('%(ReferenceCopyLocalPaths.Identity)').EndsWith('.resources.dll'))" /> |
85 |
| - <WasmFilesToIncludeInFileSystem Include="@(WasmSatelliteAssemblies)" TargetPath="%(WasmSatelliteAssemblies.CultureName)\%(WasmSatelliteAssemblies.Filename)%(WasmSatelliteAssemblies.Extension)" /> |
| 161 | + <WasmFilesToIncludeInFileSystem |
| 162 | + Include="@(WasmSatelliteAssemblies)" |
| 163 | + TargetPath="%(WasmSatelliteAssemblies.CultureName)\%(WasmSatelliteAssemblies.FileName)%(WasmSatelliteAssemblies.Extension)" |
| 164 | + Condition="'$(IncludeSatelliteAssembliesInVFS)' == 'true'" /> |
| 165 | + |
| 166 | + <_CopyLocalPaths |
| 167 | + Include="@(PublishItemsOutputGroupOutputs)" |
| 168 | + Condition="'%(PublishItemsOutputGroupOutputs.BuildReference)' == 'true' and |
| 169 | + !$([System.String]::new('%(PublishItemsOutputGroupOutputs.Identity)').EndsWith('.resources.dll'))" /> |
| 170 | + |
| 171 | + <_CopyLocalPaths TargetPath="%(_CopyLocalPaths.RelativePath)" Condition="'%(_CopyLocalPaths.RelativePath)' != ''" /> |
| 172 | + <_CopyLocalPaths TargetPath="%(FileName)%(Extension)" Condition="'%(_CopyLocalPaths.RelativePath)' == ''" /> |
| 173 | + <WasmFilesToIncludeInFileSystem Include="@(_CopyLocalPaths)" /> |
| 174 | + |
86 | 175 | <!-- Include files specified by test projects from publish dir -->
|
87 |
| - <WasmFilesToIncludeInFileSystem Include="@(WasmFilesToIncludeFromPublishDir -> '$(PublishDir)%(Identity)')" /> |
| 176 | + <WasmFilesToIncludeInFileSystem |
| 177 | + Include="$(PublishDir)%(WasmFilesToIncludeFromPublishDir.Identity)" |
| 178 | + TargetPath="%(WasmFilesToIncludeFromPublishDir.Identity)" |
| 179 | + Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" /> |
88 | 180 | </ItemGroup>
|
89 | 181 | </Target>
|
90 | 182 |
|
|
0 commit comments