@@ -8,6 +8,7 @@ import 'dart:io';
88
99import 'package:bazel_worker/bazel_worker.dart' ;
1010import 'package:build/build.dart' ;
11+ import 'package:build/experiments.dart' ;
1112import 'package:build_modules/build_modules.dart' ;
1213import 'package:path/path.dart' as p;
1314import 'package:scratch_space/scratch_space.dart' ;
@@ -76,9 +77,6 @@ class DevCompilerBuilder implements Builder {
7677 /// Environment defines to pass to ddc (as -D variables).
7778 final Map <String , String > environment;
7879
79- /// Experiments to pass to ddc (as --enable-experiment=<experiment> args).
80- final Iterable <String > experiments;
81-
8280 /// Whether or not strong null safety should be enabled.
8381 final bool soundNullSafety;
8482
@@ -92,7 +90,6 @@ class DevCompilerBuilder implements Builder {
9290 String ? librariesPath,
9391 String ? platformSdk,
9492 this .environment = const {},
95- this .experiments = const [],
9693 this .soundNullSafety = false })
9794 : platformSdk = platformSdk ?? sdkDir,
9895 librariesPath = librariesPath ??
@@ -144,7 +141,6 @@ class DevCompilerBuilder implements Builder {
144141 sdkKernelPath,
145142 librariesPath,
146143 environment,
147- experiments,
148144 soundNullSafety);
149145 } on DartDevcCompilationException catch (e) {
150146 await handleError (e);
@@ -166,7 +162,6 @@ Future<void> _createDevCompilerModule(
166162 String sdkKernelPath,
167163 String librariesPath,
168164 Map <String , String > environment,
169- Iterable <String > experiments,
170165 bool soundNullSafety,
171166 {bool debugMode = true }) async {
172167 var transitiveDeps = await buildStep.trackStage ('CollectTransitiveDeps' ,
@@ -228,7 +223,8 @@ Future<void> _createDevCompilerModule(
228223 '--used-inputs-file=${usedInputsFile .uri .toFilePath ()}' ,
229224 for (var source in module.sources) _sourceArg (source),
230225 for (var define in environment.entries) '-D${define .key }=${define .value }' ,
231- for (var experiment in experiments) '--enable-experiment=$experiment ' ,
226+ for (var experiment in enabledExperiments)
227+ '--enable-experiment=$experiment ' ,
232228 '--${soundNullSafety ? '' : 'no-' }sound-null-safety' ,
233229 ])
234230 ..inputs.add (Input ()
0 commit comments