mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 22:19:49 +00:00
[dart2wasm] Allow the user to specify the path of the js runtime file.
Change-Id: Iceb0428f70c77d34daa675e199abf670542babb0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/295220 Reviewed-by: Joshua Litt <joshualitt@google.com> Commit-Queue: Jackson Gardner <jacksongardner@google.com>
This commit is contained in:
parent
9466e8d53d
commit
3015fd34fd
|
@ -64,6 +64,8 @@ final List<Option> options = [
|
|||
StringOption("multi-root-scheme", (o, value) => o.multiRootScheme = value),
|
||||
UriMultiOption("multi-root", (o, values) => o.multiRoots = values),
|
||||
StringOption("depfile", (o, value) => o.depFile = value),
|
||||
StringOption(
|
||||
"js-runtime-output", (o, value) => o.outputJSRuntimeFile = value),
|
||||
];
|
||||
|
||||
Map<fe.ExperimentalFlag, bool> processFeExperimentalFlags(
|
||||
|
@ -135,7 +137,10 @@ Future<int> main(List<String> args) async {
|
|||
}
|
||||
|
||||
await File(options.outputFile).writeAsBytes(output.wasmModule);
|
||||
await File(options.outputJSRuntimeFile).writeAsString(output.jsRuntime);
|
||||
|
||||
final String outputJSRuntimeFile = options.outputJSRuntimeFile ??
|
||||
'${options.outputFile.substring(0, options.outputFile.lastIndexOf('.'))}.mjs';
|
||||
await File(outputJSRuntimeFile).writeAsString(output.jsRuntime);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -17,8 +17,7 @@ class CompilerOptions {
|
|||
Uri mainUri;
|
||||
String outputFile;
|
||||
String? depFile;
|
||||
late final String outputJSRuntimeFile =
|
||||
'${outputFile.substring(0, outputFile.lastIndexOf('.'))}.mjs';
|
||||
String? outputJSRuntimeFile;
|
||||
Map<String, String> environment = const {};
|
||||
Map<fe.ExperimentalFlag, bool> feExperimentalFlags = const {};
|
||||
String? multiRootScheme;
|
||||
|
|
Loading…
Reference in a new issue