Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: utils/application_snapshot.gni

Issue 2621423004: Revert pub to script snapshots in the GN build. Fixes #28346. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils/pub/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/application_snapshot.gni
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni
index 8899703e912870b3f2e223d0accaa29f2ce1b379..ffc0653321bb1c0b5eae4f761f4025b96f827ffe 100644
--- a/utils/application_snapshot.gni
+++ b/utils/application_snapshot.gni
@@ -49,3 +49,48 @@ template("application_snapshot") {
] + training_args
}
}
+
+# TODO(28368): Revert to application snapshot after spawnUri issue is fixed.
+template("script_snapshot") {
+ assert(defined(invoker.main_dart), "Must specify 'main_dart'")
+ assert(defined(invoker.training_args), "Must specify 'training_args'")
zra 2017/01/12 21:12:41 Why does a script snapshot need training args?
rmacnak 2017/01/13 18:47:41 It doesn't. This was a quick fix and removed in ht
+ main_dart = invoker.main_dart
+ training_args = invoker.training_args
+ name = target_name
+ if (defined(invoker.name)) {
+ name = invoker.name
+ }
+ extra_deps = []
+ if (defined(invoker.deps)) {
+ extra_deps += invoker.deps
+ }
+ extra_inputs = []
+ if (defined(invoker.inputs)) {
+ extra_inputs += invoker.inputs
+ }
+ compiled_action(target_name) {
+ tool = get_path_info("$_dart_root/runtime/bin:dart", "abspath")
+ deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ]
+
+ inputs = extra_inputs + [
+ "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
+ "$root_gen_dir/pkg_files.stamp",
+ ]
+
+ output = "$root_gen_dir/$name.dart.snapshot"
+ outputs = [
+ output,
+ ]
+
+ dot_packages = rebase_path("$_dart_root/.packages")
+ abs_output = rebase_path(output)
+ main_file = rebase_path(main_dart)
+
+ args = [
+ "--packages=$dot_packages",
+ "--snapshot=$abs_output",
+ "--snapshot-kind=script",
+ main_file,
+ ] + training_args
+ }
+}
« no previous file with comments | « no previous file | utils/pub/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698