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
3 # found in the LICENSE file.
5 # Calls the remoting_localize script with a jinja2 template.
10 # List of jinja2 files to load. This is the template.
15 # locale_dir (optional)
18 # List of defines to pass to script.
19 # Example: defines = [ "FOO_HOST_PATH=bar" ]
21 # variables (optional)
22 # List of variables to pass to script.
25 # Substitution pattern for the output. Defaults to a file in the target
26 # gen dir with the extension stripped (normally the extension is ".jinja2"
27 # which then leaves the non-tempaltized file name).
28 # TODO(brettw) Need locale_output. This is a per-locale output file.
34 # visibility (optional)
35 template("remoting_localize") {
36 action_foreach(target_name) {
37 if (defined(invoker.visibility)) {
38 visibility = invoker.visibility
41 script = "//remoting/tools/build/remoting_localize.py"
43 sources = invoker.sources
45 if (defined(invoker.output)) {
51 "$target_gen_dir/{{source_name_part}}",
57 if (defined(invoker.locale_dir)) {
60 rebase_path(invoker.locale_dir, root_build_dir),
64 # Add defines to command line.
65 if (defined(invoker.defines)) {
66 foreach(i, invoker.defines) {
74 # Add variables to command line.
75 if (defined(invoker.variables)) {
76 foreach(i, invoker.variables) {
84 # The template file is required.
92 rebase_path(outputs[0], root_build_dir),
95 if (defined(invoker.encoding)) {
102 args += invoker.locales
104 if (defined(invoker.deps)) {
110 # This script reads the messages strings from the generated resource files.
111 deps += [ "//remoting/resources:strings" ]