33// found in the LICENSE file.
44
55import 'dart:async' ;
6- import 'dart:io' show Directory, Platform ;
6+ import 'dart:io' show Directory;
77
88import 'package:args/command_runner.dart' ;
99import 'package:path/path.dart' as path;
@@ -43,14 +43,8 @@ class BuildCommand extends Command<bool> with ArgUtils<bool> {
4343 final FilePath libPath = FilePath .fromWebUi ('lib' );
4444 final List <PipelineStep > steps = < PipelineStep > [
4545 GnPipelineStep (),
46- NinjaPipelineStep (target: environment.engineBuildDir ),
46+ NinjaPipelineStep (target: environment.wasmReleaseOutDir ),
4747 ];
48- if (buildCanvasKit) {
49- steps.addAll (< PipelineStep > [
50- GnPipelineStep (target: 'canvaskit' ),
51- NinjaPipelineStep (target: environment.wasmReleaseOutDir),
52- ]);
53- }
5448 final Pipeline buildPipeline = Pipeline (steps: steps);
5549 await buildPipeline.run ();
5650
@@ -73,39 +67,19 @@ class BuildCommand extends Command<bool> with ArgUtils<bool> {
7367/// Not safe to interrupt as it may leave the `out/` directory in a corrupted
7468/// state. GN is pretty quick though, so it's OK to not support interruption.
7569class GnPipelineStep extends ProcessStep {
76- GnPipelineStep ({this .target = 'engine' })
77- : assert (target == 'engine' || target == 'canvaskit' );
78-
7970 @override
8071 String get description => 'gn' ;
8172
8273 @override
8374 bool get isSafeToInterrupt => false ;
8475
85- /// The target to build with gn.
86- ///
87- /// Acceptable values: engine, canvaskit
88- final String target;
89-
9076 @override
9177 Future <ProcessManager > createProcess () {
92- print ('Running gn for $target ...' );
93- final List <String > gnArgs = < String > [];
94- if (target == 'engine' ) {
95- gnArgs.addAll (< String > [
96- '--unopt' ,
97- if (Platform .isMacOS) '--xcode-symlinks' ,
98- '--full-dart-sdk' ,
99- if (environment.isMacosArm) '--mac-cpu=arm64' ,
100- ]);
101- } else if (target == 'canvaskit' ) {
102- gnArgs.addAll (< String > [
103- '--wasm' ,
104- '--runtime-mode=release' ,
105- ]);
106- } else {
107- throw StateError ('Target was not engine or canvaskit: $target ' );
108- }
78+ print ('Running gn...' );
79+ const List <String > gnArgs = < String > [
80+ '--wasm' ,
81+ '--runtime-mode=release' ,
82+ ];
10983 return startProcess (
11084 path.join (environment.flutterDirectory.path, 'tools' , 'gn' ),
11185 gnArgs,
0 commit comments