| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import shutil | 8 import shutil |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 for filename in os.listdir(temp_dir): | 77 for filename in os.listdir(temp_dir): |
| 78 match = re.search('^dartium-.*-inc-([0-9]+)\.0$', filename) | 78 match = re.search('^dartium-.*-inc-([0-9]+)\.0$', filename) |
| 79 if match: | 79 if match: |
| 80 return os.path.join(temp_dir, match.group(0)) | 80 return os.path.join(temp_dir, match.group(0)) |
| 81 raise Exception("Couldn't find dartium archive") | 81 raise Exception("Couldn't find dartium archive") |
| 82 | 82 |
| 83 def UploadInstaller(dart_editor_dmg, directory): | 83 def UploadInstaller(dart_editor_dmg, directory): |
| 84 directory = directory % {'revision' : utils.GetSVNRevision()} | 84 directory = directory % {'revision' : utils.GetSVNRevision()} |
| 85 uri = '%s/%s' % (GCS_EDITOR_BUCKET, directory) | 85 uri = '%s/%s' % (GCS_EDITOR_BUCKET, directory) |
| 86 RunProcess([GSUTIL, 'cp', dart_editor_dmg, uri]) | 86 RunProcess([GSUTIL, 'cp', dart_editor_dmg, uri]) |
| 87 RunProcess([GSUTIL, 'setacl', 'public-read', uri]) |
| 87 | 88 |
| 88 def CreateAndUploadMacInstaller(arch): | 89 def CreateAndUploadMacInstaller(arch): |
| 89 dart_icns = os.path.join( | 90 dart_icns = os.path.join( |
| 90 'editor', 'tools', 'plugins', 'com.google.dart.tools.deploy', | 91 'editor', 'tools', 'plugins', 'com.google.dart.tools.deploy', |
| 91 'icons', 'dart.icns') | 92 'icons', 'dart.icns') |
| 92 mac_build_bundle_py = os.path.join('tools', 'mac_build_editor_bundle.sh') | 93 mac_build_bundle_py = os.path.join('tools', 'mac_build_editor_bundle.sh') |
| 93 mac_build_dmg_py = os.path.join('tools', 'mac_build_editor_dmg.sh') | 94 mac_build_dmg_py = os.path.join('tools', 'mac_build_editor_dmg.sh') |
| 94 editor_dir = GetEditorDirectory('Release', arch) | 95 editor_dir = GetEditorDirectory('Release', arch) |
| 95 dart_sdk = GetDartSdkDirectory('Release', arch) | 96 dart_sdk = GetDartSdkDirectory('Release', arch) |
| 96 with TempDir() as temp_dir: | 97 with TempDir() as temp_dir: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 else: | 145 else: |
| 145 print ("We currently don't build installers for sys.platform=%s" | 146 print ("We currently don't build installers for sys.platform=%s" |
| 146 % sys.platform) | 147 % sys.platform) |
| 147 return 0 | 148 return 0 |
| 148 | 149 |
| 149 if __name__ == '__main__': | 150 if __name__ == '__main__': |
| 150 try: | 151 try: |
| 151 sys.exit(main()) | 152 sys.exit(main()) |
| 152 except OSError as e: | 153 except OSError as e: |
| 153 sys.exit(e.errno) | 154 sys.exit(e.errno) |
| OLD | NEW |