[GN] Use the prebuilt toolchain to build analyzer summaries

This will speed up cross-builds.

TO-660

Change-Id: Idb1bf8839ffc3443ff620fbe94b733fe71d6bf84
Reviewed-on: https://dart-review.googlesource.com/30901
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Zachary Anderson 2017-12-20 22:03:39 +00:00 committed by Zach Anderson
parent fcc6836b88
commit 8c21a6dd6b

View file

@ -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("../application_snapshot.gni")
group("dartanalyzer") {
@ -47,8 +48,27 @@ template("generate_summary") {
assert(defined(invoker.type), "Must specify the summary type")
type = invoker.type
assert(type == "spec" || type == "strong")
compiled_action(target_name) {
tool = "../../runtime/bin:dart"
action(target_name) {
if (!prebuilt_dart_exe_works) {
deps = [ "../../runtime/bin:dart_bootstrap($dart_host_toolchain)" ]
}
script = "../../tools/run_dart.py"
args = []
if (!prebuilt_dart_exe_works) {
dart_out_dir = get_label_info(
"../../runtime/bin:dart_bootstrap($dart_host_toolchain)",
"root_out_dir")
dart_bootstrap =
rebase_path("$dart_out_dir/dart_bootstrap$executable_suffix")
args += [
"--dart",
dart_bootstrap,
]
}
inputs = sdk_lib_files + analyzer_files
output = "$root_gen_dir/$type.sum"
@ -60,7 +80,8 @@ template("generate_summary") {
build_sdk_summaries =
rebase_path("../../pkg/analyzer/tool/summary/build_sdk_summaries.dart")
args = [
args += [
"--quiet",
"--packages=$dot_packages",
build_sdk_summaries,
"build-$type",