blob: 74128440a505000c2e5aeebc6f390993dc72766d [file] [log] [blame]
kevers102783982014-10-31 15:55:211# Copyright 2014 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5template("build_closure") {
6 assert(defined(invoker.sources))
7 assert(defined(invoker.target))
brettwbd8c2192016-10-01 01:56:138 action(target_name) {
kevers102783982014-10-31 15:55:219 script = "//third_party/google_input_tools/builder.py"
10 sources = invoker.sources
scottmg34fb7e52014-12-03 23:27:2411 outputs = [
12 invoker.target,
13 ]
scottmg1c240d272014-12-03 07:28:0014 args = [
15 "--target",
16 rebase_path(invoker.target, root_build_dir),
17 ]
18 if (defined(invoker.json_file)) {
kevers102783982014-10-31 15:55:2119 # Optionally parse list of sources from a json file. Useful when the list
20 # is sufficiently long to create problems with length restrictions on the
21 # command line.
22 assert(defined(invoker.json_sources))
scottmg1c240d272014-12-03 07:28:0023 args += [
24 "--json_file",
25 rebase_path(invoker.json_file, root_build_dir),
26 "--json_sources",
27 invoker.json_sources,
28 ]
kevers102783982014-10-31 15:55:2129 } else {
30 # If the number of source files is short, they can be directly extracted
31 # from the command line.
scottmg1c240d272014-12-03 07:28:0032 args += [ "--sources" ] + sources
kevers102783982014-10-31 15:55:2133 }
scottmg1c240d272014-12-03 07:28:0034 if (defined(invoker.path)) {
35 args += [
36 "--path",
wychen6bf8ffa2017-06-07 08:51:5237 rebase_path(invoker.path, root_build_dir),
scottmg1c240d272014-12-03 07:28:0038 ]
kevers102783982014-10-31 15:55:2139 }
40 }
kevers102783982014-10-31 15:55:2141}