| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 oauth2RedirectUrlJs) | 180 oauth2RedirectUrlJs) |
| 181 findAndReplace(os.path.join(destination, 'manifest.json'), | 181 findAndReplace(os.path.join(destination, 'manifest.json'), |
| 182 "OAUTH2_REDIRECT_URL", | 182 "OAUTH2_REDIRECT_URL", |
| 183 oauth2RedirectUrlJson) | 183 oauth2RedirectUrlJson) |
| 184 | 184 |
| 185 # Set the correct API keys. | 185 # Set the correct API keys. |
| 186 if (buildtype == 'Official'): | 186 if (buildtype == 'Official'): |
| 187 apiClientId = ('440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.' + | 187 apiClientId = ('440925447803-avn2sj1kc099s0r7v62je5s339mu0am1.' + |
| 188 'apps.googleusercontent.com') | 188 'apps.googleusercontent.com') |
| 189 apiClientSecret = 'Bgur6DFiOMM1h8x-AQpuTQlK' | 189 apiClientSecret = 'Bgur6DFiOMM1h8x-AQpuTQlK' |
| 190 oauth2UseOfficialClientId = 'true'; |
| 190 else: | 191 else: |
| 191 apiClientId = ('440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.' + | 192 apiClientId = ('440925447803-2pi3v45bff6tp1rde2f7q6lgbor3o5uj.' + |
| 192 'apps.googleusercontent.com') | 193 'apps.googleusercontent.com') |
| 193 apiClientSecret = 'W2ieEsG-R1gIA4MMurGrgMc_' | 194 apiClientSecret = 'W2ieEsG-R1gIA4MMurGrgMc_' |
| 195 oauth2UseOfficialClientId = 'false'; |
| 194 findAndReplace(os.path.join(destination, 'plugin_settings.js'), | 196 findAndReplace(os.path.join(destination, 'plugin_settings.js'), |
| 195 "'API_CLIENT_ID'", | 197 "'API_CLIENT_ID'", |
| 196 "'" + apiClientId + "'") | 198 "'" + apiClientId + "'") |
| 197 findAndReplace(os.path.join(destination, 'plugin_settings.js'), | 199 findAndReplace(os.path.join(destination, 'plugin_settings.js'), |
| 198 "'API_CLIENT_SECRET'", | 200 "'API_CLIENT_SECRET'", |
| 199 "'" + apiClientSecret + "'") | 201 "'" + apiClientSecret + "'") |
| 202 findAndReplace(os.path.join(destination, 'plugin_settings.js'), |
| 203 "OAUTH2_USE_OFFICIAL_CLIENT_ID", |
| 204 oauth2UseOfficialClientId) |
| 200 | 205 |
| 201 # Make the zipfile. | 206 # Make the zipfile. |
| 202 createZip(zip_path, destination) | 207 createZip(zip_path, destination) |
| 203 | 208 |
| 204 | 209 |
| 205 def main(): | 210 def main(): |
| 206 if len(sys.argv) < 7: | 211 if len(sys.argv) < 7: |
| 207 print ('Usage: build-webapp.py ' | 212 print ('Usage: build-webapp.py ' |
| 208 '<build-type> <version> <mime-type> <dst> <zip-path> <plugin> ' | 213 '<build-type> <version> <mime-type> <dst> <zip-path> <plugin> ' |
| 209 '<other files...> --locales <locales...>') | 214 '<other files...> --locales <locales...>') |
| (...skipping 10 matching lines...) Expand all Loading... |
| 220 else: | 225 else: |
| 221 files.append(arg) | 226 files.append(arg) |
| 222 | 227 |
| 223 buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], | 228 buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], |
| 224 sys.argv[6], files, locales) | 229 sys.argv[6], files, locales) |
| 225 return 0 | 230 return 0 |
| 226 | 231 |
| 227 | 232 |
| 228 if __name__ == '__main__': | 233 if __name__ == '__main__': |
| 229 sys.exit(main()) | 234 sys.exit(main()) |
| OLD | NEW |