OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 # Keep in sync with 'remoting_webapp' target in remoting/remoting_client.gypi. | 5 # Keep in sync with 'remoting_webapp' target in remoting/remoting_client.gypi. |
6 | 6 |
7 import("//build/config/chrome_build.gni") | 7 import("//build/config/chrome_build.gni") |
8 import("//build/util/version.gni") | 8 import("//build/util/version.gni") |
9 import("//remoting/remoting_locales.gni") | 9 import("//remoting/remoting_locales.gni") |
10 import("//remoting/remoting_options.gni") | 10 import("//remoting/remoting_options.gni") |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 ] | 111 ] |
112 args += [ | 112 args += [ |
113 "--template-dir", | 113 "--template-dir", |
114 rebase_path(remoting_dir, root_build_dir), | 114 rebase_path(remoting_dir, root_build_dir), |
115 ] | 115 ] |
116 args += [ "--templates" ] + html_template_include_files | 116 args += [ "--templates" ] + html_template_include_files |
117 args += [ "--js" ] + rebase_path(js_files, remoting_dir) | 117 args += [ "--js" ] + rebase_path(js_files, remoting_dir) |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 template("desktop_remoting_webapp") { | |
122 locales_listfile = target_name + "_locales" | |
123 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" | |
124 | |
125 build_locales_listfile(locales_listfile) { | |
126 # Template uses locales_listfile_output from outer scope. | |
127 } | |
128 | |
129 background_html = target_name + "_background_html" | |
130 background_html_output = "$target_gen_dir/html/$target_name/background.html" | |
131 | |
132 build_webapp_html(background_html) { | |
133 html_template_file = remoting_webapp_template_background | |
134 html_template_include_files = [] | |
135 js_files = remoting_webapp_background_html_all_js_files | |
136 html_output = background_html_output | |
137 } | |
138 | |
139 message_window_html = target_name + "_message_window_html" | |
140 message_window_html_output = | |
141 "$target_gen_dir/html/$target_name/message_window.html" | |
142 | |
143 build_webapp_html(message_window_html) { | |
144 html_template_file = remoting_webapp_template_message_window | |
145 html_template_include_files = [] | |
146 js_files = remoting_webapp_message_window_html_all_js_files | |
147 html_output = message_window_html_output | |
148 } | |
149 | |
150 wcs_sandbox_html = target_name + "_wcs_sandbox_html" | |
151 wcs_sandbox_html_output = "$target_gen_dir/html/$target_name/wcs_sandbox.html" | |
152 | |
153 build_webapp_html(wcs_sandbox_html) { | |
154 html_template_file = remoting_webapp_template_wcs_sandbox | |
155 html_template_include_files = [] | |
156 js_files = remoting_webapp_wcs_sandbox_html_all_js_files | |
157 html_output = wcs_sandbox_html_output | |
158 } | |
159 | |
160 main_html = target_name + "_main_html" | |
161 main_html_output = "$target_gen_dir/html/$target_name/main.html" | |
162 | |
163 build_webapp_html(main_html) { | |
164 html_template_file = remoting_webapp_template_main | |
165 html_template_include_files = remoting_webapp_template_files | |
166 js_files = remoting_webapp_crd_main_html_all_js_files | |
167 html_output = main_html_output | |
168 } | |
169 | |
170 action(target_name) { | |
171 script = "//remoting/webapp/build-webapp.py" | |
172 | |
173 webapp_type = invoker.webapp_type | |
174 output_dir = invoker.output_dir | |
175 zip_path = invoker.zip_path | |
176 extra_files = invoker.extra_files | |
177 | |
178 dr_generated_html_files = [ | |
179 background_html_output, | |
180 message_window_html_output, | |
181 wcs_sandbox_html_output, | |
182 main_html_output, | |
183 "$target_gen_dir/credits.html", | |
184 ] | |
185 | |
186 inputs = [ rebase_path("crd/manifest.json.jinja2", root_build_dir) ] + | |
187 remoting_version_files + | |
188 rebase_path(remoting_webapp_crd_files, root_build_dir) + | |
189 extra_files + dr_generated_html_files | |
190 | |
191 outputs = [ | |
192 zip_path, | |
193 ] | |
194 | |
195 deps = [ | |
196 ":$locales_listfile", | |
197 ":$background_html", | |
198 ":$message_window_html", | |
199 ":$wcs_sandbox_html", | |
200 ":$main_html", | |
201 "//remoting/resources", | |
202 "//remoting/webapp:credits", | |
203 ] | |
204 | |
205 # Create a file that contains a list of all the resource files needed | |
206 # to build the webapp. This is needed to avoid problems on platforms that | |
207 # limit the size of a command line. | |
208 file_list = "$target_gen_dir/${target_name}_files.txt" | |
209 files = [] | |
210 files += rebase_path(dr_generated_html_files, root_build_dir) | |
211 files += rebase_path(remoting_webapp_crd_files, root_build_dir) | |
212 files += rebase_path(extra_files, root_build_dir) | |
213 write_file(file_list, files) | |
214 | |
215 args = [ | |
216 buildtype, | |
217 chrome_version_full, | |
218 rebase_path(output_dir, root_build_dir), | |
219 rebase_path(zip_path, root_build_dir), | |
220 rebase_path("crd/manifest.json.jinja2", root_build_dir), | |
221 webapp_type, | |
222 ] | |
223 args += [ | |
224 "--files_listfile", | |
225 rebase_path(file_list, root_build_dir), | |
226 ] | |
227 args += [ | |
228 "--locales_listfile", | |
229 rebase_path(locales_listfile_output, root_build_dir), | |
230 ] | |
231 args += [ | |
232 "--use_gcd", | |
233 "$remoting_use_gcd", | |
234 ] | |
235 } | |
236 } | |
237 | |
238 template("app_remoting_webapp") { | 121 template("app_remoting_webapp") { |
239 locales_listfile = target_name + "_locales" | 122 locales_listfile = target_name + "_locales" |
240 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" | 123 locales_listfile_output = "$target_gen_dir/${target_name}_locales.txt" |
241 | 124 |
242 build_locales_listfile(locales_listfile) { | 125 build_locales_listfile(locales_listfile) { |
243 # TODO(garykac) Replace resources with empty stub rather than duplicating | 126 # TODO(garykac) Replace resources with empty stub rather than duplicating |
244 # all the resources needed by the shared module. | 127 # all the resources needed by the shared module. |
245 # Template uses locales_listfile_output from outer scope. | 128 # Template uses locales_listfile_output from outer scope. |
246 } | 129 } |
247 | 130 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 args += [ | 392 args += [ |
510 "--files_listfile", | 393 "--files_listfile", |
511 rebase_path(file_list, root_build_dir), | 394 rebase_path(file_list, root_build_dir), |
512 ] | 395 ] |
513 args += [ | 396 args += [ |
514 "--locales_listfile", | 397 "--locales_listfile", |
515 rebase_path(locales_listfile_output, root_build_dir), | 398 rebase_path(locales_listfile_output, root_build_dir), |
516 ] | 399 ] |
517 } | 400 } |
518 } | 401 } |
OLD | NEW |