OLD | NEW |
1 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import("../build/compiled_action.gni") | 5 import("../build/compiled_action.gni") |
6 | 6 |
7 _dart_root = rebase_path("..") | 7 _dart_root = rebase_path("..") |
8 | 8 |
9 template("application_snapshot") { | 9 template("application_snapshot") { |
10 assert(defined(invoker.main_dart), "Must specify 'main_dart'") | 10 assert(defined(invoker.main_dart), "Must specify 'main_dart'") |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 main_file = rebase_path(main_dart) | 42 main_file = rebase_path(main_dart) |
43 | 43 |
44 args = [ | 44 args = [ |
45 "--packages=$dot_packages", | 45 "--packages=$dot_packages", |
46 "--snapshot=$abs_output", | 46 "--snapshot=$abs_output", |
47 "--snapshot-kind=app-jit", | 47 "--snapshot-kind=app-jit", |
48 main_file, | 48 main_file, |
49 ] + training_args | 49 ] + training_args |
50 } | 50 } |
51 } | 51 } |
52 | |
53 # TODO(28368): Revert to application snapshot after spawnUri issue is fixed. | |
54 template("script_snapshot") { | |
55 assert(defined(invoker.main_dart), "Must specify 'main_dart'") | |
56 assert(defined(invoker.training_args), "Must specify 'training_args'") | |
57 main_dart = invoker.main_dart | |
58 training_args = invoker.training_args | |
59 name = target_name | |
60 if (defined(invoker.name)) { | |
61 name = invoker.name | |
62 } | |
63 extra_deps = [] | |
64 if (defined(invoker.deps)) { | |
65 extra_deps += invoker.deps | |
66 } | |
67 extra_inputs = [] | |
68 if (defined(invoker.inputs)) { | |
69 extra_inputs += invoker.inputs | |
70 } | |
71 compiled_action(target_name) { | |
72 tool = get_path_info("$_dart_root/runtime/bin:dart", "abspath") | |
73 deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ] | |
74 | |
75 inputs = extra_inputs + [ | |
76 "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries
.dart", | |
77 "$root_gen_dir/pkg_files.stamp", | |
78 ] | |
79 | |
80 output = "$root_gen_dir/$name.dart.snapshot" | |
81 outputs = [ | |
82 output, | |
83 ] | |
84 | |
85 dot_packages = rebase_path("$_dart_root/.packages") | |
86 abs_output = rebase_path(output) | |
87 main_file = rebase_path(main_dart) | |
88 | |
89 args = [ | |
90 "--packages=$dot_packages", | |
91 "--snapshot=$abs_output", | |
92 "--snapshot-kind=script", | |
93 main_file, | |
94 ] + training_args | |
95 } | |
96 } | |
OLD | NEW |