Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Make WasmMainJSPath optional #81484

Merged
merged 28 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
01c23ea
Drop WasmMainJSPath.
maraf Jan 31, 2023
256834a
Drop WasmMainJSPath (2).
maraf Feb 1, 2023
afbf3f5
Include test-main in tests.
maraf Feb 1, 2023
f53ca6d
Merge remote-tracking branch 'upstream/main' into WasmMainJsPath
maraf Feb 1, 2023
50b7390
Fix WBT.
maraf Feb 3, 2023
5af5b18
Hotfix tests. Needs a better solution..
maraf Feb 3, 2023
485e8c0
Fix FunctionalTests.
maraf Feb 6, 2023
faaa2cf
Fix unit tests.
maraf Feb 6, 2023
4535cfb
Merge branch 'main' into WasmMainJsPath
maraf Feb 6, 2023
0649672
Move tests related changes to tests.browser.targets.
maraf Feb 7, 2023
8ee36eb
Fix threads sample.
maraf Feb 7, 2023
caf9566
Fix debugger tests.
maraf Feb 7, 2023
d17ed53
Merge remote-tracking branch 'upstream/main' into WasmMainJsPath
maraf Feb 8, 2023
d3cbbbf
Fix WBT.
maraf Feb 8, 2023
1cf8669
Fix functional tests.
maraf Feb 9, 2023
abef264
Try to fix runtime-tests?
maraf Feb 14, 2023
8ae09d9
Merge remote-tracking branch 'upstream/main' into WasmMainJsPath
maraf Feb 14, 2023
0561ac9
Try to fix runtime-tests? (2)
maraf Feb 15, 2023
20d7bf3
Try to fix runtime-tests? (3)
maraf Feb 15, 2023
d1945eb
Deduplicate index.html.
maraf Feb 15, 2023
dc25824
Try to put test-index.html beside test-main.js
maraf Feb 16, 2023
8a5106b
Revert "Try to put test-index.html beside test-main.js"
maraf Feb 16, 2023
635aabc
Feedback.
maraf Feb 22, 2023
1f2d7b0
Drop docs for WasmMainJSPath.
maraf Feb 22, 2023
d8e0600
Add WasmMainJSPath to WasmExtraFilesToDeploy.
maraf Feb 23, 2023
76e70fa
Merge remote-tracking branch 'upstream/main' into WasmMainJsPath
maraf Feb 23, 2023
d18af73
Merge branch 'main' into WasmMainJsPath
radical Feb 24, 2023
0b77fdb
Drop not necessary WasmExtraFilesToDeploy.
maraf Feb 27, 2023
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
7 changes: 7 additions & 0 deletions eng/testing/tests.browser.targets
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
<WasmAppDir>$(BundleDir)</WasmAppDir>
<WasmMainAssemblyFileName Condition="'$(WasmMainAssemblyFileName)' == ''">WasmTestRunner.dll</WasmMainAssemblyFileName>
<WasmMainJSPath Condition="'$(WasmMainJSPath)' == ''">$(MonoProjectRoot)\wasm\test-main.js</WasmMainJSPath>
<WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</WasmMainJSFileName>
<WasmMainHtmlPath>$(PublishDir)index.html</WasmMainHtmlPath>
<WasmInvariantGlobalization>$(InvariantGlobalization)</WasmInvariantGlobalization>
<WasmGenerateRunV8Script>true</WasmGenerateRunV8Script>

Expand All @@ -148,6 +150,9 @@
</ItemGroup>

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

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

Expand All @@ -166,6 +171,8 @@
TargetPath="%(WasmFilesToIncludeFromPublishDir.Identity)"
Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" />
</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)')"/>
pavelsavara marked this conversation as resolved.
Show resolved Hide resolved
</Target>

<Target Name="_PrepareForAOTOnHelix">
Expand Down
1 change: 0 additions & 1 deletion src/mono/sample/mbr/browser/WasmDelta.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<OutputPath>bin</OutputPath>

<WasmAppDir>$(MSBuildProjectDirectory)\bin\$(Configuration)\AppBundle\</WasmAppDir>
<WasmMainJSPath>main.js</WasmMainJSPath>
<EnableDefaultItems>false</EnableDefaultItems>

<!-- Important - deltas don't support trimming! -->
Expand Down
2 changes: 1 addition & 1 deletion src/mono/sample/wasi/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
</Target>

