Index: utils/application_snapshot.gni |
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni |
index 9a317e291ecc31e597738f5755d062de978caa7a..03661fb49818efe7efc5850c4413abb2ca96a658 100644 |
--- a/utils/application_snapshot.gni |
+++ b/utils/application_snapshot.gni |
@@ -6,6 +6,12 @@ import("../build/compiled_action.gni") |
_dart_root = get_path_info("..", "abspath") |
+declare_args() { |
+ # Default to building app-jit snapshots. The simulator and cross builds |
+ # override this to script snapshots to cut down on build time. |
+ dart_snapshot_kind = "app-jit" |
+} |
+ |
template("application_snapshot") { |
assert(defined(invoker.main_dart), "Must specify 'main_dart'") |
assert(defined(invoker.training_args), "Must specify 'training_args'") |
@@ -41,11 +47,18 @@ template("application_snapshot") { |
abs_output = rebase_path(output) |
main_file = rebase_path(main_dart) |
- args = [ |
- "--packages=$dot_packages", |
- "--snapshot=$abs_output", |
- "--snapshot-kind=app-jit", |
- main_file, |
- ] + training_args |
+ args = [ "--packages=$dot_packages", |
+ "--snapshot=$abs_output" ] |
+ |
+ if (dart_snapshot_kind == "script") { |
+ args += ["--snapshot-kind=script", |
+ main_file ] |
+ assert(training_args != "", "Ignoring unused argument") |
+ } else if (dart_snapshot_kind == "app-jit") { |
+ args += ["--snapshot-kind=app-jit", |
+ main_file ] + training_args |
+ } else { |
+ assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind") |
+ } |
} |
} |