| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # This zips the SDK and uploads it to Google Storage when run on a buildbot. | 7 # This zips the SDK and uploads it to Google Storage when run on a buildbot. |
| 8 # | 8 # |
| 9 # Usage: upload_sdk.py path_to_sdk | 9 # Usage: upload_sdk.py path_to_sdk |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 utils.GetBuildConf('release', 'ia32')): | 94 utils.GetBuildConf('release', 'ia32')): |
| 95 sdk_suffix = '' | 95 sdk_suffix = '' |
| 96 else: | 96 else: |
| 97 sdk_suffix = '-debug' | 97 sdk_suffix = '-debug' |
| 98 # TODO(dgrove) - deal with architectures that are not ia32. | 98 # TODO(dgrove) - deal with architectures that are not ia32. |
| 99 sdk_file = 'dart-%s-%s%s.zip' % (utils.GuessOS(), revision, sdk_suffix) | 99 sdk_file = 'dart-%s-%s%s.zip' % (utils.GuessOS(), revision, sdk_suffix) |
| 100 if (os.path.exists(SDK_LOCAL_ZIP)): | 100 if (os.path.exists(SDK_LOCAL_ZIP)): |
| 101 os.remove(SDK_LOCAL_ZIP) | 101 os.remove(SDK_LOCAL_ZIP) |
| 102 if platform.system() == 'Windows': | 102 if platform.system() == 'Windows': |
| 103 # Windows does not have zip. We use the 7 zip utility in third party. | 103 # Windows does not have zip. We use the 7 zip utility in third party. |
| 104 ExecuteCommand([os.path.join('..', 'third_party', '7za920', '7za'), 'a', | 104 ExecuteCommand([os.path.join('..', 'third_party', '7zip', '7za'), 'a', |
| 105 '-tzip', SDK_LOCAL_ZIP, os.path.basename(argv[1])]) | 105 '-tzip', SDK_LOCAL_ZIP, os.path.basename(argv[1])]) |
| 106 else: | 106 else: |
| 107 ExecuteCommand(['zip', '-yr', SDK_LOCAL_ZIP, os.path.basename(argv[1])]) | 107 ExecuteCommand(['zip', '-yr', SDK_LOCAL_ZIP, os.path.basename(argv[1])]) |
| 108 UploadArchive(SDK_LOCAL_ZIP, | 108 UploadArchive(SDK_LOCAL_ZIP, |
| 109 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, sdk_file])) | 109 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, sdk_file])) |
| 110 latest_name = 'dart-%s-latest%s.zip' % (utils.GuessOS(), sdk_suffix) | 110 latest_name = 'dart-%s-latest%s.zip' % (utils.GuessOS(), sdk_suffix) |
| 111 UploadArchive(SDK_LOCAL_ZIP, | 111 UploadArchive(SDK_LOCAL_ZIP, |
| 112 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name])) | 112 GS_SITE + '/'.join([gsdir, GS_SDK_DIR, latest_name])) |
| 113 | 113 |
| 114 | 114 |
| 115 if __name__ == '__main__': | 115 if __name__ == '__main__': |
| 116 sys.exit(main(sys.argv)) | 116 sys.exit(main(sys.argv)) |
| OLD | NEW |