<Import Project="$(RepositoryEngineeringDir)testing\wasi-provisioning.targets" />
</Project>
</Project>
1 change: 0 additions & 1 deletion src/mono/sample/wasm/DefaultBrowserSample.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>
<PropertyGroup>
<WasmCopyAppZipToHelixTestDir Condition="'$(ArchiveTests)' == 'true'">true</WasmCopyAppZipToHelixTestDir>
<WasmMainJSPath>main.js</WasmMainJSPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<!-- note that enabling debugger disables interp optimizations -->
Expand Down
14 changes: 9 additions & 5 deletions src/mono/sample/wasm/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,30 @@
bin/$(Configuration)/AppBundle/dotnet.wasm;
bin/$(Configuration)/AppBundle/$(_WasmMainJSFileName);
">
<Error Condition="'$(WasmMainJSPath)' == ''" Text="%24(WasmMainJSPath) property needs to be set" />
<PropertyGroup>
<_ScriptExt Condition="'$(OS)' == 'Windows_NT'">.cmd</_ScriptExt>
<_ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh</_ScriptExt>
<_Dotnet>$(RepoRoot)dotnet$(_ScriptExt)</_Dotnet>
<_AOTFlag Condition="'$(RunAOTCompilation)' != ''">/p:RunAOTCompilation=$(RunAOTCompilation)</_AOTFlag>
<_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</_WasmMainJSFileName>
<_SampleProject Condition="'$(_SampleProject)' == ''">$(MSBuildProjectFile)</_SampleProject>
<_SampleAssembly Condition="'$(_SampleAssembly)' == ''">$(TargetFileName)</_SampleAssembly>
<BuildAdditionalArgs Condition="'$(MonoDiagnosticsMock)' != ''">$(BuildAdditionalArgs) /p:MonoDiagnosticsMock=$(MonoDiagnosticsMock) </BuildAdditionalArgs>
</PropertyGroup>
<Exec Command="$(_Dotnet) publish -bl /p:Configuration=$(Configuration) /p:TargetArchitecture=wasm /p:TargetOS=browser $(_AOTFlag) $(_SampleProject) $(BuildAdditionalArgs)" />
</Target>
<Target Name="RunSampleWithV8" DependsOnTargets="BuildSampleInTree">
<Target Name="_ComputeMainJSPath">
maraf marked this conversation as resolved.
Show resolved Hide resolved
<Error Condition="'$(WasmMainJSPath)' == ''" Text="%24(WasmMainJSPath) property needs to be set" />
<PropertyGroup>
<_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</_WasmMainJSFileName>
</PropertyGroup>
</Target>
<Target Name="RunSampleWithV8" DependsOnTargets="BuildSampleInTree;_ComputeMainJSPath">
<Exec WorkingDirectory="bin/$(Configuration)/AppBundle" Command="v8 --expose_wasm $(_WasmMainJSFileName) -- $(DOTNET_MONO_LOG_LEVEL) --run $(_SampleAssembly) $(Args)" IgnoreExitCode="true" />
</Target>
<Target Name="RunSampleWithNode" DependsOnTargets="BuildSampleInTree">
<Target Name="RunSampleWithNode" DependsOnTargets="BuildSampleInTree;_ComputeMainJSPath">
<Exec WorkingDirectory="bin/$(Configuration)/AppBundle" Command="node --expose_wasm $(_WasmMainJSFileName) -- $(DOTNET_MONO_LOG_LEVEL) --run $(_SampleAssembly) $(Args)" IgnoreExitCode="true" />
</Target>
<Target Name="DebugSampleWithNode" DependsOnTargets="BuildSampleInTree">
<Target Name="DebugSampleWithNode" DependsOnTargets="BuildSampleInTree;_ComputeMainJSPath">
<Exec WorkingDirectory="bin/$(Configuration)/AppBundle" Command="node --expose_wasm $(_WasmMainJSFileName) -- $(DOTNET_MONO_LOG_LEVEL) --run $(_SampleAssembly) $(Args) --inspect=9222" IgnoreExitCode="true" />
</Target>
<Target Name="CheckServe">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<WasmProfilers>browser;</WasmProfilers>
</PropertyGroup>
<ItemGroup>
<WasmExtraFilesToDeploy Include="main.js" />
<!-- add export GL object from Module -->
<EmccExportedRuntimeMethod Include="GL" />
<NativeFileReference Include="fibonacci.c" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<!-- don't need to run this on helix -->
<WasmCopyAppZipToHelixTestDir>false</WasmCopyAppZipToHelixTestDir>
<WasmMainJSPath>main.js</WasmMainJSPath>
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<EnableAggressiveTrimming Condition="'$(EnableAOTAndTrimming)' != ''">$(EnableAOTAndTrimming)</EnableAggressiveTrimming>
Expand All @@ -13,6 +12,7 @@

