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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 # Strip the linux build. | 182 # Strip the linux build. |
183 if ((platform.system() == 'Linux') and (buildtype == 'Official')): | 183 if ((platform.system() == 'Linux') and (buildtype == 'Official')): |
184 subprocess.call(["strip", newPluginPath]) | 184 subprocess.call(["strip", newPluginPath]) |
185 | 185 |
186 # Set the correct mimetype. | 186 # Set the correct mimetype. |
187 hostPluginMimeType = os.environ.get( | 187 hostPluginMimeType = os.environ.get( |
188 'HOST_PLUGIN_MIMETYPE', 'application/vnd.chromium.remoting-host') | 188 'HOST_PLUGIN_MIMETYPE', 'application/vnd.chromium.remoting-host') |
189 findAndReplace(os.path.join(destination, 'plugin_settings.js'), | 189 findAndReplace(os.path.join(destination, 'plugin_settings.js'), |
190 'HOST_PLUGIN_MIMETYPE', hostPluginMimeType) | 190 'HOST_PLUGIN_MIMETYPE', hostPluginMimeType) |
191 | 191 |
192 # Set client plugin type. | |
193 client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native' | |
194 findAndReplace(os.path.join(destination, 'plugin_settings.js'), | |
195 "'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'") | |
196 | |
197 # Allow host names for google services/apis to be overriden via env vars. | 192 # Allow host names for google services/apis to be overriden via env vars. |
198 oauth2AccountsHost = os.environ.get( | 193 oauth2AccountsHost = os.environ.get( |
199 'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com') | 194 'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com') |
200 oauth2ApiHost = os.environ.get( | 195 oauth2ApiHost = os.environ.get( |
201 'OAUTH2_API_HOST', 'https://www.googleapis.com') | 196 'OAUTH2_API_HOST', 'https://www.googleapis.com') |
202 directoryApiHost = os.environ.get( | 197 directoryApiHost = os.environ.get( |
203 'DIRECTORY_API_HOST', 'https://www.googleapis.com') | 198 'DIRECTORY_API_HOST', 'https://www.googleapis.com') |
204 oauth2BaseUrl = oauth2AccountsHost + '/o/oauth2' | 199 oauth2BaseUrl = oauth2AccountsHost + '/o/oauth2' |
205 oauth2ApiBaseUrl = oauth2ApiHost + '/oauth2' | 200 oauth2ApiBaseUrl = oauth2ApiHost + '/oauth2' |
206 directoryApiBaseUrl = directoryApiHost + '/chromoting/v1' | 201 directoryApiBaseUrl = directoryApiHost + '/chromoting/v1' |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 else: | 319 else: |
325 files.append(arg) | 320 files.append(arg) |
326 | 321 |
327 return buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], | 322 return buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], |
328 sys.argv[5], sys.argv[6], sys.argv[7], plugin, | 323 sys.argv[5], sys.argv[6], sys.argv[7], plugin, |
329 files, locales) | 324 files, locales) |
330 | 325 |
331 | 326 |
332 if __name__ == '__main__': | 327 if __name__ == '__main__': |
333 sys.exit(main()) | 328 sys.exit(main()) |
OLD | NEW |