Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 0acc7dd

Browse files
committed
[et] Add support for building Dart SDK from source
1 parent 012029e commit 0acc7dd

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

tools/engine_tool/lib/src/commands/build_command.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ final class BuildCommand extends CommandBase {
3131
);
3232
addConcurrencyOption(argParser);
3333
addRbeOptions(argParser, environment);
34+
addDartBuildOptions(argParser, environment);
3435
argParser.addFlag(
3536
ltoFlag,
3637
help: 'Whether LTO should be enabled for a build. Default is disabled',
@@ -75,9 +76,14 @@ et build //flutter/fml:fml_benchmarks # Build a specific target in `//flutter/f
7576
return 1;
7677
}
7778

79+
final bool buildDartFull = argResults![buildDartFullFlag] as bool;
80+
final bool buildDart = argResults![buildDartFlag] as bool || buildDartFull;
81+
7882
final List<String> extraGnArgs = <String>[
7983
if (!useRbe) '--no-rbe',
8084
if (useLto) '--lto' else '--no-lto',
85+
if (buildDart) '--no-prebuilt-dart-sdk',
86+
if (buildDartFull) '--full-dart-sdk',
8187
];
8288

8389
final List<String> commandLineTargets = argResults!.rest;

tools/engine_tool/lib/src/commands/command.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,15 @@ void addRbeOptions(ArgParser parser, Environment environment) {
9494
defaultsTo: buildStrategyFlagValueAuto,
9595
);
9696
}
97+
98+
/// Adds the --build-dart and --build-dart-full flags.
99+
void addDartBuildOptions(ArgParser parser, Environment environment) {
100+
parser.addFlag(
101+
buildDartFlag,
102+
help: 'Build Dart from source',
103+
);
104+
parser.addFlag(
105+
buildDartFullFlag,
106+
help: 'Build the full Dart SDK from source',
107+
);
108+
}

tools/engine_tool/lib/src/commands/flags.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
// Keep this list alphabetized.
1414
const String allFlag = 'all';
15+
const String buildDartFlag = 'build-dart';
16+
const String buildDartFullFlag = 'build-dart-full';
1517
const String builderFlag = 'builder';
1618
const String concurrencyFlag = 'concurrency';
1719
const String configFlag = 'config';

0 commit comments

Comments
 (0)