OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file has rules for making Dart packages and Dart-based Mojo applications. | 5 # This file has rules for making Dart packages and Dart-based Mojo applications. |
6 # | 6 # |
7 # Entrypoint rules are: | 7 # Entrypoint rules are: |
8 # - dart_pkg | 8 # - dart_pkg |
9 # - dartzip_package | 9 # - dartzip_package |
10 # - dartzip_packaged_application | 10 # - dartzip_packaged_application |
11 | 11 |
12 import("../mojo.gni") | |
12 import("//build/module_args/mojo.gni") | 13 import("//build/module_args/mojo.gni") |
13 import("//build/module_args/dart.gni") | 14 import("//build/module_args/dart.gni") |
14 | 15 |
15 template("dartx") { | 16 template("dartx") { |
16 bundle_prefix = target_name | 17 bundle_prefix = target_name |
17 bundle = "$target_gen_dir/${bundle_prefix}.dartx" | 18 bundle = "$target_gen_dir/${bundle_prefix}.dartx" |
18 snapshot = "$target_gen_dir/${bundle_prefix}_snapshot.bin" | 19 snapshot = "$target_gen_dir/${bundle_prefix}_snapshot.bin" |
19 dart_snapshotter = "$root_out_dir/dart_snapshotter" | 20 |
20 if (current_toolchain != host_toolchain) { | 21 if (mojo_use_prebuilt_dart_snapshotter) { |
21 toolchain_name = get_label_info(host_toolchain, "name") | 22 dart_snapshotter_rule = |
22 dart_snapshotter = "$root_out_dir/$toolchain_name/dart_snapshotter" | 23 rebase_path("mojo/public/tools:copy_dart_snapshotter", ".", mojo_root) |
24 } else { | |
25 dart_snapshotter_rule = | |
26 rebase_path("mojo/dart/dart_snapshotter", ".", mojo_root) | |
jamesr
2015/08/17 20:59:51
the sdk should not depend on paths outside the sdk
zra
2015/08/17 21:59:18
Used the variable you added.
| |
23 } | 27 } |
28 data_deps = [ "$dart_snapshotter_rule($host_toolchain)" ] | |
jamesr
2015/08/17 20:59:51
data_deps is wrong since you need this to exist be
zra
2015/08/17 21:59:18
Fixed after your change.
| |
29 dart_snapshotter_dir = | |
30 get_label_info("$dart_snapshotter_rule($host_toolchain)", "root_out_dir") | |
31 dart_snapshotter = "$dart_snapshotter_dir/dart_snapshotter" | |
24 | 32 |
25 action("gen_${bundle_prefix}_snapshot") { | 33 action("gen_${bundle_prefix}_snapshot") { |
26 main_dart = invoker.main_dart | 34 main_dart = invoker.main_dart |
27 | 35 |
28 inputs = [ | 36 inputs = [ |
29 dart_snapshotter, | 37 dart_snapshotter, |
30 main_dart, | 38 main_dart, |
31 ] | 39 ] |
32 outputs = [ | 40 outputs = [ |
33 snapshot, | 41 snapshot, |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
596 | 604 |
597 rebase_input = rebase_path(input, root_build_dir) | 605 rebase_input = rebase_path(input, root_build_dir) |
598 rebase_output = rebase_path(output, root_build_dir) | 606 rebase_output = rebase_path(output, root_build_dir) |
599 args = [ | 607 args = [ |
600 "--input=$rebase_input", | 608 "--input=$rebase_input", |
601 "--output=$rebase_output", | 609 "--output=$rebase_output", |
602 "--line=$line", | 610 "--line=$line", |
603 ] | 611 ] |
604 } | 612 } |
605 } | 613 } |
OLD | NEW |