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.
7 'remoting_version.gypi',
8 'remoting_webapp_files.gypi',
16 # This variable is used to define the target environment for the app
17 # being built. The allowed values are dev, test, staging, and prod.
18 'ar_service_environment%': 'dev',
20 # Identify internal vs. public build targets.
23 'remoting_localize_path': 'tools/build/remoting_localize.py',
25 # TODO(wez): Split into shared-stub and app-specific resources.
26 'webapp_locale_dir': '<(SHARED_INTERMEDIATE_DIR)/remoting/webapp/_locales',
30 'remoting_webapp_locale_files': [
31 # Build the list of .json files generated from remoting_strings.grd.
32 '<!@pymod_do_main(remoting_localize --locale_output '
33 '"<(webapp_locale_dir)/@{json_suffix}/messages.json" '
34 '--print_only <(remoting_locales))',
37 'ar_shared_resource_files': [
38 'webapp/app_remoting/html/ar_dialog.css',
39 'webapp/app_remoting/html/feedback_consent.css',
40 'webapp/app_remoting/html/feedback_consent.html',
41 'webapp/app_remoting/html/context_menu.css',
42 'resources/drag.webp',
43 '<@(remoting_webapp_resource_files)',
46 # Variables for main.html.
47 # These template files are used to construct the webapp html files.
49 'webapp/app_remoting/html/template_lg.html',
50 'ar_main_template_files': [
51 'webapp/base/html/client_plugin.html',
52 'webapp/base/html/dialog_auth.html',
53 'webapp/app_remoting/html/context_menu.html',
54 'webapp/app_remoting/html/idle_dialog.html',
57 'webapp/app_remoting/js/application_context_menu.js',
58 'webapp/app_remoting/js/app_remoting.js',
59 'webapp/app_remoting/js/ar_main.js',
60 'webapp/app_remoting/js/context_menu_adapter.js',
61 'webapp/app_remoting/js/context_menu_chrome.js',
62 'webapp/app_remoting/js/context_menu_dom.js',
63 'webapp/app_remoting/js/drag_and_drop.js',
64 'webapp/app_remoting/js/idle_detector.js',
65 'webapp/app_remoting/js/keyboard_layouts_menu.js',
66 'webapp/app_remoting/js/loading_window.js',
67 'webapp/app_remoting/js/submenu_manager.js',
68 'webapp/app_remoting/js/window_activation_menu.js',
69 'webapp/base/js/application.js',
70 'webapp/base/js/auth_dialog.js',
71 'webapp/base/js/base.js',
72 'webapp/base/js/message_window_helper.js',
73 'webapp/base/js/message_window_manager.js',
74 '<@(remoting_webapp_js_auth_client2host_files)',
75 '<@(remoting_webapp_js_auth_google_files)',
76 '<@(remoting_webapp_js_cast_extension_files)',
77 '<@(remoting_webapp_js_client_files)',
78 '<@(remoting_webapp_js_core_files)',
79 '<@(remoting_webapp_js_gnubby_auth_files)',
80 '<@(remoting_webapp_js_host_files)',
81 '<@(remoting_webapp_js_logging_files)',
82 '<@(remoting_webapp_js_signaling_files)',
83 '<@(remoting_webapp_js_ui_files)',
86 'ar_background_js_files': [
87 'webapp/app_remoting/js/ar_background.js',
88 'webapp/base/js/platform.js',
92 '<@(ar_main_js_files)',
93 # Referenced from wcs_sandbox.html.
94 '<@(remoting_webapp_js_wcs_sandbox_files)',
95 # Referenced from the manifest.
96 '<@(ar_background_js_files)',
97 # Referenced from feedback_consent.html.
98 'webapp/app_remoting/js/feedback_consent.js',
99 # Referenced from message_window.html.
100 'webapp/base/js/message_window.js',
102 }, # end of variables
108 # TODO(wez): Create proper resources for shared-stub and app-specific
110 '../remoting/remoting.gyp:remoting_resources',
114 '<@(remoting_webapp_locale_files)',
118 '../chrome/js_unittest_vars.gypi',
122 'ar_app_manifest_app':
123 '>(ar_app_path)/manifest.json.jinja2',
124 'ar_app_manifest_common':
125 'webapp/app_remoting/manifest_common.json.jinja2',
126 'ar_app_specific_files': [
127 '>(ar_app_path)/icon16.png',
128 '>(ar_app_path)/icon48.png',
129 '>(ar_app_path)/icon128.png',
131 'ar_generated_html_files': [
132 '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
133 '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
136 '<@(ar_app_specific_files)',
137 '<@(ar_shared_resource_files)',
138 '<@(ar_all_js_files)',
139 '<@(ar_generated_html_files)',
141 'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
142 'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
143 'remoting_app_id': [],
144 'remoting_app_name': '>(_app_name)',
145 'remoting_app_description': '>(_app_description)',
148 ['ar_internal != 1', {
149 'ar_app_name': 'sample_app',
150 'ar_app_path': 'webapp/app_remoting/apps/>(ar_app_name)',
152 # This takes target names of the form 'ar_vvv_xxx_xxx' and extracts
153 # the vendor ('vvv') and the app name ('xxx_xxx').
154 'ar_app_vendor': '>!(python -c "import sys; print sys.argv[1].split(\'_\')[1]" >(_target_name))',
155 'ar_app_name': '>!(python -c "import sys; print \'_\'.join(sys.argv[1].split(\'_\')[2:])" >(_target_name))',
156 'ar_app_path': 'webapp/app_remoting/apps/internal/>(ar_app_vendor)/>(ar_app_name)',
164 'action_name': 'Build ">(ar_app_name)" application stub',
166 'webapp/build-webapp.py',
167 '<(chrome_version_path)',
168 '<(remoting_version_path)',
169 '<@(ar_webapp_files)',
170 '<@(remoting_webapp_locale_files)',
171 '<@(ar_generated_html_files)',
172 '<(ar_app_manifest_app)',
173 '<(ar_app_manifest_common)',
180 'python', 'webapp/build-webapp.py',
185 '<(ar_app_manifest_app)', # Manifest template
186 'app_remoting', # Web app type
187 '<@(ar_webapp_files)',
188 '<@(ar_generated_html_files)',
190 '<@(remoting_webapp_locale_files)',
192 'webapp/app_remoting',
193 '<@(remoting_app_id)',
195 '<(remoting_app_name)',
197 '<(remoting_app_description)',
198 '--service_environment',
199 '<@(ar_service_environment)',
203 'action_name': 'Build ">(ar_app_name)" main.html',
205 'webapp/build-html.py',
206 '<(ar_main_template)',
207 '<@(ar_main_template_files)',
210 '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
213 'python', 'webapp/build-html.py',
214 '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
215 '<(ar_main_template)',
217 '<@(ar_main_template_files)',
219 '<@(ar_main_js_files)',
223 'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
225 'webapp/build-html.py',
226 '<(remoting_webapp_template_wcs_sandbox)',
229 '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
232 'python', 'webapp/build-html.py',
233 '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
234 '<(remoting_webapp_template_wcs_sandbox)',
236 '<@(remoting_webapp_wcs_sandbox_html_js_files)',
241 ['buildtype == "Dev"', {
242 # Normally, the app-id for the orchestrator is automatically extracted
243 # from the webapp's extension id, but that approach doesn't work for
244 # dev webapp builds (since they all share the same dev extension id).
245 # The --appid arg will create a webapp that registers the given app-id
246 # rather than using the extension id.
247 # This is only done for Dev apps because the app-id for Release apps
248 # *must* match the extension id.
250 'remoting_app_id': ['--appid', '>(_app_id)'],
253 ['run_jscompile != 0', {
256 'action_name': 'Verify >(ar_app_name) main.html',
258 'success_stamp': '<(PRODUCT_DIR)/>(_target_name)_main_jscompile.stamp',
261 'tools/jscompile.py',
262 '<@(ar_main_js_files)',
263 '<@(remoting_webapp_js_proto_files)',
264 # Include zip as input so that this action is run after the build.
271 'python', 'tools/jscompile.py',
272 '<@(ar_main_js_files)',
273 '<@(remoting_webapp_js_proto_files)',
279 'action_name': 'Verify >(ar_app_name) background.js',
281 'success_stamp': '<(PRODUCT_DIR)/>(_target_name)_background_jscompile.stamp',
284 'tools/jscompile.py',
285 '<@(ar_background_js_files)',
286 '<@(remoting_webapp_js_proto_files)',
287 # Include zip as input so that this action is run after the build.
294 'python', 'tools/jscompile.py',
295 '<@(ar_background_js_files)',
296 '<@(remoting_webapp_js_proto_files)',