diff options
author | Ankit Jain <radical@gmail.com> | 2020-12-15 01:13:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 01:13:38 +0300 |
commit | 448bc55aa671b2bde8469d61d0ba64316c9e53e7 (patch) | |
tree | 9e25405f2ef75cf71c57717d1023a175cc59f299 /src/tasks/WasmAppBuilder/WasmAppBuilder.cs | |
parent | 7871506dd2cde0470ac5d6877daa5e7b7a2149f4 (diff) |
[wasm] Move Wasm app building targets to new WasmApp.targets (#45977)
* [wasm] Don't quote multiple msbuild args
Else it ends up in the command line as:
`dotnet build foo.proj "/p:TargetOS=Browser /p:Configuration=Release"`
instead of
`dotnet build foo.proj /p:TargetOS=Browser /p:Configuration=Release`
* [wasm] Fix the name for MicrosoftNetCoreAppRuntimePackRidDir
We have `MicrosoftNetCoreAppRuntimePackDir=artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/`
.. and `MicrosoftNetCoreAppRuntimePack*Rid*Dir` as `$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/browser-wasm/`.
But the wasm samples, and debugger test project files mixed up the
naming, though with correct paths. The following commit will move the
wasm build stuff to a single file, and this change will be useful to
have uniform, and correct naming.
* [wasm] Add new `WasmApp.targets`
Move the uses of `WasmAppBuilder`, and
`WasmLoadAssembliesAndReferences` tasks to a single targets file -
`src/mono/wasm/build/WasmApp.targets`.
- Any project that wants to use that, can import the file, and set up the
various properties before the target `WasmBuildApp` gets executed.
- `WasmBuildApp` is not run by default. The importing project will have
to do that.
- By default, the `WasmLoadAssembliesAndReferences` task is not run, and
the specified `@(WasmAssembliesToBundle)` are directly passed to
`WasmAppBuilder`.
- If the project needs assembly dependencies to be resolved, then
set `$(WasmResolveAssembliesBeforeBuild) == true`.
- Assemblies to be bundled with the app are set via
`@(WasmAssembliesToBundle)` (which optionally will have dependencies
resolved)
The various task inputs correspond to properties as:
```
AssemblySearchPaths : @(WasmAssemblySearchPaths)
Assemblies : @(WasmAssembliesToBundle)
AppDir : $(WasmAppDir)
MicrosoftNetCoreAppRuntimePackDir : $(MicrosoftNetCoreAppRuntimePackRidDir)
MainAssembly : $(WasmMainAssemblyPath)
MainJS : $(WasmMainJSPath)
InvariantGlobalization : $(WasmInvariantGlobalization)
SatelliteAssemblies : @(WasmSatelliteAssemblies)
FilesToIncludeInFileSystem : @(WasmFilesToIncludeInFileSystem)
DebugLevel : $(WasmDebugLevel)
```
This should be a step towards eventually having this build as a sdk.
* [wasm] Use the correct assembly path property
* Check for TargetOS==Browser
* Pass remaining WasmAppBuilder args - IcuDataFileName, and RemoteSources
* WasmAppBuilder: don't emit run-v8.sh in the task
* WasmTestRunner: use the new WasmApp.targets
* Include WasmMainAssemblyPath for dependency resolution, by default
* Remove unused run-v8.sh generation
* Add back run-v8.sh for console sample, WasmTestRunner, and lib tests
* WasmApp.targets: Use a default path for run-v8.sh
.. and control it's generation through `$(WasmGenerateRunV8Script)`
* run-v8.sh: use only the filename on the command line
* update README.md
* [wasm] Make the wasm targets conditional on `TargetOS==Browser`
.. instead of conditionally importing `WasmApp.targets`. This allows
other targets to depend on wasm targets, and execute only if it makes
sense.
Based on @lewing's feedback.
* [wasm][tests] fix check for when to generate run-v8.sh
* WasmTestRunner.proj: fix typo
* [wasm] Always generate the run-v8.sh script, for browser runs
The `Scenario==WasmTestOnBrowser` seems to fail for JIT tests, which
don't use the browser.
* [wasm] Fix tests
The real issue seems to be that the helix bundle doesn't have
`WasmApp.targets`. Fixing that, which should hopefully fix the tests!
* [wasm] Another attempt at fixing the tests
Mimic earlier behavior of having a `BundleTestWasmApp`, and making it
conditional on `TargetOS == Browser`.
* fix property reference
* [wasm] skip missing assemblies for the jit tests, same as the original code
Diffstat (limited to 'src/tasks/WasmAppBuilder/WasmAppBuilder.cs')
-rw-r--r-- | src/tasks/WasmAppBuilder/WasmAppBuilder.cs | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index 8a393732cbb..b1cd526fb44 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -236,13 +236,6 @@ public class WasmAppBuilder : Task } _fileWrites.Add(monoConfigPath); - string runv8Path = Path.Join(AppDir, "run-v8.sh"); - using (var sw = File.CreateText(runv8Path)) - { - sw.WriteLine("v8 --expose_wasm runtime.js -- --run " + Path.GetFileName(MainAssembly) + " $*"); - } - _fileWrites.Add(runv8Path); - return true; } |