<ItemGroup>
<WasmExtraFilesToDeploy Include="index.html" />
<WasmExtraFilesToDeploy Include="main.js" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding these in the various places outside the wasm targets can be dropped now.

<WasmExtraFilesToDeploy Include="appstart-frame.html" />
<WasmExtraFilesToDeploy Include="frame-main.js" />
<WasmExtraFilesToDeploy Include="style.css" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WasmCopyAppZipToHelixTestDir>false</WasmCopyAppZipToHelixTestDir>
<WasmMainJSPath>package.json</WasmMainJSPath>
<WasmAppDir>public</WasmAppDir>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WasmCopyAppZipToHelixTestDir Condition="'$(ArchiveTests)' == 'true'">true</WasmCopyAppZipToHelixTestDir>
<WasmMainJSPath>main.js</WasmMainJSPath>
<WasmProfilers>aot;</WasmProfilers>
<WasmBuildNative>true</WasmBuildNative>
<WasmNativeStrip>false</WasmNativeStrip>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="index.html" />
<WasmExtraFilesToDeploy Include="main.js" />
</ItemGroup>

<Target Name="RunSample" DependsOnTargets="RunSampleWithBrowser" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<WasmEnableThreads>true</WasmEnableThreads>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="main.js" />
</ItemGroup>

<!-- set the condition to false and you will get a CA1416 error about the call to Thread.Start from a browser-wasm project -->
<ItemGroup Condition="true">
<!-- TODO: some .props file that automates this. Unfortunately just adding a ProjectReference to Microsoft.NET.WebAssembly.Threading.proj doesn't work - it ends up bundling the ref assemblies into the publish directory and breaking the app. -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WasmCopyAppZipToHelixTestDir>false</WasmCopyAppZipToHelixTestDir>
<WasmMainJSPath>main.js</WasmMainJSPath>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="index.html" />
<WasmExtraFilesToDeploy Include="main.js" />
</ItemGroup>


Expand Down
3 changes: 3 additions & 0 deletions src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\DefaultBrowserSample.targets" />
<ItemGroup>
<WasmExtraFilesToDeploy Include="main.js" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WasmCopyAppZipToHelixTestDir>false</WasmCopyAppZipToHelixTestDir>
<!-- Workaround before https://github.com/dotnet/runtime/issues/63465 is solved. -->
<WasmMainJSPath>tsconfig.json</WasmMainJSPath>
</PropertyGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="main.mjs" />
<WasmExtraFilesToDeploy Include="package.json" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<RunScriptCommand>$(ExecXHarnessCmd) wasm test --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --engine-arg=--module --js-file=main.mjs --output-directory=$(XHarnessOutput) -- --run $(MSBuildProjectName).dll</RunScriptCommand>
</PropertyGroup>

<ItemGroup>
<WasmExtraFilesToDeploy Include="main.mjs" />
</ItemGroup>

<Target Name="RunSample" DependsOnTargets="RunSampleWithV8" />
</Project>
1 change: 0 additions & 1 deletion src/mono/sample/wasm/simple-raytracer/RayTracer.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WasmMainJSPath>main.js</WasmMainJSPath>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>preview</LangVersion>
Expand Down
34 changes: 27 additions & 7 deletions src/mono/wasm/Wasm.Build.Tests/BuildTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp
extraProperties += "<WasmEnableWebcil>true</WasmEnableWebcil>\n";
}

extraItems += "<WasmExtraFilesToDeploy Include='test-main.js' />";
extraItems += "<WasmExtraFilesToDeploy Include='index.html' />";

string projectContents = projectTemplate
.Replace("##EXTRA_PROPERTIES##", extraProperties)
.Replace("##EXTRA_ITEMS##", extraItems)
Expand Down Expand Up @@ -378,6 +381,8 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp
File.Copy(Path.Combine(AppContext.BaseDirectory,
options.TargetFramework == "net8.0" ? "test-main.js" : "data/test-main-7.0.js"),
Path.Combine(_projectDir, "test-main.js"));

File.WriteAllText(Path.Combine(_projectDir!, "index.html"), @"<html><body><script type=""module"" src=""test-main.js""></script></body></html>");
}
else if (_projectDir is null)
{
Expand Down Expand Up @@ -431,7 +436,8 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp
options.TargetFramework ?? DefaultTargetFramework,
options.HasIcudt,
options.DotnetWasmFromRuntimePack ?? !buildArgs.AOT,
UseWebcil);
UseWebcil,
options.IsBrowserProject);
}

