DevTools: prepare to migrate worker ids from ints to strings.
[chromium-blink-merge.git] / remoting / app_remoting_webapp_build.gypi
blobcdd5ecf5348ed572f52dd33f7ea36e6d84717c6b
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   'variables': {
15     # The ar_service_environment variable is used to define the target
16     # environment for the app being built.
17     # The allowed values are dev, test, staging, and prod.
18     'conditions': [
19       ['buildtype == "Dev"', {
20         'ar_service_environment%': 'dev',
21       }, {  # buildtype != 'Dev'
22         # Non-dev build must have this set to 'prod'.
23         'ar_service_environment': 'prod',
24       }],
25     ],  # conditions
26   },  # end of variables
28   'target_defaults': {
29     'type': 'none',
31     'dependencies': [
32       # TODO(wez): Create proper resources for shared-stub and app-specific
33       # stubs.
34       '<(DEPTH)/remoting/remoting.gyp:remoting_resources',
35     ],
37     'locale_files': [
38       '<@(remoting_webapp_locale_files)',
39     ],
41     'includes': [
42       '../chrome/js_unittest_vars.gypi',
43     ],
45     'variables': {
46       'ar_app_manifest_app':
47         '>(ar_app_path)/manifest.json.jinja2',
48       'ar_app_manifest_common':
49         'webapp/app_remoting/manifest_common.json.jinja2',
50       'ar_app_specific_files': [
51         '>(ar_app_path)/icon16.png',
52         '>(ar_app_path)/icon48.png',
53         '>(ar_app_path)/icon128.png',
54       ],
55       'ar_generated_html_files': [
56         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
57         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
58         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
59       ],
60       'ar_webapp_files': [
61         '<@(ar_app_specific_files)',
62         '<@(ar_shared_resource_files)',
63         '<@(ar_all_js_files)',
64         '<@(ar_generated_html_files)',
65       ],
66       'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
67       'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
68       'remoting_app_id': [],
69       'remoting_app_name': '>(_app_name)',
70       'remoting_app_description': '>(_app_description)',
72       'ar_webapp_locales_listfile': '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)_locales.txt',
74       'conditions': [
75         ['ar_internal != 1', {
76           'ar_app_name': 'sample_app',
77           'ar_app_path': 'webapp/app_remoting/apps/>(ar_app_name)',
78         }, {
79           # This takes target names of the form 'ar_vvv_xxx_xxx' and extracts
80           # the vendor ('vvv') and the app name ('xxx_xxx').
81           'ar_app_vendor': '>!(python -c "import sys; print sys.argv[1].split(\'_\')[1]" >(_target_name))',
82           'ar_app_name': '>!(python -c "import sys; print \'_\'.join(sys.argv[1].split(\'_\')[2:])" >(_target_name))',
83           'ar_app_path': 'webapp/app_remoting/internal/apps/>(ar_app_vendor)/>(ar_app_name)',
84         }],
85       ],  # conditions
87     },  # variables
89     'actions': [
90       {
91         'action_name': 'Build ">(ar_app_name)" locales listfile',
92         'inputs': [
93           '<(remoting_localize_path)',
94         ],
95         'outputs': [
96           '<(ar_webapp_locales_listfile)',
97         ],
98         'action': [
99           'python', '<(remoting_localize_path)',
100           '--locale_output',
101           '"<(webapp_locale_dir)/@{json_suffix}/messages.json"',
102           '--locales_listfile',
103           '<(ar_webapp_locales_listfile)',
104           '<@(remoting_locales)',
105         ],
106       },
107       {
108         'action_name': 'Build ">(ar_app_name)" application stub',
109         'inputs': [
110           '<(DEPTH)/remoting/webapp/build-webapp.py',
111           '<(chrome_version_path)',
112           '<(remoting_version_path)',
113           '<@(ar_webapp_files)',
114           '<@(remoting_webapp_locale_files)',
115           '<@(ar_generated_html_files)',
116           '<(ar_app_manifest_app)',
117           '<(DEPTH)/remoting/<(ar_app_manifest_common)',
118           '<(ar_webapp_locales_listfile)',
119         ],
120         'outputs': [
121           '<(output_dir)',
122           '<(zip_path)',
123         ],
124         'action': [
125           'python', '<(DEPTH)/remoting/webapp/build-webapp.py',
126           '<(buildtype)',
127           '<(version_full)',
128           '<(output_dir)',
129           '<(zip_path)',
130           '<(ar_app_manifest_app)', # Manifest template
131           'app_remoting',  # Web app type
132           '<@(ar_webapp_files)',
133           '<@(ar_generated_html_files)',
134           '--locales_listfile',
135           '<(ar_webapp_locales_listfile)',
136           '--jinja_paths',
137           '<(DEPTH)/remoting/webapp/app_remoting',
138           '<@(remoting_app_id)',
139           '--app_name',
140           '<(remoting_app_name)',
141           '--app_description',
142           '<(remoting_app_description)',
143           '--app_capabilities',
144           '>@(_app_capabilities)',
145           '--service_environment',
146           '<@(ar_service_environment)',
147         ],
148       },
149       {
150         'action_name': 'Build ">(ar_app_name)" main.html',
151         'inputs': [
152           '<(DEPTH)/remoting/webapp/build-html.py',
153           '<(ar_main_template)',
154           '<@(ar_main_template_files)',
155         ],
156         'outputs': [
157           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
158         ],
159         'action': [
160           'python', '<(DEPTH)/remoting/webapp/build-html.py',
161           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
162           '<(ar_main_template)',
163           '--template-dir',
164           '<(DEPTH)/remoting',
165           '--templates',
166           '<@(ar_main_template_files)',
167           '--js',
168           '<@(ar_main_js_files)',
169         ],
170       },
171       {
172         'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
173         'inputs': [
174           '<(DEPTH)/remoting/webapp/build-html.py',
175           '<(remoting_webapp_template_wcs_sandbox)',
176         ],
177         'outputs': [
178           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
179         ],
180         'action': [
181           'python', '<(DEPTH)/remoting/webapp/build-html.py',
182           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
183           '<(remoting_webapp_template_wcs_sandbox)',
184           '--template-dir',
185           '<(DEPTH)/remoting',
186           '--js',
187           '<@(remoting_webapp_wcs_sandbox_html_js_files)',
188         ],
189       },
190       {
191         'action_name': 'Build ">(ar_app_name)" feedback_consent.html',
192         'inputs': [
193           '<(DEPTH)/remoting/webapp/build-html.py',
194           '<(ar_feedback_consent_template)',
195           '<@(ar_feedback_consent_template_files)',
196         ],
197         'outputs': [
198           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
199         ],
200         'action': [
201           'python', '<(DEPTH)/remoting/webapp/build-html.py',
202           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
203           '<(ar_feedback_consent_template)',
204           '--template-dir',
205           '<(DEPTH)/remoting',
206           '--templates',
207           '<@(ar_feedback_consent_template_files)',
208           '--js',
209           '<@(ar_feedback_consent_js_files)',
210         ],
211       },
212     ],  # actions
213     'conditions': [
214       ['buildtype == "Dev"', {
215         # Normally, the app-id for the orchestrator is automatically extracted
216         # from the webapp's extension id, but that approach doesn't work for
217         # dev webapp builds (since they all share the same dev extension id).
218         # The --appid arg will create a webapp that registers the given app-id
219         # rather than using the extension id.
220         # This is only done for Dev apps because the app-id for Release apps
221         # *must* match the extension id.
222         'variables': {
223           'remoting_app_id': ['--appid', '>(_app_id)'],
224         },
225       }],
226     ],  # conditions
227   },  # target_defaults