dart-sdk/utils/dartanalyzer/BUILD.gn
Zachary Anderson 8c21a6dd6b [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>
2017-12-20 22:03:39 +00:00

101 lines
2.8 KiB
Plaintext

# Copyright (c) 2016, 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/compiled_action.gni")
import("../../build/prebuilt_dart_sdk.gni")
import("../application_snapshot.gni")
group("dartanalyzer") {
deps = [
":generate_dartanalyzer_snapshot",
":generate_summary_spec",
":generate_summary_strong",
]
}
analyzer_files = exec_script("../../tools/list_dart_files.py",
[
"absolute",
rebase_path("../../pkg/analyzer"),
],
"list lines")
application_snapshot("generate_dartanalyzer_snapshot") {
main_dart = "../../pkg/analyzer_cli/bin/analyzer.dart"
training_args = [
"--dart-sdk=" + rebase_path("../../sdk"),
rebase_path("../../tests/language/first_test.dart"),
]
name = "dartanalyzer"
cli_files = exec_script("../../tools/list_dart_files.py",
[
"absolute",
rebase_path("../../pkg/analyzer_cli"),
],
"list lines")
inputs = cli_files + analyzer_files
}
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
[
"absolute",
rebase_path("../../sdk/lib"),
],
"list lines")
template("generate_summary") {
assert(defined(invoker.type), "Must specify the summary type")
type = invoker.type
assert(type == "spec" || type == "strong")
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"
outputs = [
output,
]
dot_packages = rebase_path("../../.packages")
build_sdk_summaries =
rebase_path("../../pkg/analyzer/tool/summary/build_sdk_summaries.dart")
args += [
"--quiet",
"--packages=$dot_packages",
build_sdk_summaries,
"build-$type",
rebase_path(output),
rebase_path("../../sdk"),
]
}
}
generate_summary("generate_summary_spec") {
type = "spec"
}
generate_summary("generate_summary_strong") {
type = "strong"
}