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 = get_path_info("..", "abspath") |
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'") |
11 assert(defined(invoker.training_args), "Must specify 'training_args'") | 11 assert(defined(invoker.training_args), "Must specify 'training_args'") |
12 main_dart = invoker.main_dart | 12 main_dart = invoker.main_dart |
13 training_args = invoker.training_args | 13 training_args = invoker.training_args |
14 name = target_name | 14 name = target_name |
15 if (defined(invoker.name)) { | 15 if (defined(invoker.name)) { |
16 name = invoker.name | 16 name = invoker.name |
17 } | 17 } |
18 extra_deps = [] | 18 extra_deps = [] |
19 if (defined(invoker.deps)) { | 19 if (defined(invoker.deps)) { |
20 extra_deps += invoker.deps | 20 extra_deps += invoker.deps |
21 } | 21 } |
22 extra_inputs = [] | 22 extra_inputs = [] |
23 if (defined(invoker.inputs)) { | 23 if (defined(invoker.inputs)) { |
24 extra_inputs += invoker.inputs | 24 extra_inputs += invoker.inputs |
25 } | 25 } |
26 compiled_action(target_name) { | 26 compiled_action(target_name) { |
27 tool = get_path_info("$_dart_root/runtime/bin:dart", "abspath") | 27 tool = "$_dart_root/runtime/bin:dart" |
28 deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ] | 28 deps = extra_deps + [ "$_dart_root/pkg:pkg_files_stamp" ] |
29 | 29 |
30 inputs = extra_inputs + [ | 30 inputs = extra_inputs + [ |
31 "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries
.dart", | 31 "$_dart_root/sdk/lib/_internal/sdk_library_metadata/lib/libraries
.dart", |
32 "$root_gen_dir/pkg_files.stamp", | 32 "$root_gen_dir/pkg_files.stamp", |
33 ] | 33 ] |
34 | 34 |
35 output = "$root_gen_dir/$name.dart.snapshot" | 35 output = "$root_gen_dir/$name.dart.snapshot" |
36 outputs = [ | 36 outputs = [ |
37 output, | 37 output, |
38 ] | 38 ] |
39 | 39 |
40 dot_packages = rebase_path("$_dart_root/.packages") | 40 dot_packages = rebase_path("$_dart_root/.packages") |
41 abs_output = rebase_path(output) | 41 abs_output = rebase_path(output) |
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 } |
OLD | NEW |