[Fallback icons] Redoing http://crrev.com/988863002/, fixing use-after-free bug.
[chromium-blink-merge.git] / remoting / app_remoting_webapp_build.gypi
blob4450de08feda2245c7cfc8691b05a42d952f06a4
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)/message_window.html',
58         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
59         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
60       ],
61       'ar_webapp_files': [
62         '<@(ar_app_specific_files)',
63         '<@(ar_shared_resource_files)',
64         '<@(ar_all_js_files)',
65         '<@(ar_generated_html_files)',
66       ],
67       'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
68       'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
69       'remoting_app_id': [],
70       'remoting_app_name': '>(_app_name)',
71       'remoting_app_description': '>(_app_description)',
73       'ar_webapp_locales_listfile': '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)_locales.txt',
75       'conditions': [
76         ['ar_internal != 1', {
77           'ar_app_name': 'sample_app',
78           'ar_app_path': 'webapp/app_remoting/apps/>(ar_app_name)',
79         }, {
80           # This takes target names of the form 'ar_vvv_xxx_xxx' and extracts
81           # the vendor ('vvv') and the app name ('xxx_xxx').
82           'ar_app_vendor': '>!(python -c "import sys; print sys.argv[1].split(\'_\')[1]" >(_target_name))',
83           'ar_app_name': '>!(python -c "import sys; print \'_\'.join(sys.argv[1].split(\'_\')[2:])" >(_target_name))',
84           'ar_app_path': 'webapp/app_remoting/internal/apps/>(ar_app_vendor)/>(ar_app_name)',
85         }],
86       ],  # conditions
88     },  # variables
90     'actions': [
91       {
92         'action_name': 'Build ">(ar_app_name)" locales listfile',
93         'inputs': [
94           '<(remoting_localize_path)',
95         ],
96         'outputs': [
97           '<(ar_webapp_locales_listfile)',
98         ],
99         'action': [
100           'python', '<(remoting_localize_path)',
101           '--locale_output',
102           '"<(webapp_locale_dir)/@{json_suffix}/messages.json"',
103           '--locales_listfile',
104           '<(ar_webapp_locales_listfile)',
105           '<@(remoting_locales)',
106         ],
107       },
108       {
109         'action_name': 'Build ">(ar_app_name)" application stub',
110         'inputs': [
111           '<(DEPTH)/remoting/webapp/build-webapp.py',
112           '<(chrome_version_path)',
113           '<(remoting_version_path)',
114           '<@(ar_webapp_files)',
115           '<@(remoting_webapp_locale_files)',
116           '<@(ar_generated_html_files)',
117           '<(ar_app_manifest_app)',
118           '<(DEPTH)/remoting/<(ar_app_manifest_common)',
119           '<(ar_webapp_locales_listfile)',
120         ],
121         'outputs': [
122           '<(output_dir)',
123           '<(zip_path)',
124         ],
125         'action': [
126           'python', '<(DEPTH)/remoting/webapp/build-webapp.py',
127           '<(buildtype)',
128           '<(version_full)',
129           '<(output_dir)',
130           '<(zip_path)',
131           '<(ar_app_manifest_app)', # Manifest template
132           'app_remoting',  # Web app type
133           '<@(ar_webapp_files)',
134           '<@(ar_generated_html_files)',
135           '--locales_listfile',
136           '<(ar_webapp_locales_listfile)',
137           '--jinja_paths',
138           '<(DEPTH)/remoting/webapp/app_remoting',
139           '<@(remoting_app_id)',
140           '--app_name',
141           '<(remoting_app_name)',
142           '--app_description',
143           '<(remoting_app_description)',
144           '--app_capabilities',
145           '>@(_app_capabilities)',
146           '--service_environment',
147           '<@(ar_service_environment)',
148         ],
149       },
150       {
151         'action_name': 'Build ">(ar_app_name)" main.html',
152         'inputs': [
153           '<(DEPTH)/remoting/webapp/build-html.py',
154           '<(ar_main_template)',
155           '<@(ar_main_template_files)',
156         ],
157         'outputs': [
158           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
159         ],
160         'action': [
161           'python', '<(DEPTH)/remoting/webapp/build-html.py',
162           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
163           '<(ar_main_template)',
164           '--template-dir',
165           '<(DEPTH)/remoting',
166           '--templates',
167           '<@(ar_main_template_files)',
168           '--js',
169           '<@(ar_main_js_files)',
170         ],
171       },
172       {
173         'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
174         'inputs': [
175           '<(DEPTH)/remoting/webapp/build-html.py',
176           '<(remoting_webapp_template_wcs_sandbox)',
177         ],
178         'outputs': [
179           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
180         ],
181         'action': [
182           'python', '<(DEPTH)/remoting/webapp/build-html.py',
183           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
184           '<(remoting_webapp_template_wcs_sandbox)',
185           '--js',
186           '<@(remoting_webapp_wcs_sandbox_html_all_js_files)',
187         ],
188       },
189       {
190         'action_name': 'Build ">(ar_app_name)" message_window.html',
191         'inputs': [
192           '<(DEPTH)/remoting/webapp/build-html.py',
193           '<(remoting_webapp_template_message_window)',
194         ],
195         'outputs': [
196           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
197         ],
198         'action': [
199           'python', '<(DEPTH)/remoting/webapp/build-html.py',
200           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html',
201           '<(remoting_webapp_template_message_window)',
202           '--js', '<@(remoting_webapp_message_window_html_all_js_files)',
203         ],
204       },
205       {
206         'action_name': 'Build ">(ar_app_name)" feedback_consent.html',
207         'inputs': [
208           '<(DEPTH)/remoting/webapp/build-html.py',
209           '<(ar_feedback_consent_template)',
210         ],
211         'outputs': [
212           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
213         ],
214         'action': [
215           'python', '<(DEPTH)/remoting/webapp/build-html.py',
216           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html',
217           '<(ar_feedback_consent_template)',
218           '--template-dir',
219           '<(DEPTH)/remoting',
220           '--js',
221           '<@(ar_feedback_consent_html_all_js_files)',
222         ],
223       },
224     ],  # actions
225     'conditions': [
226       ['buildtype == "Dev"', {
227         # Normally, the app-id for the orchestrator is automatically extracted
228         # from the webapp's extension id, but that approach doesn't work for
229         # dev webapp builds (since they all share the same dev extension id).
230         # The --appid arg will create a webapp that registers the given app-id
231         # rather than using the extension id.
232         # This is only done for Dev apps because the app-id for Release apps
233         # *must* match the extension id.
234         'variables': {
235           'remoting_app_id': ['--appid', '>(_app_id)'],
236         },
237       }],
238     ],  # conditions
239   },  # target_defaults