Disentangle and align flutter build web --wasm flags (#143517)

* Make `flutter build web` have one option that determins the
optimization level: `-O<level>` / `--optimization-level=<level>` =>
Defaulting to -O4 => Will apply to both dart2js and dart2wasm

* Deprecate `--dart2js-optimization=O<level>`

* Disentagle concept of optimization from concept of static symbols =>
Add a `--strip-wasm` / `--no-strip-wasm` flag that determins whether
static symbols are kept in the resulting wasm file.

* Remove copy&past'ed code in the tests for wasm build tests

* Cleanup some artifacts code, now that we no longer use `wasm-opt`
inside flutter tools
This commit is contained in:
Martin Kustermann
2024-02-15 21:39:58 +01:00
committed by GitHub
parent 2d4f5a65c4
commit 178898e45d
7 changed files with 124 additions and 299 deletions

View File

@@ -34,9 +34,9 @@ Future<TaskResult> runWebBenchmark(WebBenchmarkOptions benchmarkOptions) async {
await evalFlutter('build', options: <String>[
'web',
if (benchmarkOptions.useWasm) ...<String>[
'--O4',
'--wasm',
'--wasm-opt=debug',
'--omit-type-checks',
'--no-strip-wasm',
],
'--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true',
if (!benchmarkOptions.useWasm) '--web-renderer=${benchmarkOptions.webRenderer}',