fileapi: Use standard task-runner to run the fileapi callbacks.
[chromium-blink-merge.git] / remoting / app_remoting_webapp_build.gypi
blobd5da9ebd0d1a626083e846a3120b8254bcdf91b7
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_webapp_files.gypi',
10     'app_remoting_webapp_files.gypi',
11   ],
13   'variables': {
14     'chromium_code': 1,
16     'run_jscompile%': 0,
18     # The ar_service_environment variable is used to define the target
19     # environment for the app being built.
20     # The allowed values are dev, test, staging, and prod.
21     'conditions': [
22       ['buildtype == "Dev"', {
23         'ar_service_environment%': 'dev',
24       }, {  # buildtype != 'Dev'
25         # Non-dev build must have this set to 'prod'.
26         'ar_service_environment': 'prod',
27       }],
28     ],  # conditions
29   },  # end of variables
31   'target_defaults': {
32     'type': 'none',
34     'dependencies': [
35       # TODO(wez): Create proper resources for shared-stub and app-specific
36       # stubs.
37       '<(DEPTH)/remoting/remoting.gyp:remoting_resources',
38     ],
40     'locale_files': [
41       '<@(remoting_webapp_locale_files)',
42     ],
44     'includes': [
45       '../chrome/js_unittest_vars.gypi',
46     ],
48     'variables': {
49       'ar_app_manifest_app':
50         '>(ar_app_path)/manifest.json.jinja2',
51       'ar_app_manifest_common':
52         'webapp/app_remoting/manifest_common.json.jinja2',
53       'ar_app_specific_files': [
54         '>(ar_app_path)/icon16.png',
55         '>(ar_app_path)/icon48.png',
56         '>(ar_app_path)/icon128.png',
57       ],
58       'ar_generated_html_files': [
59         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
60         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
61       ],
62       'ar_webapp_files': [
63         '<@(ar_app_specific_files)',
64         '<@(ar_shared_resource_files)',
65         '<@(ar_all_js_files)',
66         '<@(ar_generated_html_files)',
67       ],
68       'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
69       'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
70       'remoting_app_id': [],
71       'remoting_app_name': '>(_app_name)',
72       'remoting_app_description': '>(_app_description)',
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)" application stub',
92         'inputs': [
93           '<(DEPTH)/remoting/webapp/build-webapp.py',
94           '<(chrome_version_path)',
95           '<(remoting_version_path)',
96           '<@(ar_webapp_files)',
97           '<@(remoting_webapp_locale_files)',
98           '<@(ar_generated_html_files)',
99           '<(ar_app_manifest_app)',
100           '<(DEPTH)/remoting/<(ar_app_manifest_common)',
101         ],
102         'outputs': [
103           '<(output_dir)',
104           '<(zip_path)',
105         ],
106         'action': [
107           'python', '<(DEPTH)/remoting/webapp/build-webapp.py',
108           '<(buildtype)',
109           '<(version_full)',
110           '<(output_dir)',
111           '<(zip_path)',
112           '<(ar_app_manifest_app)', # Manifest template
113           'app_remoting',  # Web app type
114           '<@(ar_webapp_files)',
115           '<@(ar_generated_html_files)',
116           '--locales',
117           '<@(remoting_webapp_locale_files)',
118           '--jinja_paths',
119           '<(DEPTH)/remoting/webapp/app_remoting',
120           '<@(remoting_app_id)',
121           '--app_name',
122           '<(remoting_app_name)',
123           '--app_description',
124           '<(remoting_app_description)',
125           '--app_capabilities',
126           '>@(_app_capabilities)',
127           '--service_environment',
128           '<@(ar_service_environment)',
129         ],
130       },
131       {
132         'action_name': 'Build ">(ar_app_name)" main.html',
133         'inputs': [
134           '<(DEPTH)/remoting/webapp/build-html.py',
135           '<(ar_main_template)',
136           '<@(ar_main_template_files)',
137         ],
138         'outputs': [
139           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
140         ],
141         'action': [
142           'python', '<(DEPTH)/remoting/webapp/build-html.py',
143           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
144           '<(ar_main_template)',
145           '--template-dir',
146           '<(DEPTH)/remoting',
147           '--templates',
148           '<@(ar_main_template_files)',
149           '--js',
150           '<@(ar_main_js_files)',
151         ],
152       },
153       {
154         'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
155         'inputs': [
156           '<(DEPTH)/remoting/webapp/build-html.py',
157           '<(remoting_webapp_template_wcs_sandbox)',
158         ],
159         'outputs': [
160           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
161         ],
162         'action': [
163           'python', '<(DEPTH)/remoting/webapp/build-html.py',
164           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
165           '<(remoting_webapp_template_wcs_sandbox)',
166           '--template-dir',
167           '<(DEPTH)/remoting',
168           '--js',
169           '<@(remoting_webapp_wcs_sandbox_html_js_files)',
170         ],
171       },
172     ],  # actions
173     'conditions': [
174       ['buildtype == "Dev"', {
175         # Normally, the app-id for the orchestrator is automatically extracted
176         # from the webapp's extension id, but that approach doesn't work for
177         # dev webapp builds (since they all share the same dev extension id).
178         # The --appid arg will create a webapp that registers the given app-id
179         # rather than using the extension id.
180         # This is only done for Dev apps because the app-id for Release apps
181         # *must* match the extension id.
182         'variables': {
183           'remoting_app_id': ['--appid', '>(_app_id)'],
184         },
185       }],
186     ],  # conditions
187   },  # target_defaults