Index: utils/compiler/BUILD.gn |
diff --git a/utils/compiler/BUILD.gn b/utils/compiler/BUILD.gn |
index 19d7beac87b6567f2e1c6681e8544f33782e5426..13e2ef17a62571c6b9f96206ef7e62eecb5e887d 100644 |
--- a/utils/compiler/BUILD.gn |
+++ b/utils/compiler/BUILD.gn |
@@ -3,6 +3,7 @@ |
# BSD-style license that can be found in the LICENSE file. |
import("../../build/compiled_action.gni") |
+import("../../build/prebuilt_dart_sdk.gni") |
import("../create_timestamp.gni") |
import("../application_snapshot.gni") |
@@ -75,3 +76,46 @@ application_snapshot("utils_wrapper") { |
main_dart = "$target_gen_dir/utils_wrapper.dart" |
training_args = [ "--help" ] |
} |
+ |
+action("patched_dart2js_sdk") { |
Vyacheslav Egorov (Google)
2017/04/27 14:07:23
It might be a good idea to move all shared GN rule
Siggi Cherem (dart-lang)
2017/04/28 21:37:21
Done.
|
+ deps = ["../../runtime/vm:patched_sdk"] |
+ if (!prebuilt_dart_exe_works) { |
+ deps += ["../../runtime/bin:dart_bootstrap($host_toolchain)"] |
+ } |
+ |
+ patches_dir = "../../sdk/lib/_internal/js_runtime/lib" |
+ patched_sdk_dir = "$root_out_dir/patched_dart2js_sdk" |
+ |
+ script = "../../tools/patch_sdk.py" |
+ |
+ # We list the `patch_sdk.dart` tool here because the [script] (which is |
+ # implicitly an input) will call it. |
+ inputs = [ |
+ "../../tools/patch_sdk.dart", |
+ ] |
+ depfile = "$root_out_dir/patched_dart2js_sdk.d" |
+ |
+ outputs = [ |
+ # Instead of listing all outputs we list a single well-known one. |
+ "${patched_sdk_dir}/platform.dill", |
+ ] |
+ |
+ args = [ "--quiet" ] |
+ if (!prebuilt_dart_exe_works) { |
+ dart_out_dir = get_label_info( |
+ "../../runtime/bin:dart_bootstrap($host_toolchain)", "root_out_dir") |
+ dart_bootstrap = |
+ rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix") |
+ args += [ |
+ "--dart-executable", |
+ dart_bootstrap, |
+ ] |
+ } |
+ args += [ |
+ "dart2js", |
+ rebase_path("../../sdk"), |
+ rebase_path(patches_dir), |
+ rebase_path(patched_sdk_dir, root_build_dir), |
+ rebase_path("../../.packages"), |
+ ] |
+} |