[ddc] Add new build targets for DDC assets
- Introduces a new output subdirectory `gen/utils/ddc` where the
new build targets output files. This is intended to make the
migration to the new assets easier since landing this change
shouldn't immediately break any dependencies.
- Enables building the canary and stable assets at the same time.
- Changes more names in our workflow from "dartdevc" to "ddc".
- Updates the ddc-canary-linux-chrome and
ddc-canary-linux-chrome-unsound configurations to use the
new assets.
The new outputs appear in directories that are more consistently
named, (no more sound vs kernel confusion). They are named in
preparation for the eventual deletion of the unsound targets
without any lingering cruft to be cleaned up in the sound
directories.
The new structure is:
```
gen/utils/ddc/
|- canary
| |- pkg
| |- sdk
|- canary_unsound
| |- pkg
| |- sdk
|- stable
| |- pkg
| |- sdk
|- stable-unsound
|- pkg
|- sdk
```
The 'pkg' and 'sdk' directories all contain outputs with the same
files names, each compiled in the respective build modes
(sound/unsound and stable/canary).
Change-Id: I66822ebf03bba487b6d359a8e0aa818b9e7b6bef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index aaebd13..9329363 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -146,6 +146,11 @@
deps = [ "utils/dartdevc" ]
}
+group("ddc") {
+ # TODO(nshahan): Update to the dartdevc snapshot target when it gets moved.
+ deps = [ "utils/ddc:ddc_stable_test" ]
+}
+
group("analysis_server") {
deps = [ "utils/analysis_server" ]
}
diff --git a/pkg/dev_compiler/tool/ddb b/pkg/dev_compiler/tool/ddb
index f52cc03..b4038cb 100755
--- a/pkg/dev_compiler/tool/ddb
+++ b/pkg/dev_compiler/tool/ddb
@@ -233,8 +233,16 @@
var requirePath = p.join(sdkRoot, 'third_party', 'requirejs');
var sdkOutlineDill = p.join(buildDir,
soundNullSafety ? 'ddc_outline.dill' : 'ddc_outline_unsound.dill');
- var suffix = soundNullSafety ? p.join('sound', mod) : p.join('kernel', mod);
- var sdkJsPath = p.join(buildDir, 'gen', 'utils', 'dartdevc', suffix);
+
+ String sdkJsPath;
+ if (canaryFeatures) {
+ var suffix = soundNullSafety ? '' : '_unsound';
+ sdkJsPath =
+ p.join(buildDir, 'gen', 'utils', 'ddc', 'canary$suffix', 'sdk', mod);
+ } else {
+ var suffix = soundNullSafety ? p.join('sound', mod) : p.join('kernel', mod);
+ sdkJsPath = p.join(buildDir, 'gen', 'utils', 'dartdevc', suffix);
+ }
// Print an initial empty line to separate the invocation from the output.
if (verbose) {
diff --git a/pkg/test_runner/lib/src/browser.dart b/pkg/test_runner/lib/src/browser.dart
index d494221..7174827 100644
--- a/pkg/test_runner/lib/src/browser.dart
+++ b/pkg/test_runner/lib/src/browser.dart
@@ -145,15 +145,30 @@
String testJSDir,
Compiler compiler,
NnbdMode mode,
+ bool canary,
bool nonNullAsserts,
bool weakNullSafetyErrors) {
var testId = pathToJSIdentifier(testName);
var testIdAlias = pathToJSIdentifier(testNameAlias);
var isNnbdStrong = mode == NnbdMode.strong;
- var sdkPath = isNnbdStrong ? 'sound/amd/dart_sdk' : 'kernel/amd/dart_sdk';
- var pkgDir = isNnbdStrong ? 'pkg_sound' : 'pkg_kernel';
+ String ddcConfigGenDir;
+ String sdkPath;
+ String pkgDir;
+ if (canary) {
+ // TODO(nshahan): Cleanup the differences here when migrating the stable
+ // configurations to use the new gen/utils/ddc directories.
+ var nullSafetySuffix = isNnbdStrong ? '' : '_unsound';
+ ddcConfigGenDir = '/root_build/gen/utils/ddc/canary$nullSafetySuffix';
+ sdkPath = 'sdk/amd/dart_sdk';
+ pkgDir = 'pkg';
+ } else {
+ ddcConfigGenDir = '/root_build/gen/utils/dartdevc';
+ sdkPath = isNnbdStrong ? 'sound/amd/dart_sdk' : 'kernel/amd/dart_sdk';
+ pkgDir = isNnbdStrong ? 'pkg_sound' : 'pkg_kernel';
+ }
+
var packagePaths = testPackages
- .map((p) => ' "$p": "/root_build/gen/utils/dartdevc/$pkgDir/$p",')
+ .map((p) => ' "$p": "$ddcConfigGenDir/$pkgDir/$p",')
.join("\n");
return """
@@ -180,7 +195,7 @@
var require = {
baseUrl: "/root_dart/$testJSDir",
paths: {
- "dart_sdk": "/root_build/gen/utils/dartdevc/$sdkPath",
+ "dart_sdk": "$ddcConfigGenDir/$sdkPath",
$packagePaths
},
waitSeconds: 30,
diff --git a/pkg/test_runner/lib/src/build_configurations.dart b/pkg/test_runner/lib/src/build_configurations.dart
index b3f1b5a..20492c0 100644
--- a/pkg/test_runner/lib/src/build_configurations.dart
+++ b/pkg/test_runner/lib/src/build_configurations.dart
@@ -109,10 +109,16 @@
result.add('analyze_snapshot');
}
- if (compiler == Compiler.ddc && !inner.useSdk) {
- result
- ..remove('dartdevc_test')
- ..add('dartdevc_test_local');
+ if (compiler == Compiler.ddc) {
+ if (inner.ddcOptions.contains('--canary')) {
+ result
+ ..remove('dartdevc_test')
+ ..add(inner.useSdk ? 'ddc_canary_test' : 'ddc_canary_test_local');
+ } else if (!inner.useSdk) {
+ result
+ ..remove('dartdevc_test')
+ ..add('dartdevc_test_local');
+ }
}
return result;
diff --git a/pkg/test_runner/lib/src/compiler_configuration.dart b/pkg/test_runner/lib/src/compiler_configuration.dart
index da61615..c59027a 100644
--- a/pkg/test_runner/lib/src/compiler_configuration.dart
+++ b/pkg/test_runner/lib/src/compiler_configuration.dart
@@ -684,9 +684,19 @@
// TODO(sigmund): allow caching of shared packages in legacy mode too.
// Link to the summaries for the available packages, so that they don't
// get recompiled into the test's own module.
- var packageSummaryDir = _configuration.nnbdMode == NnbdMode.strong
- ? 'pkg_sound'
- : 'pkg_kernel';
+ String packageSummaryDir;
+ if (_configuration.ddcOptions.contains('--canary')) {
+ // TODO(nshahan): Cleanup the differences here when migrating the stable
+ // configurations to use the new gen/utils/ddc directories.
+ var nullSafetySuffix =
+ _configuration.nnbdMode == NnbdMode.strong ? '' : '_unsound';
+ packageSummaryDir = 'gen/utils/ddc/canary$nullSafetySuffix/pkg';
+ } else {
+ var pkgDir = _configuration.nnbdMode == NnbdMode.strong
+ ? 'pkg_sound'
+ : 'pkg_kernel';
+ packageSummaryDir = 'gen/utils/dartdevc/$pkgDir';
+ }
for (var package in testPackages) {
args.add("-s");
@@ -694,7 +704,7 @@
// dartdevc explicit module paths for each one. When the test is run, we
// will tell require.js where to find each package's compiled JS.
var summary = Path(_configuration.buildDirectory)
- .append("/gen/utils/dartdevc/$packageSummaryDir/$package.dill")
+ .append('$packageSummaryDir/$package.dill')
.absolute
.toNativePath();
args.add("$summary=$package");
@@ -741,11 +751,22 @@
var dartLibraryPath = repositoryUri
.resolve('pkg/dev_compiler/lib/js/legacy/dart_library.js')
.path;
- var sdkJsDir = Uri.directory(_configuration.buildDirectory)
- .resolve('gen/utils/dartdevc/');
- var sdkJsPath = soundNullSafety
- ? 'sound/legacy/dart_sdk.js'
- : 'kernel/legacy/dart_sdk.js';
+ Uri sdkJsDir;
+ String sdkJsPath;
+ if (_configuration.ddcOptions.contains('--canary')) {
+ // TODO(nshahan): Cleanup the differences here when migrating the stable
+ // configurations to use the new gen/utils/ddc directories.
+ var nullSafetySuffix = soundNullSafety ? '' : '_unsound';
+ sdkJsDir = sdkJsDir = Uri.directory(_configuration.buildDirectory)
+ .resolve('gen/utils/ddc/canary$nullSafetySuffix/sdk/legacy');
+ sdkJsPath = 'dart_sdk.js';
+ } else {
+ sdkJsDir = Uri.directory(_configuration.buildDirectory)
+ .resolve('gen/utils/dartdevc/');
+ sdkJsPath = soundNullSafety
+ ? 'sound/legacy/dart_sdk.js'
+ : 'kernel/legacy/dart_sdk.js';
+ }
var libraryName = inputUri.path
.substring(repositoryUri.path.length)
.replaceAll("/", "__")
diff --git a/pkg/test_runner/lib/src/test_suite.dart b/pkg/test_runner/lib/src/test_suite.dart
index 1060d6b..c32e8d0 100644
--- a/pkg/test_runner/lib/src/test_suite.dart
+++ b/pkg/test_runner/lib/src/test_suite.dart
@@ -967,12 +967,14 @@
testFile.sharedOptions.contains('--null-assertions');
var weakNullSafetyErrors =
testFile.ddcOptions.contains('--weak-null-safety-errors');
+ var ddcCanary = configuration.ddcOptions.contains('--canary');
content = ddcHtml(
nameNoExt,
nameFromModuleRootNoExt,
jsDir,
configuration.compiler,
configuration.nnbdMode,
+ ddcCanary,
nullAssertions,
weakNullSafetyErrors);
}
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index af0ccaa..baba3d6 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -45,6 +45,7 @@
"out/ReleaseX64/dart-sdk/",
"out/ReleaseX64/ddc_outline_unsound.dill",
"out/ReleaseX64/gen/utils/dartdevc/",
+ "out/ReleaseX64/gen/utils/ddc/",
"pkg/",
"runtime/tests/",
"sdk/",
@@ -65,7 +66,8 @@
"third_party/requirejs/",
"tools/",
"xcodebuild/ReleaseARM64/dart-sdk/",
- "xcodebuild/ReleaseARM64/gen/utils/dartdevc/"
+ "xcodebuild/ReleaseARM64/gen/utils/dartdevc/",
+ "xcodebuild/ReleaseARM64/gen/utils/ddc/"
],
"js_platform_hostasserts_2": [
".dart_tool/package_config.json",
@@ -2136,8 +2138,7 @@
"name": "build dart",
"script": "tools/build.py",
"arguments": [
- "dartdevc_test",
- "--gn-args=ddc_canary=true"
+ "ddc_canary_test"
]
},
{
diff --git a/utils/dartdevc/BUILD.gn b/utils/dartdevc/BUILD.gn
index f9777d1..ff1eada 100644
--- a/utils/dartdevc/BUILD.gn
+++ b/utils/dartdevc/BUILD.gn
@@ -8,11 +8,6 @@
import("../application_snapshot.gni")
import("../create_timestamp.gni")
-declare_args() {
- # Enables DDC canary features during compilation to JavaScript.
- ddc_canary = false
-}
-
patched_sdk_dir = "$target_gen_dir/patched_sdk"
sdk_summary = "$target_gen_dir/ddc_sdk.sum"
@@ -32,10 +27,6 @@
rebase_path("../../pkg/dev_compiler/bin/dartdevc.dart"),
]
- if (ddc_canary) {
- training_args += [ "--canary" ]
- }
-
deps = [ ":dartdevc_platform_sound" ]
inputs = [ sdk_outline_sound_dill ]
}
@@ -188,10 +179,6 @@
"package:$module/$module.dart",
]
- if (ddc_canary) {
- args += [ "--canary" ]
- }
-
if (defined(invoker.extra_libraries)) {
foreach(lib, invoker.extra_libraries) {
args += [ "package:$module/$lib.dart" ]
@@ -375,10 +362,6 @@
} else {
args += [ "--no-sound-null-safety" ]
}
-
- if (ddc_canary) {
- args += [ "--canary" ]
- }
}
}
diff --git a/utils/ddc/BUILD.gn b/utils/ddc/BUILD.gn
new file mode 100644
index 0000000..d742a5d
--- /dev/null
+++ b/utils/ddc/BUILD.gn
@@ -0,0 +1,408 @@
+# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import("../../build/dart/dart_action.gni")
+import("../application_snapshot.gni")
+import("../create_timestamp.gni")
+
+sdk_outline_sound_dill = "$root_out_dir/ddc_outline.dill"
+sdk_full_sound_dill = "$root_out_dir/ddc_platform.dill"
+sdk_outline_unsound_dill = "$root_out_dir/ddc_outline_unsound.dill"
+sdk_full_unsound_dill = "$root_out_dir/ddc_platform_unsound.dill"
+
+# Builds everything needed to run tests with DDC (stable) using test.dart.
+group("ddc_stable_test") {
+ deps = [
+ ":ddc_stable_test_local",
+ "../..:create_sdk",
+
+ # TODO(nshahan): Move the dartdevc snapshot target to this file.
+ "../dartdevc:dartdevc",
+ ]
+}
+
+# Builds everything needed to run tests with DDC (canary) using test.dart.
+group("ddc_canary_test") {
+ deps = [
+ ":ddc_canary_test_local",
+ "../..:create_sdk",
+
+ # TODO(nshahan): Move the dartdevc snapshot target to this file.
+ "../dartdevc:dartdevc",
+ ]
+}
+
+# Builds everything needed to run tests with DDC (stable) locally using
+# test.dart without --use-sdk.
+#
+# This is the same as ddc_stable_test, but skips the targets that depend on
+# building the Dart VM and create_sdk.
+group("ddc_stable_test_local") {
+ deps = [
+ ":ddc_stable_sdk",
+ ":ddc_stable_test_pkg",
+ ":ddc_stable_unsound_sdk",
+ ]
+}
+
+# Builds everything needed to run tests with DDC (stable) locally using
+# test.dart without --use-sdk.
+#
+# This is the same as ddc_stable_test,but skips the targets that depend on
+# building the Dart VM and create_sdk.
+group("ddc_canary_test_local") {
+ deps = [
+ ":ddc_canary_sdk",
+ ":ddc_canary_test_pkg",
+ ":ddc_canary_unsound_sdk",
+ ]
+}
+
+create_timestamp_file("ddc_files_stamp") {
+ path = rebase_path("../../pkg/dev_compiler/lib")
+ output = "$target_gen_dir/ddc_files.stamp"
+}
+
+# Compiles to JavaScript using DDC (stable) all packages imported in tests.
+# TODO(sigmund): generate a js bundle or a module that load these indirectly so
+# we can stop referring to this list of packages explicitly in the test_runner.
+group("ddc_stable_test_pkg") {
+ deps = [
+ ":async_helper_stable_js",
+ ":async_helper_stable_unsound_js",
+ ":expect_stable_js",
+ ":expect_stable_unsound_js",
+ ":js_stable_js",
+ ":js_stable_unsound_js",
+ ":meta_stable_js",
+ ":meta_stable_unsound_js",
+ ]
+}
+
+# Compiles to JavaScript using DDC (canary) all packages imported in tests.
+group("ddc_canary_test_pkg") {
+ deps = [
+ ":async_helper_canary_js",
+ ":async_helper_canary_unsound_js",
+ ":expect_canary_js",
+ ":expect_canary_unsound_js",
+ ":js_canary_js",
+ ":js_canary_unsound_js",
+ ":meta_canary_js",
+ ":meta_canary_unsound_js",
+ ]
+}
+
+template("ddc_compile") {
+ assert(defined(invoker.package),
+ "Need 'package' in $target_name (the name of the package)")
+ assert(defined(invoker.sound_null_safety),
+ "Need 'sound_null_safety' in $target_name.")
+
+ # Determine one of four possible directories for the JavaScript output to be
+ # generated:
+ #
+ # out/gen/ddc
+ # |- canary/pkg
+ # |- canary_unsound/pkg
+ # |- stable/pkg
+ # |- stable_unsound/pkg
+ if (invoker.canary) {
+ js_gen_dir = "$target_gen_dir/canary"
+ } else {
+ js_gen_dir = "$target_gen_dir/stable"
+ }
+ if (invoker.sound_null_safety) {
+ platform_dep = "../dartdevc:dartdevc_platform_sound"
+ sdk_outline = sdk_outline_sound_dill
+ js_gen_dir = "$js_gen_dir/pkg"
+ } else {
+ platform_dep = "../dartdevc:dartdevc_platform_unsound"
+ sdk_outline = sdk_outline_unsound_dill
+ js_gen_dir = "${js_gen_dir}_unsound/pkg"
+ }
+
+ # Other optional invoker parameters:
+ # * extra_libraries: entrypoints to include in the module as
+ # "package:package_name/library_name.dart" (the rule implicitly adds
+ # the default import "package:package_name/package_name.dart").
+ # * package_dependencies: the name of other packages this package depends
+ # on. When providing `name`, a separate `ddc_compile` target
+ # named `${name}_js` must exist.
+ # * args: additional args to pass to dartdevc
+
+ prebuilt_dart_action(target_name) {
+ script = "../../pkg/dev_compiler/bin/dartdevc.dart"
+ module = invoker.package
+ out_dir = rebase_path("$js_gen_dir")
+ sdk_path = rebase_path(sdk_outline)
+
+ deps = [
+ ":ddc_files_stamp",
+ platform_dep,
+ ]
+
+ inputs = [
+ sdk_outline,
+ "$target_gen_dir/ddc_files.stamp",
+ ]
+
+ outputs = [
+ "$js_gen_dir/$module.dill",
+ "$js_gen_dir/$module.js",
+ ]
+
+ vm_args = [ "-Dsdk_hash=$sdk_hash" ]
+
+ args = [
+ "--dart-sdk-summary=$sdk_path",
+ "-o$out_dir/$module.js",
+ "package:$module/$module.dart",
+ ]
+
+ if (defined(invoker.extra_libraries)) {
+ foreach(lib, invoker.extra_libraries) {
+ args += [ "package:$module/$lib.dart" ]
+ }
+ }
+
+ if (defined(invoker.package_dependencies)) {
+ foreach(dep, invoker.package_dependencies) {
+ deps += [ ":${dep}_js" ]
+ args += [ "-s$out_dir/$dep.dill" ]
+ }
+ }
+
+ if (defined(invoker.args)) {
+ args += invoker.args
+ }
+
+ if (invoker.sound_null_safety) {
+ args += [ "--sound-null-safety" ]
+ } else {
+ args += [ "--no-sound-null-safety" ]
+ }
+
+ if (invoker.canary) {
+ args += [ "--canary" ]
+ }
+ }
+}
+
+ddc_compile("async_helper_stable_js") {
+ package = "async_helper"
+ canary = false
+ sound_null_safety = true
+}
+
+ddc_compile("async_helper_canary_js") {
+ package = "async_helper"
+ canary = true
+ sound_null_safety = true
+}
+
+ddc_compile("async_helper_stable_unsound_js") {
+ package = "async_helper"
+ canary = false
+ sound_null_safety = false
+}
+
+ddc_compile("async_helper_canary_unsound_js") {
+ package = "async_helper"
+ canary = true
+ sound_null_safety = false
+}
+
+ddc_compile("expect_stable_js") {
+ package = "expect"
+ extra_libraries = [ "minitest" ]
+ canary = false
+ sound_null_safety = true
+}
+
+ddc_compile("expect_canary_js") {
+ package = "expect"
+ extra_libraries = [ "minitest" ]
+ canary = true
+ sound_null_safety = true
+}
+
+ddc_compile("expect_stable_unsound_js") {
+ package = "expect"
+ extra_libraries = [ "minitest" ]
+ canary = false
+ sound_null_safety = false
+}
+
+ddc_compile("expect_canary_unsound_js") {
+ package = "expect"
+ extra_libraries = [ "minitest" ]
+ canary = true
+ sound_null_safety = false
+}
+
+ddc_compile("js_stable_js") {
+ package = "js"
+ extra_libraries = [ "js_util" ]
+ canary = false
+ sound_null_safety = true
+}
+
+ddc_compile("js_canary_js") {
+ package = "js"
+ extra_libraries = [ "js_util" ]
+ canary = true
+ sound_null_safety = true
+}
+ddc_compile("js_stable_unsound_js") {
+ package = "js"
+ extra_libraries = [ "js_util" ]
+ canary = false
+ sound_null_safety = false
+}
+
+ddc_compile("js_canary_unsound_js") {
+ package = "js"
+ extra_libraries = [ "js_util" ]
+ canary = true
+ sound_null_safety = false
+}
+
+ddc_compile("meta_stable_js") {
+ package = "meta"
+ canary = false
+ sound_null_safety = true
+}
+
+ddc_compile("meta_canary_js") {
+ package = "meta"
+ canary = true
+ sound_null_safety = true
+}
+
+ddc_compile("meta_stable_unsound_js") {
+ package = "meta"
+ canary = false
+ sound_null_safety = false
+}
+
+ddc_compile("meta_canary_unsound_js") {
+ package = "meta"
+ canary = true
+ sound_null_safety = false
+}
+
+# Compiles the DDC SDK JavaScript modules from the platform .dill file.
+template("ddc_compile_sdk") {
+ assert(defined(invoker.sound_null_safety),
+ "Need 'sound_null_safety' in $target_name.")
+
+ # Determine one of four possible directories for the JavaScript output to be
+ # generated:
+ #
+ # out/gen/ddc
+ # |- canary/sdk
+ # |- canary_unsound/sdk
+ # |- stable/sdk
+ # |- stable_unsound/sdk
+ if (invoker.canary) {
+ js_gen_dir = "$target_gen_dir/canary"
+ } else {
+ js_gen_dir = "$target_gen_dir/stable"
+ }
+ if (invoker.sound_null_safety) {
+ platform_dep = "../dartdevc:dartdevc_platform_sound"
+ platform_input = sdk_full_sound_dill
+ js_gen_dir = "$js_gen_dir/sdk"
+ } else {
+ platform_dep = "../dartdevc:dartdevc_platform_unsound"
+ platform_input = sdk_full_unsound_dill
+ js_gen_dir = "${js_gen_dir}_unsound/sdk"
+ }
+
+ prebuilt_dart_action(target_name) {
+ deps = [
+ ":ddc_files_stamp",
+ platform_dep,
+ ]
+
+ inputs = [ platform_input ]
+
+ outputs = [
+ "$js_gen_dir/amd/dart_sdk.js",
+ "$js_gen_dir/amd/dart_sdk.js.map",
+ "$js_gen_dir/common/dart_sdk.js",
+ "$js_gen_dir/common/dart_sdk.js.map",
+ "$js_gen_dir/es6/dart_sdk.js",
+ "$js_gen_dir/es6/dart_sdk.js.map",
+ "$js_gen_dir/legacy/dart_sdk.js",
+ "$js_gen_dir/legacy/dart_sdk.js.map",
+ ]
+
+ vm_args = [ "-Dsdk_hash=$sdk_hash" ]
+
+ script = "../../pkg/dev_compiler/bin/dartdevc.dart"
+
+ args = [
+ "--multi-root-scheme",
+ "org-dartlang-sdk",
+ "--multi-root-output-path",
+
+ # This path is intended to point to a version of source files used to
+ # generate the SDK JavaScript modules.
+ # The intention is that the source map locations can be linked to the
+ # orignal source files while running SDK test suites.
+ # These JavaScript files and source maps are no longer packaged into the
+ # released SDK.
+ rebase_path("$target_gen_dir/../../../dart-sdk"),
+ "--modules",
+ "amd",
+ "-o",
+ rebase_path("$js_gen_dir/amd/dart_sdk.js"),
+ "--modules",
+ "common",
+ "-o",
+ rebase_path("$js_gen_dir/common/dart_sdk.js"),
+ "--modules",
+ "es6",
+ "-o",
+ rebase_path("$js_gen_dir/es6/dart_sdk.js"),
+ "--modules",
+ "legacy",
+ "-o",
+ rebase_path("$js_gen_dir/legacy/dart_sdk.js"),
+ rebase_path("$platform_input"),
+ ]
+
+ if (invoker.sound_null_safety) {
+ args += [ "--sound-null-safety" ]
+ } else {
+ args += [ "--no-sound-null-safety" ]
+ }
+
+ if (invoker.canary) {
+ args += [ "--canary" ]
+ }
+ }
+}
+
+ddc_compile_sdk("ddc_stable_sdk") {
+ canary = false
+ sound_null_safety = true
+}
+
+ddc_compile_sdk("ddc_stable_unsound_sdk") {
+ canary = false
+ sound_null_safety = false
+}
+
+ddc_compile_sdk("ddc_canary_sdk") {
+ canary = true
+ sound_null_safety = true
+}
+
+ddc_compile_sdk("ddc_canary_unsound_sdk") {
+ canary = true
+ sound_null_safety = false
+}