Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build_web_compilers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 3.2.1-dev
## 3.2.1

- Fix enable-experiment flag support for dartdevc to also pass experiment flags
to dartdevc as well as kernel.
- Add deprecation warning for the old `experiments` config.
- Update `pub run` references to `dart run`.
- Fix `doctor` command warnings for this package.

Expand Down
10 changes: 7 additions & 3 deletions build_web_compilers/lib/builders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ Builder ddcBuilderUnsound(BuilderOptions options) =>
ddcBuilder(options, soundNullSafety: false);

Builder ddcBuilder(BuilderOptions options, {bool soundNullSafety = false}) {
validateOptions(options.config, _supportedOptions, 'build_web_compilers:ddc');
validateOptions(options.config, _supportedOptions, 'build_web_compilers:ddc',
deprecatedOptions: _deprecatedOptions);
_ensureSameDdcOptions(options);

return DevCompilerBuilder(
Expand All @@ -50,7 +51,8 @@ Builder ddcKernelBuilderSound(BuilderOptions options) =>

Builder ddcKernelBuilder(BuilderOptions options,
{bool soundNullSafety = false}) {
validateOptions(options.config, _supportedOptions, 'build_web_compilers:ddc');
validateOptions(options.config, _supportedOptions, 'build_web_compilers:ddc',
deprecatedOptions: _deprecatedOptions);
_ensureSameDdcOptions(options);

return KernelBuilder(
Expand Down Expand Up @@ -135,9 +137,11 @@ const _emitDebugSymbolsOption = 'emit-debug-symbols';
const _trackUnusedInputsCompilerOption = 'track-unused-inputs';
const _environmentOption = 'environment';
const _experimentOption = 'experiments';
const _deprecatedOptions = [
_experimentOption,
];
const _supportedOptions = [
_environmentOption,
_experimentOption,
_useIncrementalCompilerOption,
_generateFullDillOption,
_emitDebugSymbolsOption,
Expand Down
10 changes: 3 additions & 7 deletions build_web_compilers/lib/src/dev_compiler_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'dart:io';

import 'package:bazel_worker/bazel_worker.dart';
import 'package:build/build.dart';
import 'package:build/experiments.dart';
import 'package:build_modules/build_modules.dart';
import 'package:path/path.dart' as p;
import 'package:scratch_space/scratch_space.dart';
Expand Down Expand Up @@ -76,9 +77,6 @@ class DevCompilerBuilder implements Builder {
/// Environment defines to pass to ddc (as -D variables).
final Map<String, String> environment;

/// Experiments to pass to ddc (as --enable-experiment=<experiment> args).
final Iterable<String> experiments;

/// Whether or not strong null safety should be enabled.
final bool soundNullSafety;

Expand All @@ -92,7 +90,6 @@ class DevCompilerBuilder implements Builder {
String? librariesPath,
String? platformSdk,
this.environment = const {},
this.experiments = const [],
this.soundNullSafety = false})
: platformSdk = platformSdk ?? sdkDir,
librariesPath = librariesPath ??
Expand Down Expand Up @@ -144,7 +141,6 @@ class DevCompilerBuilder implements Builder {
sdkKernelPath,
librariesPath,
environment,
experiments,
soundNullSafety);
} on DartDevcCompilationException catch (e) {
await handleError(e);
Expand All @@ -166,7 +162,6 @@ Future<void> _createDevCompilerModule(
String sdkKernelPath,
String librariesPath,
Map<String, String> environment,
Iterable<String> experiments,
bool soundNullSafety,
{bool debugMode = true}) async {
var transitiveDeps = await buildStep.trackStage('CollectTransitiveDeps',
Expand Down Expand Up @@ -228,7 +223,8 @@ Future<void> _createDevCompilerModule(
'--used-inputs-file=${usedInputsFile.uri.toFilePath()}',
for (var source in module.sources) _sourceArg(source),
for (var define in environment.entries) '-D${define.key}=${define.value}',
for (var experiment in experiments) '--enable-experiment=$experiment',
for (var experiment in enabledExperiments)
'--enable-experiment=$experiment',
'--${soundNullSafety ? '' : 'no-'}sound-null-safety',
])
..inputs.add(Input()
Expand Down
2 changes: 1 addition & 1 deletion build_web_compilers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_web_compilers
version: 3.2.1-dev
version: 3.2.1
description: Builder implementations wrapping Dart compilers.
repository: https://github.com/dart-lang/build/tree/master/build_web_compilers

Expand Down