OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Creates a directory with with the unpacked contents of the remoting webapp. | 6 """Creates a directory with with the unpacked contents of the remoting webapp. |
7 | 7 |
8 The directory will contain a copy-of or a link-to to all remoting webapp | 8 The directory will contain a copy-of or a link-to to all remoting webapp |
9 resources. This includes HTML/JS and any plugin binaries. The script also | 9 resources. This includes HTML/JS and any plugin binaries. The script also |
10 massages resulting files appropriately with host plugin data. Finally, | 10 massages resulting files appropriately with host plugin data. Finally, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 """Does the main work of building the webapp directory and zipfile. | 114 """Does the main work of building the webapp directory and zipfile. |
115 | 115 |
116 Args: | 116 Args: |
117 buildtype: the type of build ("Official", "Release" or "Dev"). | 117 buildtype: the type of build ("Official", "Release" or "Dev"). |
118 destination: A string with path to directory where the webapp will be | 118 destination: A string with path to directory where the webapp will be |
119 written. | 119 written. |
120 zipfile: A string with path to the zipfile to create containing the | 120 zipfile: A string with path to the zipfile to create containing the |
121 contents of |destination|. | 121 contents of |destination|. |
122 manifest_template: jinja2 template file for manifest. | 122 manifest_template: jinja2 template file for manifest. |
123 webapp_type: webapp type: | 123 webapp_type: webapp type: |
124 For DesktopRemoting: "v1", "v2" or "v2_pnacl" | 124 For DesktopRemoting: "desktop" |
125 For AppRemoting: "app_remoting" or "shared_module" | 125 For AppRemoting: "app_remoting" or "shared_module" |
126 appid: A string with the Remoting Application Id (only used for app | 126 appid: A string with the Remoting Application Id (only used for app |
127 remoting webapps). If supplied, it defaults to using the | 127 remoting webapps). If supplied, it defaults to using the |
128 test API server. | 128 test API server. |
129 app_client_id: The OAuth2 client ID for the webapp. | 129 app_client_id: The OAuth2 client ID for the webapp. |
130 app_name: A string with the name of the application. | 130 app_name: A string with the name of the application. |
131 app_description: A string with the description of the application. | 131 app_description: A string with the description of the application. |
132 app_capabilities: A set of strings naming the capabilities that should be | 132 app_capabilities: A set of strings naming the capabilities that should be |
133 enabled for this application. | 133 enabled for this application. |
134 manifest_key: The manifest key for the webapp. | 134 manifest_key: The manifest key for the webapp. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 shutil.copy2(current_locale, destination_file) | 213 shutil.copy2(current_locale, destination_file) |
214 else: | 214 else: |
215 raise Exception('Unknown extension: ' + current_locale) | 215 raise Exception('Unknown extension: ' + current_locale) |
216 | 216 |
217 is_app_remoting_webapp = webapp_type == 'app_remoting' | 217 is_app_remoting_webapp = webapp_type == 'app_remoting' |
218 is_app_remoting_shared_module = webapp_type == 'shared_module' | 218 is_app_remoting_shared_module = webapp_type == 'shared_module' |
219 is_app_remoting = is_app_remoting_webapp or is_app_remoting_shared_module | 219 is_app_remoting = is_app_remoting_webapp or is_app_remoting_shared_module |
220 is_prod_service_environment = service_environment == 'vendor' or \ | 220 is_prod_service_environment = service_environment == 'vendor' or \ |
221 service_environment == 'prod' or \ | 221 service_environment == 'prod' or \ |
222 service_environment == 'prod-testing' | 222 service_environment == 'prod-testing' |
223 is_desktop_remoting = not is_app_remoting | 223 is_desktop_remoting = not is_app_remoting |
kelvinp
2015/08/03 20:27:12
This file is out-of-date.
There is a getClientPlu
Sergey Ulanov
2015/08/03 20:40:34
Removed getClientPluginType() now
| |
224 | 224 |
225 # Set client plugin type. | |
226 # TODO(wez): Use 'native' in app_remoting until b/17441659 is resolved. | |
227 if not is_app_remoting_webapp: | |
228 client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native' | |
229 findAndReplace(os.path.join(destination, 'plugin_settings.js'), | |
230 "'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'") | |
231 | |
232 # Allow host names for google services/apis to be overriden via env vars. | 225 # Allow host names for google services/apis to be overriden via env vars. |
233 oauth2AccountsHost = os.environ.get( | 226 oauth2AccountsHost = os.environ.get( |
234 'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com') | 227 'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com') |
235 oauth2ApiHost = os.environ.get( | 228 oauth2ApiHost = os.environ.get( |
236 'OAUTH2_API_HOST', 'https://www.googleapis.com') | 229 'OAUTH2_API_HOST', 'https://www.googleapis.com') |
237 directoryApiHost = os.environ.get( | 230 directoryApiHost = os.environ.get( |
238 'DIRECTORY_API_HOST', 'https://www.googleapis.com') | 231 'DIRECTORY_API_HOST', 'https://www.googleapis.com') |
239 remotingApiHost = os.environ.get( | 232 remotingApiHost = os.environ.get( |
240 'REMOTING_API_HOST', 'https://remoting-pa.googleapis.com') | 233 'REMOTING_API_HOST', 'https://remoting-pa.googleapis.com') |
241 | 234 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 parser.add_argument('--use_gcd', choices=['0', '1'], default='0') | 477 parser.add_argument('--use_gcd', choices=['0', '1'], default='0') |
485 | 478 |
486 args = parser.parse_args() | 479 args = parser.parse_args() |
487 args.use_gcd = (args.use_gcd != '0') | 480 args.use_gcd = (args.use_gcd != '0') |
488 args.app_capabilities = set(args.app_capabilities) | 481 args.app_capabilities = set(args.app_capabilities) |
489 return buildWebApp(**vars(args)) | 482 return buildWebApp(**vars(args)) |
490 | 483 |
491 | 484 |
492 if __name__ == '__main__': | 485 if __name__ == '__main__': |
493 sys.exit(main()) | 486 sys.exit(main()) |
OLD | NEW |