OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 template("build_closure") { | 5 template("build_closure") { |
6 assert(defined(invoker.sources)) | 6 assert(defined(invoker.sources)) |
7 assert(defined(invoker.target)) | 7 assert(defined(invoker.target)) |
8 action_name = target_name + "_js_gen" | 8 action_name = target_name + "_js_gen" |
9 action(action_name) { | 9 action(action_name) { |
10 script = "//third_party/google_input_tools/builder.py" | 10 script = "//third_party/google_input_tools/builder.py" |
11 sources = invoker.sources | 11 sources = invoker.sources |
12 outputs = [invoker.target] | 12 outputs = [ invoker.target ] |
13 args = ["--target", | 13 args = [ |
14 rebase_path(invoker.target, root_build_dir)] | 14 "--target", |
15 if(defined(invoker.json_file)) { | 15 rebase_path(invoker.target, root_build_dir), |
| 16 ] |
| 17 if (defined(invoker.json_file)) { |
16 # Optionally parse list of sources from a json file. Useful when the list | 18 # Optionally parse list of sources from a json file. Useful when the list |
17 # is sufficiently long to create problems with length restrictions on the | 19 # is sufficiently long to create problems with length restrictions on the |
18 # command line. | 20 # command line. |
19 assert(defined(invoker.json_sources)) | 21 assert(defined(invoker.json_sources)) |
20 args += ["--json_file", | 22 args += [ |
21 rebase_path(invoker.json_file, root_build_dir), | 23 "--json_file", |
22 "--json_sources", | 24 rebase_path(invoker.json_file, root_build_dir), |
23 invoker.json_sources] | 25 "--json_sources", |
| 26 invoker.json_sources, |
| 27 ] |
24 } else { | 28 } else { |
25 # If the number of source files is short, they can be directly extracted | 29 # If the number of source files is short, they can be directly extracted |
26 # from the command line. | 30 # from the command line. |
27 args += ["--sources"] + sources | 31 args += [ "--sources" ] + sources |
28 } | 32 } |
29 if(defined(invoker.path)) { | 33 if (defined(invoker.path)) { |
30 args += ["--path", invoker.path] | 34 args += [ |
| 35 "--path", |
| 36 invoker.path, |
| 37 ] |
31 } | 38 } |
32 } | 39 } |
33 group(target_name) { | 40 group(target_name) { |
34 deps = [ ":$action_name" ] | 41 deps = [ |
| 42 ":$action_name", |
| 43 ] |
35 } | 44 } |
36 } | 45 } |
OLD | NEW |