if (options.UseCache)
Expand Down Expand Up @@ -499,7 +505,15 @@ public string CreateWasmTemplateProject(string id, string template = "wasmbrowse
extraProperties += "<RunAnalyzers>true</RunAnalyzers>";
if (UseWebcil)
extraProperties += "<WasmEnableWebcil>true</WasmEnableWebcil>";
AddItemsPropertiesToProject(projectfile, extraProperties);

// TODO: Can be removed after updated templates propagate in.
string extraItems = string.Empty;
if (template == "wasmbrowser")
extraItems += "<WasmExtraFilesToDeploy Include=\"main.js\" />";
else
extraItems += "<WasmExtraFilesToDeploy Include=\"main.mjs\" />";

AddItemsPropertiesToProject(projectfile, extraProperties, extraItems);

return projectfile;
}
Expand Down Expand Up @@ -635,17 +649,22 @@ protected static void AssertBasicAppBundle(string bundleDir,
string targetFramework,
bool hasIcudt = true,
bool dotnetWasmFromRuntimePack = true,
bool useWebcil = true)
bool useWebcil = true,
bool isBrowserProject = true)
{
AssertFilesExist(bundleDir, new []
var filesToExist = new List<string>()
{
"index.html",
mainJS,
"dotnet.timezones.blat",
"dotnet.wasm",
"mono-config.json",
"dotnet.js"
});
};

if (isBrowserProject)
filesToExist.Add("index.html");

AssertFilesExist(bundleDir, filesToExist);

AssertFilesExist(bundleDir, new[] { "run-v8.sh" }, expectToExist: hasV8Script);
AssertFilesExist(bundleDir, new[] { "icudt.dat" }, expectToExist: hasIcudt);
Expand Down Expand Up @@ -693,7 +712,7 @@ protected static void AssertDotNetJsSymbols(string bundleDir, bool fromRuntimePa
protected static void AssertFilesDontExist(string dir, string[] filenames, string? label = null)
=> AssertFilesExist(dir, filenames, label, expectToExist: false);

protected static void AssertFilesExist(string dir, string[] filenames, string? label = null, bool expectToExist=true)
protected static void AssertFilesExist(string dir, IEnumerable<string> filenames, string? label = null, bool expectToExist=true)
{
string prefix = label != null ? $"{label}: " : string.Empty;
if (!Directory.Exists(dir))
Expand Down Expand Up @@ -1120,6 +1139,7 @@ public record BuildProjectOptions
string? Label = null,
string? TargetFramework = null,
string? MainJS = null,
bool IsBrowserProject = true,
IDictionary<string, string>? ExtraBuildEnvironmentVariables = null
);

Expand Down
12 changes: 8 additions & 4 deletions src/mono/wasm/Wasm.Build.Tests/WasmTemplateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public void ConsoleBuildThenPublish(string config)
HasV8Script: false,
MainJS: "main.mjs",
Publish: false,
TargetFramework: BuildTestBase.DefaultTargetFramework
TargetFramework: BuildTestBase.DefaultTargetFramework,
IsBrowserProject: false
));

AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "AppBundle"), fromRuntimePack: true, targetFramework: DefaultTargetFramework);
Expand All @@ -174,7 +175,8 @@ public void ConsoleBuildThenPublish(string config)
MainJS: "main.mjs",
Publish: true,
TargetFramework: BuildTestBase.DefaultTargetFramework,
UseCache: false));
UseCache: false,
IsBrowserProject: false));

AssertDotNetJsSymbols(Path.Combine(GetBinDir(config), "AppBundle"), fromRuntimePack: !expectRelinking, targetFramework: DefaultTargetFramework);
}
Expand Down Expand Up @@ -216,7 +218,8 @@ private void ConsoleBuildAndRun(string config, bool relinking, string extraNewAr
HasV8Script: false,
MainJS: "main.mjs",
Publish: false,
TargetFramework: expectedTFM
TargetFramework: expectedTFM,
IsBrowserProject: false
));

AssertDotNetJsSymbols(Path.Combine(GetBinDir(config, expectedTFM), "AppBundle"), fromRuntimePack: !relinking, targetFramework: expectedTFM);
Expand Down Expand Up @@ -388,7 +391,8 @@ public void ConsolePublishAndRun(string config, bool aot, bool relinking)
MainJS: "main.mjs",
Publish: true,
TargetFramework: BuildTestBase.DefaultTargetFramework,
UseCache: false));
UseCache: false,
IsBrowserProject: false));

