Reapply "[build] Don't list Dart sources up front when creating application snapshots."

Fix `application_snapshot`'s depfile to track the sources of the application instead of the compiler. Split compiling the compiler into a separate GN target with its own depfile.

Bug: https://github.com/flutter/flutter/issues/81074
Change-Id: I0fb23ada40a6241ee3dde7f6cfebdd121b9a4224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197020
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2021-04-27 17:22:54 +00:00
committed by commit-bot@chromium.org
parent 69b6cee683
commit 605b211c89
9 changed files with 63 additions and 147 deletions
+8 -14
View File
@@ -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" ]