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
3 # found in the LICENSE file.
5 import("//tools/grit/grit_rule.gni")
7 # See also remoting_locales_with_underscores below.
53 # Some locales have hyphens in the names but for some uses underscores are
55 remoting_locales_with_underscores = remoting_locales
56 remoting_locales_with_underscores -= [
64 remoting_locales_with_underscores += [
77 #":verify_resources", TODO(GYP) enable this.
81 # TODO(GYP) enable verify_resources. The bots are complaining about
82 # gen/main.html not being found but this doesn't seems to reproduce locally.
85 action("verify_resources") {
86 script = "//remoting/tools/verify_resources.py"
89 "$root_gen_dir/main.html",
90 "../base/resources_unittest.cc",
91 "../host/continue_window_mac.mm",
92 "../host/disconnect_window_mac.mm",
93 "../host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2",
94 "../host/mac/me2me_preference_pane-InfoPlist.strings.jinja2",
95 "../host/win/core.rc.jinja2",
96 "../host/win/host_messages.mc.jinja2",
97 "../host/win/version.rc.jinja2",
98 "../resources/play_store_resources.cc",
99 "../webapp/background/background.js",
100 "../webapp/butter_bar.js",
101 "../webapp/client_screen.js",
102 "../webapp/error.js",
103 "../webapp/host_list.js",
104 "../webapp/host_setup_dialog.js",
105 "../webapp/host_table_entry.js",
106 "../webapp/manifest.json.jinja2",
107 "../webapp/paired_client_manager.js",
108 "../webapp/remoting.js",
109 "../webapp/window_frame.js",
113 "remoting_strings.grd",
114 ] + sources_to_verify
116 stampfile = "$root_build_dir/remoting_resources_verified_stamp"
117 outputs = [ stampfile ]
120 "-t", rebase_path(stampfile, root_build_dir),
121 "-r", rebase_path("remoting_strings.grd", root_build_dir),
122 ] + rebase_path(sources_to_verify, root_build_dir)
124 deps = [ "//remoting/webapp:html" ] # Generates main.html.
130 source = "remoting_strings.grd"
131 output_name = "remoting_strings"
133 # The grd file encodes "remoting/..." in the name, so root everything in the
134 # generated file root.
135 output_dir = root_gen_dir
137 resource_ids = "resource_ids"
140 "remoting/base/string_resources.h",
143 # The grd produces a *.pak file and a messages.json file (this one uses
144 # underscores instead of hyphens) for each locale.
145 outputs += process_file_template(
147 [ "remoting/resources/{{source_name_part}}.pak" ])
148 outputs += process_file_template(
149 remoting_locales_with_underscores,
150 [ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ])
153 action("copy_locales") {
154 script = "../tools/build/remoting_copy_locales.py"
156 # The gyp build calls out to Python, but the Python just computes a simple
157 # replacement over the locales. Here, we can do this in GN script by
158 # pretending the locale list is a list of files. The {{source_name_part}}
159 # will just expand to the locale name.
160 inputs = process_file_template(
162 [ "$target_gen_dir/{{source_name_part}}.pak" ])
164 # Likewise, process the outputs in the same way as the inputs.
165 if (is_mac || is_ios) {
166 # On mac, use underscores instead of hyphens and put the files in a
168 outputs = process_file_template(
169 remoting_locales_with_underscores,
170 [ "$root_build_dir/remoting/resources/{{source_name_part}}.lproj/locale.pak" ])
172 outputs = process_file_template(
174 [ "$root_build_dir/remoting_locales/{{source_name_part}}.pak" ])
179 "-g", rebase_path(root_gen_dir, root_build_dir),
180 "-x", rebase_path(root_out_dir, root_build_dir),
183 deps = [ ":strings" ]