if (!aot)
{
Expand Down
1 change: 0 additions & 1 deletion src/mono/wasm/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ The various task inputs correspond to properties as:

AppDir : $(WasmAppDir)
MainAssembly : $(WasmMainAssemblyPath)
MainJS : $(WasmMainJSPath)
InvariantGlobalization : $(WasmInvariantGlobalization)
SatelliteAssemblies : @(WasmSatelliteAssemblies)
FilesToIncludeInFileSystem : @(WasmFilesToIncludeInFileSystem)
Expand Down
10 changes: 4 additions & 6 deletions src/mono/wasm/build/WasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

<!--
Required public items/properties:
- $(WasmMainJSPath)

- $(EMSDK_PATH) - points to the emscripten sdk location.

Public properties (optional):
- $(WasmMainJSPath) - Main JavaScript for execution on V8/node
maraf marked this conversation as resolved.
Show resolved Hide resolved
- $(WasmAppDir) - AppBundle dir (Defaults to `$(OutputPath)\$(Configuration)\AppBundle`)
- $(WasmMainAssemblyFileName)- Defaults to $(TargetFileName)
- $(WasmBuildNative) - Whenever to build the native executable. Defaults to false.
Expand Down Expand Up @@ -342,11 +341,10 @@
</Target>

<Target Name="_WasmGenerateAppBundle"
Inputs="@(_WasmAssembliesInternal);$(WasmMainJSPath);$(WasmIcuDataFileName);@(WasmNativeAsset)"
Inputs="@(_WasmAssembliesInternal);$(WasmIcuDataFileName);@(WasmNativeAsset)"
maraf marked this conversation as resolved.
Show resolved Hide resolved
Outputs="$(WasmAppDir)\.stamp"
Condition="'$(WasmGenerateAppBundle)' == 'true'"
DependsOnTargets="_WasmGenerateRuntimeConfig;_GetWasmGenerateAppBundleDependencies">
<Error Condition="'$(WasmMainJSPath)' == ''" Text="%24(WasmMainJSPath) property needs to be set" />

<PropertyGroup>
<_WasmAppIncludeThreadsWorker Condition="'$(WasmEnableThreads)' == 'true' or '$(WasmEnablePerfTracing)' == 'true'">true</_WasmAppIncludeThreadsWorker>
Expand All @@ -357,8 +355,6 @@
<RemoveDir Directories="$(WasmAppDir)" />
<WasmAppBuilder
AppDir="$(WasmAppDir)"
MainJS="$(WasmMainJSPath)"
MainHTMLPath="$(WasmMainHTMLPath)"
maraf marked this conversation as resolved.
Show resolved Hide resolved
Assemblies="@(_WasmAssembliesInternal)"
MainAssemblyName="$(WasmMainAssemblyFileName)"
HostConfigs="@(HostConfig)"
Expand Down Expand Up @@ -389,6 +385,8 @@
</Target>

<Target Name="_GenerateRunV8Script">
<Error Condition="'$(WasmMainJSPath)' == ''" Text="%24(WasmMainJSPath) property needs to be set" />

<PropertyGroup>
<WasmRunV8ScriptPath Condition="'$(WasmRunV8ScriptPath)' == ''">$(WasmAppDir)run-v8.sh</WasmRunV8ScriptPath>
<_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</_WasmMainJSFileName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<PropertyGroup>
<EnableDefaultWasmAssembliesToBundle>false</EnableDefaultWasmAssembliesToBundle>
<WasmAppDir>$(AppDir)</WasmAppDir>
<WasmMainJSPath>debugger-main.js</WasmMainJSPath>
<!-- -1 enabled debugging and disables debug logging. -->
<WasmDebugLevel Condition="'$(WasmDebugLevel)'==''">-1</WasmDebugLevel>
<WasmResolveAssembliesBeforeBuild>true</WasmResolveAssembliesBeforeBuild>
Expand All @@ -78,6 +77,7 @@
<!-- Assemblies only dynamically loaded -->
<WasmFilesToIncludeInFileSystem Include="$(OutDir)\%(_AssemblyForDynamicLoading.Identity).dll" />

<WasmExtraFilesToDeploy Include="debugger-main.js" />
<WasmExtraFilesToDeploy Include="$(OutDir)\%(_AssemblyForDynamicLoading.Identity).*" />
<WasmExtraFilesToDeploy Include="$(OutDir)\lazy-debugger-test-embedded.*" />
<WasmExtraFilesToDeploy Include="@(ReferenceCopyLocalPaths)" />
Expand Down
Loading