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.
65 # Some locales have hyphens in the names but for some uses underscores are
67 remoting_locales_with_underscores = remoting_locales
68 remoting_locales_with_underscores -= [
77 remoting_locales_with_underscores += [
88 remoting_locales += [ "en-US" ]
89 remoting_locales_with_underscores += [ "en_US" ]
97 #":verify_resources", TODO(GYP) enable this.
101 # TODO(GYP) enable verify_resources. The bots are complaining about
102 # gen/main.html not being found but this doesn't seems to reproduce locally.
104 action("verify_resources") {
105 script = "//remoting/tools/verify_resources.py"
107 sources_to_verify = [
108 "$root_gen_dir/main.html",
109 "../base/resources_unittest.cc",
110 "../host/continue_window_mac.mm",
111 "../host/disconnect_window_mac.mm",
112 "../host/installer/mac/uninstaller/remoting_uninstaller-InfoPlist.strings.jinja2",
113 "../host/mac/me2me_preference_pane-InfoPlist.strings.jinja2",
114 "../host/win/core.rc.jinja2",
115 "../host/win/host_messages.mc.jinja2",
116 "../host/win/version.rc.jinja2",
117 "../resources/play_store_resources.cc",
118 "../webapp/background/background.js",
119 "../webapp/butter_bar.js",
120 "../webapp/client_screen.js",
121 "../webapp/error.js",
122 "../webapp/host_list.js",
123 "../webapp/host_setup_dialog.js",
124 "../webapp/host_table_entry.js",
125 "../webapp/manifest.json.jinja2",
126 "../webapp/paired_client_manager.js",
127 "../webapp/remoting.js",
128 "../webapp/window_frame.js",
131 inputs = [ "remoting_strings.grd" ] + sources_to_verify
133 stampfile = "$root_build_dir/remoting_resources_verified_stamp"
140 rebase_path(stampfile, root_build_dir),
142 rebase_path("remoting_strings.grd", root_build_dir),
143 ] + rebase_path(sources_to_verify, root_build_dir)
146 "//remoting/webapp:html",
147 ] # Generates main.html.
152 source = "remoting_strings.grd"
153 output_name = "remoting_strings"
155 # The grd file encodes "remoting/..." in the name, so root everything in the
156 # generated file root.
157 output_dir = root_gen_dir
160 "remoting/base/string_resources.h",
163 # The grd produces a *.pak file and a messages.json file (this one uses
164 # underscores instead of hyphens) for each locale.
166 process_file_template(remoting_locales,
167 [ "remoting/resources/{{source_name_part}}.pak" ])
169 messages_locales = remoting_locales_with_underscores
171 # The messages output includes a separate one for en-US that the pak ones
172 # don't have. We don't need to do this on ChromeOS since en_US is in the
173 # locales list be default there.
174 messages_locales += [ "en_US" ]
176 outputs += process_file_template(
178 [ "remoting/webapp/_locales/{{source_name_part}}/messages.json" ])
181 action("copy_locales") {
182 script = "../tools/build/remoting_copy_locales.py"
184 # The gyp build calls out to Python, but the Python just computes a simple
185 # replacement over the locales. Here, we can do this in GN script by
186 # pretending the locale list is a list of files. The {{source_name_part}}
187 # will just expand to the locale name.
188 inputs = process_file_template(remoting_locales,
189 [ "$target_gen_dir/{{source_name_part}}.pak" ])
191 # Likewise, process the outputs in the same way as the inputs.
192 if (is_mac || is_ios) {
193 # On mac, use underscores instead of hyphens and put the files in a
195 outputs = process_file_template(
196 remoting_locales_with_underscores,
197 [ "$root_build_dir/remoting/resources/{{source_name_part}}.lproj/locale.pak" ])
199 outputs = process_file_template(
201 [ "$root_build_dir/remoting_locales/{{source_name_part}}.pak" ])
208 rebase_path(root_gen_dir, root_build_dir),
210 rebase_path(root_out_dir, root_build_dir),