mirror of
https://github.com/dart-lang/sdk
synced 2024-10-01 19:29:09 +00:00
Build DDC targets with forked SDK sources when building with --nnbd flag
Issue: #38665 Change-Id: I42eb4e97f3269f7d1a53abeac62f9293a003ae60 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120400 Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
parent
795949de00
commit
50d972bba0
7
BUILD.gn
7
BUILD.gn
|
@ -3,15 +3,10 @@
|
|||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import("build/config/gclient_args.gni")
|
||||
import("sdk_args.gni")
|
||||
|
||||
targetting_fuchsia = target_os == "fuchsia"
|
||||
|
||||
declare_args() {
|
||||
# Whether to use the NNBD fork of the SDK core libraries.
|
||||
# TODO(rnystrom): Remove this when the fork has been merged back in.
|
||||
use_nnbd = false
|
||||
}
|
||||
|
||||
# This target will be built if no target is specified when invoking ninja.
|
||||
group("default") {
|
||||
if (targetting_fuchsia) {
|
||||
|
|
5
sdk_args.gni
Normal file
5
sdk_args.gni
Normal file
|
@ -0,0 +1,5 @@
|
|||
declare_args() {
|
||||
# Whether to use the NNBD fork of the SDK core libraries.
|
||||
# TODO(#38701): Remove this when the fork has been merged back in.
|
||||
use_nnbd = false
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
# BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import("../../build/dart/dart_action.gni")
|
||||
import("../../sdk_args.gni")
|
||||
import("../application_snapshot.gni")
|
||||
import("../create_timestamp.gni")
|
||||
|
||||
|
@ -35,10 +36,17 @@ application_snapshot("dartdevc") {
|
|||
]
|
||||
}
|
||||
|
||||
# TODO(#38701) Cleanup after merging the forked SDK into mainline.
|
||||
if (use_nnbd) {
|
||||
sdk_root = "../../sdk_nnbd"
|
||||
} else {
|
||||
sdk_root = "../../sdk"
|
||||
}
|
||||
|
||||
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../sdk/lib"),
|
||||
rebase_path("$sdk_root/lib"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
|
@ -119,7 +127,7 @@ prebuilt_dart_action("dartdevc_patch_sdk") {
|
|||
inputs += exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../sdk/lib/_internal/js_dev_runtime"),
|
||||
rebase_path("$sdk_root/lib/_internal/js_dev_runtime"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
|
@ -132,9 +140,14 @@ prebuilt_dart_action("dartdevc_patch_sdk") {
|
|||
|
||||
args = [
|
||||
rebase_path("../../"),
|
||||
rebase_path("../../sdk/lib/_internal/js_dev_runtime"),
|
||||
rebase_path("$sdk_root/lib/_internal/js_dev_runtime"),
|
||||
rebase_path(patched_sdk_dir),
|
||||
]
|
||||
|
||||
# TODO(#38701) Cleanup after merging the forked SDK into mainline.
|
||||
if (use_nnbd) {
|
||||
args += [ "sdk_nnbd" ]
|
||||
}
|
||||
}
|
||||
|
||||
# Compiles the Dart core libraries and DDC runtime to an analyzer summary and
|
||||
|
@ -228,7 +241,7 @@ create_timestamp_file("dartdevc_files_stamp") {
|
|||
}
|
||||
|
||||
create_timestamp_file("dartdevc_sdk_patch_stamp") {
|
||||
path = rebase_path("../../sdk/lib/_internal/js_dev_runtime")
|
||||
path = rebase_path("$sdk_root/lib/_internal/js_dev_runtime")
|
||||
output = "$target_gen_dir/dartdevc_sdk_patch_stamp.stamp"
|
||||
}
|
||||
|
||||
|
@ -338,7 +351,7 @@ prebuilt_dart_action("dartdevc_kernel_sdk_outline") {
|
|||
"--multi-root",
|
||||
rebase_path("../../sdk"),
|
||||
"--libraries-file",
|
||||
"file:///" + rebase_path("../../sdk/lib/libraries.json"),
|
||||
"file:///" + rebase_path("$sdk_root/lib/libraries.json"),
|
||||
"--output",
|
||||
rebase_path(sdk_dill),
|
||||
"--source",
|
||||
|
@ -348,7 +361,7 @@ prebuilt_dart_action("dartdevc_kernel_sdk_outline") {
|
|||
|
||||
copy("dartdevc_kernel_sdk_libraries_json") {
|
||||
sources = [
|
||||
rebase_path("../../sdk/lib/libraries.json"),
|
||||
rebase_path("$sdk_root/lib/libraries.json"),
|
||||
]
|
||||
outputs = [
|
||||
sdk_libraries_json,
|
||||
|
@ -389,7 +402,7 @@ prebuilt_dart_action("dartdevc_kernel_sdk") {
|
|||
"--multi-root-scheme",
|
||||
"org-dartlang-sdk",
|
||||
"--multi-root",
|
||||
"file:///" + rebase_path("../../sdk"),
|
||||
"file:///" + rebase_path(sdk_root),
|
||||
"--multi-root-output-path",
|
||||
rebase_path("$target_gen_dir/../../"),
|
||||
"--libraries-file",
|
||||
|
|
Loading…
Reference in a new issue