[build] Don't list Dart sources up front when creating application snapshots.
GN/Ninja will discover them via the depfile created alongside the snapshot. Bug: https://github.com/flutter/flutter/issues/81074 Change-Id: I6e0f07214e8ea29e6d23261c71558da06fd2223a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196982 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
494e5b0380
commit
a23c31bf8d
@@ -1,62 +0,0 @@
|
||||
# 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("../utils/create_timestamp.gni")
|
||||
|
||||
template("make_third_party_pkg_files_stamp") {
|
||||
assert(defined(invoker.id), "Must define the stamp file id")
|
||||
path = rebase_path("../third_party/pkg")
|
||||
if (defined(invoker.path)) {
|
||||
path = invoker.path
|
||||
}
|
||||
id = invoker.id
|
||||
create_timestamp_file(target_name) {
|
||||
if (defined(invoker.pattern)) {
|
||||
pattern = invoker.pattern
|
||||
}
|
||||
path = path
|
||||
output = "$target_gen_dir/third_party_pkg_files_$id.stamp"
|
||||
}
|
||||
}
|
||||
|
||||
make_third_party_pkg_files_stamp("make_third_party_pkg_files_0_stamp") {
|
||||
path = rebase_path(".")
|
||||
id = "0"
|
||||
}
|
||||
|
||||
make_third_party_pkg_files_stamp("make_third_party_pkg_files_1_stamp") {
|
||||
pattern = "[a-k].*"
|
||||
id = "1"
|
||||
}
|
||||
|
||||
make_third_party_pkg_files_stamp("make_third_party_pkg_files_2_stamp") {
|
||||
pattern = "[l-r].*"
|
||||
id = "2"
|
||||
}
|
||||
|
||||
make_third_party_pkg_files_stamp("make_third_party_pkg_files_3_stamp") {
|
||||
pattern = "[s-z].*"
|
||||
id = "3"
|
||||
}
|
||||
|
||||
action("pkg_files_stamp") {
|
||||
deps = [
|
||||
":make_third_party_pkg_files_0_stamp",
|
||||
":make_third_party_pkg_files_1_stamp",
|
||||
":make_third_party_pkg_files_2_stamp",
|
||||
":make_third_party_pkg_files_3_stamp",
|
||||
]
|
||||
|
||||
stamp0_outputs = get_target_outputs(":make_third_party_pkg_files_0_stamp")
|
||||
stamp1_outputs = get_target_outputs(":make_third_party_pkg_files_1_stamp")
|
||||
stamp2_outputs = get_target_outputs(":make_third_party_pkg_files_2_stamp")
|
||||
stamp3_outputs = get_target_outputs(":make_third_party_pkg_files_3_stamp")
|
||||
|
||||
inputs = stamp0_outputs + stamp1_outputs + stamp2_outputs + stamp3_outputs
|
||||
|
||||
outputs = [ "$root_gen_dir/pkg_files.stamp" ]
|
||||
|
||||
script = "../tools/create_timestamp_file.py"
|
||||
args = [ rebase_path("$root_gen_dir/pkg_files.stamp") ]
|
||||
}
|
||||
@@ -4,13 +4,6 @@
|
||||
|
||||
import("../application_snapshot.gni")
|
||||
|
||||
analysis_server_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../pkg/analysis_server"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
application_snapshot("analysis_server") {
|
||||
main_dart = "../../pkg/analysis_server/bin/server.dart"
|
||||
training_args = [
|
||||
@@ -19,5 +12,4 @@ application_snapshot("analysis_server") {
|
||||
# "--sdk=" + rebase_path("../../sdk/"),
|
||||
# "--train-using=" + rebase_path("../../pkg/analyzer_cli")
|
||||
]
|
||||
inputs = analysis_server_files
|
||||
}
|
||||
|
||||
@@ -7,5 +7,4 @@ import("../application_snapshot.gni")
|
||||
application_snapshot("kernel_worker") {
|
||||
main_dart = "kernel_worker.dart"
|
||||
training_args = [ "--help" ]
|
||||
deps = [ "../../pkg:pkg_files_stamp" ]
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import("../../build/dart/dart_action.gni")
|
||||
import("../application_snapshot.gni")
|
||||
import("../create_timestamp.gni")
|
||||
|
||||
group("dartanalyzer") {
|
||||
deps = [
|
||||
@@ -12,13 +13,6 @@ group("dartanalyzer") {
|
||||
]
|
||||
}
|
||||
|
||||
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 = [
|
||||
@@ -31,21 +25,21 @@ application_snapshot("generate_dartanalyzer_snapshot") {
|
||||
name = "dartanalyzer"
|
||||
}
|
||||
|
||||
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../sdk/lib"),
|
||||
],
|
||||
"list lines")
|
||||
sdk_root = "../../sdk"
|
||||
|
||||
create_timestamp_file("sdk_lib_files") {
|
||||
path = rebase_path("$sdk_root/lib")
|
||||
output = "$target_gen_dir/sdk_lib_files.stamp"
|
||||
}
|
||||
|
||||
dart_action("generate_summary_strong") {
|
||||
deps = [
|
||||
":sdk_lib_files",
|
||||
"../../sdk:copy_libraries",
|
||||
"../../sdk:write_version_file",
|
||||
]
|
||||
script = "../../pkg/analyzer/tool/summary/build_sdk_summaries.dart"
|
||||
packages = "../../.packages"
|
||||
inputs = sdk_lib_files + analyzer_files
|
||||
output = "$root_gen_dir/strong.sum"
|
||||
outputs = [ output ]
|
||||
vm_args = [ "-Dsdk_hash=$sdk_hash" ]
|
||||
|
||||
@@ -4,13 +4,6 @@
|
||||
|
||||
import("../application_snapshot.gni")
|
||||
|
||||
dartdev_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../pkg/dartdev"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
group("dartdev") {
|
||||
public_deps = [
|
||||
":copy_dartdev_kernel",
|
||||
@@ -30,7 +23,6 @@ application_snapshot("generate_dartdev_kernel") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
training_args = []
|
||||
deps = [ "../dds:dds" ]
|
||||
inputs = dartdev_files
|
||||
output = "$root_gen_dir/dartdev.dill"
|
||||
}
|
||||
|
||||
@@ -45,6 +37,5 @@ application_snapshot("generate_dartdev_snapshot") {
|
||||
main_dart = "../../pkg/dartdev/bin/dartdev.dart"
|
||||
training_args = [ "--help" ]
|
||||
deps = [ "../dds:dds" ]
|
||||
inputs = dartdev_files
|
||||
output = "$root_gen_dir/dartdev.dart.snapshot"
|
||||
}
|
||||
|
||||
+8
-41
@@ -40,27 +40,6 @@ application_snapshot("dartdevc") {
|
||||
|
||||
sdk_root = "../../sdk"
|
||||
|
||||
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("$sdk_root/lib"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
compiler_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../pkg/compiler"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
dev_compiler_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../pkg/dev_compiler"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
template("dart2js_compile") {
|
||||
assert(defined(invoker.main), "Must specify the main file")
|
||||
main = invoker.main
|
||||
@@ -70,12 +49,12 @@ template("dart2js_compile") {
|
||||
abs_output = rebase_path(out)
|
||||
|
||||
prebuilt_dart_action(target_name) {
|
||||
deps = [ "../compiler:compile_dart2js_platform" ]
|
||||
deps = invoker.deps + [ "../compiler:compile_dart2js_platform" ]
|
||||
|
||||
inputs = sdk_lib_files + compiler_files + dev_compiler_files + [
|
||||
"$root_out_dir/dart2js_platform.dill",
|
||||
"$root_out_dir/dart2js_outline.dill",
|
||||
]
|
||||
inputs = [
|
||||
"$root_out_dir/dart2js_platform.dill",
|
||||
"$root_out_dir/dart2js_outline.dill",
|
||||
]
|
||||
outputs = [ out ]
|
||||
|
||||
script = "../../pkg/compiler/lib/src/dart2js.dart"
|
||||
@@ -97,6 +76,7 @@ template("dart2js_compile") {
|
||||
dart2js_compile("stack_trace_mapper") {
|
||||
main = rebase_path("../../pkg/dev_compiler/web/stack_trace_mapper.dart")
|
||||
out = "$root_out_dir/dev_compiler/build/web/dart_stack_trace_mapper.js"
|
||||
deps = [ ":dartdevc_files_stamp" ]
|
||||
}
|
||||
|
||||
# Builds everything needed to run dartdevc tests using test.dart.
|
||||
@@ -180,16 +160,11 @@ template("dartdevc_kernel_compile") {
|
||||
deps = [
|
||||
":dartdevc_files_stamp",
|
||||
platform_dep,
|
||||
|
||||
# TODO(sigmund): depend only on the compiler and the actual files in the
|
||||
# package
|
||||
"../../pkg:pkg_files_stamp",
|
||||
]
|
||||
|
||||
inputs = [
|
||||
sdk_outline,
|
||||
"$target_gen_dir/dartdevc_files.stamp",
|
||||
"$root_gen_dir/pkg_files.stamp",
|
||||
]
|
||||
|
||||
outputs = [
|
||||
@@ -327,17 +302,9 @@ template("dartdevc_sdk_js") {
|
||||
}
|
||||
|
||||
prebuilt_dart_action(target_name) {
|
||||
deps = [
|
||||
":dartdevc_files_stamp",
|
||||
"../../pkg:pkg_files_stamp",
|
||||
platform_dep,
|
||||
]
|
||||
deps = [ platform_dep ]
|
||||
|
||||
inputs = [
|
||||
"$target_gen_dir/dartdevc_files.stamp",
|
||||
"$root_gen_dir/pkg_files.stamp",
|
||||
platform_input,
|
||||
]
|
||||
inputs = [ platform_input ]
|
||||
|
||||
outputs = [
|
||||
"$js_gen_dir/amd/dart_sdk.js",
|
||||
|
||||
@@ -4,13 +4,6 @@
|
||||
|
||||
import("../application_snapshot.gni")
|
||||
|
||||
dds_files = exec_script("../../tools/list_dart_files.py",
|
||||
[
|
||||
"absolute",
|
||||
rebase_path("../../pkg/dds"),
|
||||
],
|
||||
"list lines")
|
||||
|
||||
group("dds") {
|
||||
public_deps = [ ":copy_dds_snapshot" ]
|
||||
}
|
||||
@@ -25,6 +18,5 @@ copy("copy_dds_snapshot") {
|
||||
application_snapshot("generate_dds_snapshot") {
|
||||
main_dart = "../../pkg/dds/bin/dds.dart"
|
||||
training_args = []
|
||||
inputs = dds_files
|
||||
output = "$root_gen_dir/dds.dart.snapshot"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user