Clarify and update GN build flags docs.
[chromium-blink-merge.git] / remoting / app_remoting_webapp_build.gypi
blobbc6ffa6b662d32106a4ae86582f23e4dedb0407f
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.
6   'includes': [
7     'remoting_version.gypi',
8     'remoting_locales.gypi',
9     'remoting_options.gypi',
10     'remoting_webapp_files.gypi',
11     'app_remoting_webapp_files.gypi',
12   ],
14   # GN version: See remoting/webapp/build_template.gni
15   'target_defaults': {
16     'type': 'none',
18     'dependencies': [
19       # TODO(wez): Create proper resources for shared-stub and app-specific
20       # stubs.
21       '<(DEPTH)/remoting/remoting.gyp:remoting_resources',
22     ],
24     'locale_files': [
25       '<@(remoting_webapp_locale_files)',
26     ],
28     'includes': [
29       '../chrome/js_unittest_vars.gypi',
30     ],
32     'variables': {
33       'ar_app_manifest_app':
34         '>(ar_app_path)/manifest.json.jinja2',
35       'ar_app_manifest_common':
36         'webapp/app_remoting/manifest_common.json.jinja2',
37       'ar_app_specific_files': [
38         '>(ar_app_path)/icon16.png',
39         '>(ar_app_path)/icon48.png',
40         '>(ar_app_path)/icon128.png',
41         '>(ar_app_path)/loading_splash.png',
42       ],
43       'ar_generated_html_files': [
44         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
45         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
46         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
47         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
48         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
49       ],
50       'ar_webapp_files': [
51         '<@(ar_app_specific_files)',
52         '<@(ar_shared_resource_files)',
53         '<@(ar_all_js_files)',
54         '<@(ar_generated_html_files)',
55       ],
56       'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
57       'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
58       'remoting_app_id': [],
59       'remoting_app_name': '>(_app_name)',
60       'remoting_app_description': '>(_app_description)',
62       'ar_webapp_locales_listfile': '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)_locales.txt',
64       'conditions': [
65         ['ar_internal != 1', {
66           'ar_app_name': 'sample_app',
67           'ar_app_path': 'webapp/app_remoting/apps/>(ar_app_name)',
68         }, {
69           # This takes target names of the form 'ar_vvv_xxx_xxx' and extracts
70           # the vendor ('vvv') and the app name ('xxx_xxx').
71           'ar_app_vendor': '>!(python -c "import sys; print sys.argv[1].split(\'_\')[1]" >(_target_name))',
72           'ar_app_name': '>!(python -c "import sys; print \'_\'.join(sys.argv[1].split(\'_\')[2:])" >(_target_name))',
73           'ar_app_path': 'webapp/app_remoting/internal/apps/>(ar_app_vendor)/>(ar_app_name)',
74         }],
75       ],  # conditions
77     },  # variables
79     'actions': [
80       {
81         'action_name': 'Build ">(ar_app_name)" locales listfile',
82         'inputs': [
83           '<(remoting_localize_path)',
84         ],
85         'outputs': [
86           '<(ar_webapp_locales_listfile)',
87         ],
88         'action': [
89           'python', '<(remoting_localize_path)',
90           '--locale_output',
91           '"<(webapp_locale_dir)/@{json_suffix}/messages.json"',
92           '--locales_listfile',
93           '<(ar_webapp_locales_listfile)',
94           '<@(remoting_locales)',
95         ],
96       },
97       {
98         'action_name': 'Build ">(ar_app_name)" application stub',
99         'inputs': [
100           '<(DEPTH)/remoting/webapp/build-webapp.py',
101           '<(chrome_version_path)',
102           '<(remoting_version_path)',
103           '<@(ar_webapp_files)',
104           '<@(remoting_webapp_locale_files)',
105           '<@(ar_generated_html_files)',
106           '<(ar_app_manifest_app)',
107           '<(DEPTH)/remoting/<(ar_app_manifest_common)',
108           '<(ar_webapp_locales_listfile)',
109         ],
110         'outputs': [
111           '<(output_dir)',
112           '<(zip_path)',
113         ],
114         'action': [
115           'python', '<(DEPTH)/remoting/webapp/build-webapp.py',
116           '<(buildtype)',
117           '<(version_full)',
118           '<(output_dir)',
119           '<(zip_path)',
120           '<(ar_app_manifest_app)', # Manifest template
121           'app_remoting',  # Web app type
122           '<@(ar_webapp_files)',
123           '--locales_listfile',
124           '<(ar_webapp_locales_listfile)',
125           '--jinja_paths',
126           '<(DEPTH)/remoting/webapp/app_remoting',
127           '<@(remoting_app_id)',
128           '--app_name',
129           '<(remoting_app_name)',
130           '--app_description',
131           '<(remoting_app_description)',
132           '--app_capabilities',
133           '>@(_app_capabilities)',
134           '--service_environment',
135           '<@(ar_service_environment)',
136           '--manifest_key',
137           '>@(_manifest_key)',
138           '--app_client_id',
139           '>@(_app_client_id)',
140         ],
141       },
142       {
143         'action_name': 'Build ">(ar_app_name)" main.html',
144         'inputs': [
145           '<(DEPTH)/remoting/webapp/build-html.py',
146           '<(ar_main_template)',
147           '<@(ar_main_template_files)',
148         ],
149         'outputs': [
150           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
151         ],
152         'action': [
153           'python', '<(DEPTH)/remoting/webapp/build-html.py',
154           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
155           '<(ar_main_template)',
156           '--template-dir',
157           '<(DEPTH)/remoting',
158           '--templates',
159           '<@(ar_main_template_files)',
160           '--js',
161           '<@(ar_main_js_files)',
162         ],
163       },
164       {
165         'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
166         'inputs': [
167           '<(DEPTH)/remoting/webapp/build-html.py',
168           '<(remoting_webapp_template_wcs_sandbox)',
169         ],
170         'outputs': [
171           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
172         ],
173         'action': [
174           'python', '<(DEPTH)/remoting/webapp/build-html.py',
175           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
176           '<(remoting_webapp_template_wcs_sandbox)',
177           '--js',
178           '<@(remoting_webapp_wcs_sandbox_html_all_js_files)',
179         ],
180       },
181       {
182         'action_name': 'Build ">(ar_app_name)" loading_window.html',
183         'inputs': [
184           '<(DEPTH)/remoting/webapp/build-html.py',
185           '<(ar_loading_window_template)',
186         ],
187         'outputs': [
188           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
189         ],
190         'action': [
191           'python', '<(DEPTH)/remoting/webapp/build-html.py',
192           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html',
193           '<(ar_loading_window_template)',
194           # The loading window is just a reskin of the message window--all
195           # JS code is shared.
196           '--js', '<@(remoting_webapp_message_window_html_all_js_files)',
197         ],
198       },
199       {
200         'action_name': 'Build ">(ar_app_name)" message_window.html',
201         'inputs': [
202           '<(DEPTH)/remoting/webapp/build-html.py',
203           '<(remoting_webapp_template_message_window)',
204         ],
205         'outputs': [
206           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
207         ],
208         'action': [
209           'python', '<(DEPTH)/remoting/webapp/build-html.py',
210           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
211           '<(remoting_webapp_template_message_window)',
212           '--js', '<@(remoting_webapp_message_window_html_all_js_files)',
213         ],
214       },
215       {
216         'action_name': 'Build ">(ar_app_name)" feedback_consent.html',
217         'inputs': [
218           '<(DEPTH)/remoting/webapp/build-html.py',
219           '<(ar_feedback_consent_template)',
220         ],
221         'outputs': [
222           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
223         ],
224         'action': [
225           'python', '<(DEPTH)/remoting/webapp/build-html.py',
226           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
227           '<(ar_feedback_consent_template)',
228           '--template-dir',
229           '<(DEPTH)/remoting',
230           '--js',
231           '<@(ar_feedback_consent_html_all_js_files)',
232         ],
233       },
234     ],  # actions
235     'conditions': [
236       ['buildtype == "Dev"', {
237         # Normally, the app-id for the orchestrator is automatically extracted
238         # from the webapp's extension id, but that approach doesn't work for
239         # dev webapp builds (since they all share the same dev extension id).
240         # The --appid arg will create a webapp that registers the given app-id
241         # rather than using the extension id.
242         # This is only done for Dev apps because the app-id for Release apps
243         # *must* match the extension id.
244         'variables': {
245           'remoting_app_id': ['--appid', '>(_app_id)'],
246         },
247       }],
248     ],  # conditions
249   },  # target_defaults