Copy Smart Lock user preferences to local state so we can access them on the sign...
[chromium-blink-merge.git] / remoting / app_remoting_webapp_build.gypi
blobcf7e2af2d498b2dc257d8ddebbd1eb0b326e0bf1
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     # This variable is used to define the target environment for the app
19     # being built.  The allowed values are dev, test, staging, and prod.
20     'ar_service_environment%': 'dev',
21   },  # end of variables
23   'target_defaults': {
24     'type': 'none',
26     'dependencies': [
27       # TODO(wez): Create proper resources for shared-stub and app-specific
28       # stubs.
29       '<(DEPTH)/remoting/remoting.gyp:remoting_resources',
30     ],
32     'locale_files': [
33       '<@(remoting_webapp_locale_files)',
34     ],
36     'includes': [
37       '../chrome/js_unittest_vars.gypi',
38     ],
40     'variables': {
41       'ar_app_manifest_app':
42         '>(ar_app_path)/manifest.json.jinja2',
43       'ar_app_manifest_common':
44         'webapp/app_remoting/manifest_common.json.jinja2',
45       'ar_app_specific_files': [
46         '>(ar_app_path)/icon16.png',
47         '>(ar_app_path)/icon48.png',
48         '>(ar_app_path)/icon128.png',
49       ],
50       'ar_generated_html_files': [
51         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
52         '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
53       ],
54       'ar_webapp_files': [
55         '<@(ar_app_specific_files)',
56         '<@(ar_shared_resource_files)',
57         '<@(ar_all_js_files)',
58         '<@(ar_generated_html_files)',
59       ],
60       'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)',
61       'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip',
62       'remoting_app_id': [],
63       'remoting_app_name': '>(_app_name)',
64       'remoting_app_description': '>(_app_description)',
66       'conditions': [
67         ['ar_internal != 1', {
68           'ar_app_name': 'sample_app',
69           'ar_app_path': 'webapp/app_remoting/apps/>(ar_app_name)',
70         }, {
71           # This takes target names of the form 'ar_vvv_xxx_xxx' and extracts
72           # the vendor ('vvv') and the app name ('xxx_xxx').
73           'ar_app_vendor': '>!(python -c "import sys; print sys.argv[1].split(\'_\')[1]" >(_target_name))',
74           'ar_app_name': '>!(python -c "import sys; print \'_\'.join(sys.argv[1].split(\'_\')[2:])" >(_target_name))',
75           'ar_app_path': 'webapp/app_remoting/internal/apps/>(ar_app_vendor)/>(ar_app_name)',
76         }],
77       ],  # conditions
79     },  # variables
81     'actions': [
82       {
83         'action_name': 'Build ">(ar_app_name)" application stub',
84         'inputs': [
85           '<(DEPTH)/remoting/webapp/build-webapp.py',
86           '<(chrome_version_path)',
87           '<(remoting_version_path)',
88           '<@(ar_webapp_files)',
89           '<@(remoting_webapp_locale_files)',
90           '<@(ar_generated_html_files)',
91           '<(ar_app_manifest_app)',
92           '<(DEPTH)/remoting/<(ar_app_manifest_common)',
93        ],
94         'outputs': [
95           '<(output_dir)',
96           '<(zip_path)',
97         ],
98         'action': [
99           'python', '<(DEPTH)/remoting/webapp/build-webapp.py',
100           '<(buildtype)',
101           '<(version_full)',
102           '<(output_dir)',
103           '<(zip_path)',
104           '<(ar_app_manifest_app)', # Manifest template
105           'app_remoting',  # Web app type
106           '<@(ar_webapp_files)',
107           '<@(ar_generated_html_files)',
108           '--locales',
109           '<@(remoting_webapp_locale_files)',
110           '--jinja_paths',
111           '<(DEPTH)/remoting/webapp/app_remoting',
112           '<@(remoting_app_id)',
113           '--app_name',
114           '<(remoting_app_name)',
115           '--app_description',
116           '<(remoting_app_description)',
117           '--service_environment',
118           '<@(ar_service_environment)',
119         ],
120       },
121       {
122         'action_name': 'Build ">(ar_app_name)" main.html',
123         'inputs': [
124           '<(DEPTH)/remoting/webapp/build-html.py',
125           '<(ar_main_template)',
126           '<@(ar_main_template_files)',
127         ],
128         'outputs': [
129           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
130         ],
131         'action': [
132           'python', '<(DEPTH)/remoting/webapp/build-html.py',
133           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html',
134           '<(ar_main_template)',
135           '--template-dir',
136           '<(DEPTH)/remoting',
137           '--templates',
138           '<@(ar_main_template_files)',
139           '--js',
140           '<@(ar_main_js_files)',
141         ],
142       },
143       {
144         'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html',
145         'inputs': [
146           '<(DEPTH)/remoting/webapp/build-html.py',
147           '<(remoting_webapp_template_wcs_sandbox)',
148         ],
149         'outputs': [
150           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
151         ],
152         'action': [
153           'python', '<(DEPTH)/remoting/webapp/build-html.py',
154           '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html',
155           '<(remoting_webapp_template_wcs_sandbox)',
156           '--template-dir',
157           '<(DEPTH)/remoting',
158           '--js',
159           '<@(remoting_webapp_wcs_sandbox_html_js_files)',
160         ],
161       },
162     ],  # actions
163     'conditions': [
164       ['buildtype == "Dev"', {
165         # Normally, the app-id for the orchestrator is automatically extracted
166         # from the webapp's extension id, but that approach doesn't work for
167         # dev webapp builds (since they all share the same dev extension id).
168         # The --appid arg will create a webapp that registers the given app-id
169         # rather than using the extension id.
170         # This is only done for Dev apps because the app-id for Release apps
171         # *must* match the extension id.
172         'variables': {
173           'remoting_app_id': ['--appid', '>(_app_id)'],
174         },
175       }],
176     ],  # conditions
177   },  # target_defaults