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] Add a --wasmDataDir parameter #1938

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

radical
Copy link
Member

@radical radical commented Mar 11, 2022

In an earlier commit, generated projects got support for importing
props/targets files from the benchmark projects. And that allows
customizing the build.

But there isn't a clean way to inject/add references to the build of the
project, like custom paths, or access to additional files, without
adding new command line parameters.

To solve that, --wasmDataDir param is added which is surfaced in the
generated project as the msbuild property - $(WasmDataDir).

An example use case is to have the wasm js file added to this data dir,
and in the props file use:
<WasmMainJSPath>$(WasmDataDir)test-main.js</WasmMainJSPath>.

In an earlier commit, generated projects got support for importing
props/targets files from the benchmark projects. And that allows
customizing the build.

But there isn't a clean way to inject/add references to the build of the
project, like custom paths, or access to additional files, without
adding new command line parameters.

To solve that, `--wasmDataDir` param is added which is surfaced in the
generated project as the msbuild property - `$(WasmDataDir)`.

An example use case is to have the wasm js file added to this data dir,
and in the props file use:
`<WasmMainJSPath>$(WasmDataDir)test-main.js</WasmMainJSPath>`.
@radical
Copy link
Member Author

radical commented Mar 11, 2022

cc @adamsitnik @lewing @radekdoulik

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @radical !

Before I hit the merge button could you please respond to my question?

@@ -24,14 +26,16 @@ public class WasmRuntime : Runtime, IEquatable<WasmRuntime>
/// <param name="msBuildMoniker">moniker, default: "net5.0"</param>
/// <param name="displayName">default: "Wasm"</param>
/// <param name="aot">Specifies whether AOT or Interpreter (default) project should be generated.</param>
public WasmRuntime(string msBuildMoniker = "net5.0", string displayName = "Wasm", string javaScriptEngine = "v8", string javaScriptEngineArguments = "--expose_wasm", bool aot = false, RuntimeMoniker moniker = RuntimeMoniker.Wasm) : base(moniker, msBuildMoniker, displayName)
/// <param name="wasmDataDir">Specifies a wasm data directory surfaced as $(WasmDataDir) for the project</param>
Copy link
Member

Choose a reason for hiding this comment

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

thank you for adding xml doc comment 👍 (most of our contributors ignore build warnings and don't fix them)

@adamsitnik adamsitnik merged commit 8ce19e6 into dotnet:master Mar 11, 2022
@radical radical deleted the add-wasm-data-dir branch March 11, 2022 18:50
@AndreyAkinshin AndreyAkinshin added this to the v0.13.2 milestone Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants