| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import hashlib | 7 import hashlib |
| 8 import imp | 8 import imp |
| 9 import os | 9 import os |
| 10 import platform | 10 import platform |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 This class is used for naming objects in our "gs://dart-archive/" | 64 This class is used for naming objects in our "gs://dart-archive/" |
| 65 GoogleCloudStorage bucket. It's structure is as follows: | 65 GoogleCloudStorage bucket. It's structure is as follows: |
| 66 | 66 |
| 67 For every (channel,revision,release-type) tuple we have a base path: | 67 For every (channel,revision,release-type) tuple we have a base path: |
| 68 | 68 |
| 69 gs://dart-archive/channels/{be,dev,stable} | 69 gs://dart-archive/channels/{be,dev,stable} |
| 70 /{raw,signed,release}/{revision,latest}/ | 70 /{raw,signed,release}/{revision,latest}/ |
| 71 | 71 |
| 72 Under every base path, the following structure is used: | 72 Under every base path, the following structure is used: |
| 73 - /VERSION | 73 - /VERSION |
| 74 - /api-docs/{dart-api-docs.zip,dartdocs-gen-api.zip} | 74 - /api-docs/dartdocs-gen-api.zip |
| 75 - /dartium/{chromedriver,content_shell,dartium} | 75 - /dartium/{chromedriver,content_shell,dartium} |
| 76 -{linux,macos,windows}-{ia32,x64}-release.zip | 76 -{linux,macos,windows}-{ia32,x64}-release.zip |
| 77 - /sdk/dartsdk-{linux,macos,windows}-{ia32,x64}-release.zip | 77 - /sdk/dartsdk-{linux,macos,windows}-{ia32,x64}-release.zip |
| 78 - /editor/darteditor-{linux,macos,windows}-{ia32,x64}.zip | 78 - /editor/darteditor-{linux,macos,windows}-{ia32,x64}.zip |
| 79 - /editor/darteditor-installer-macos-{ia32,x64}.dmg | 79 - /editor/darteditor-installer-macos-{ia32,x64}.dmg |
| 80 - /editor/darteditor-installer-windows-{ia32,x64}.msi | 80 - /editor/darteditor-installer-windows-{ia32,x64}.msi |
| 81 - /editor-eclipse-update | 81 - /editor-eclipse-update |
| 82 /{index.html,features/,plugins/,artifacts.jar,content.jar} | 82 /{index.html,features/,plugins/,artifacts.jar,content.jar} |
| 83 """ | 83 """ |
| 84 def __init__(self, channel=Channel.BLEEDING_EDGE, | 84 def __init__(self, channel=Channel.BLEEDING_EDGE, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 112 self.editor_android_zipfilename()]) | 112 self.editor_android_zipfilename()]) |
| 113 | 113 |
| 114 def sdk_zipfilepath(self, revision, system, arch, mode): | 114 def sdk_zipfilepath(self, revision, system, arch, mode): |
| 115 return '/'.join([self.sdk_directory(revision), | 115 return '/'.join([self.sdk_directory(revision), |
| 116 self.sdk_zipfilename(system, arch, mode)]) | 116 self.sdk_zipfilename(system, arch, mode)]) |
| 117 | 117 |
| 118 def dartium_variant_zipfilepath(self, revision, name, system, arch, mode): | 118 def dartium_variant_zipfilepath(self, revision, name, system, arch, mode): |
| 119 return '/'.join([self.dartium_directory(revision), | 119 return '/'.join([self.dartium_directory(revision), |
| 120 self.dartium_variant_zipfilename(name, system, arch, mode)]) | 120 self.dartium_variant_zipfilename(name, system, arch, mode)]) |
| 121 | 121 |
| 122 def apidocs_zipfilepath(self, revision): |
| 123 return '/'.join([self.apidocs_directory(revision), |
| 124 self.dartdocs_zipfilename()]) |
| 125 |
| 122 def dartium_android_apk_filepath(self, revision, name, arch, mode): | 126 def dartium_android_apk_filepath(self, revision, name, arch, mode): |
| 123 return '/'.join([self.dartium_android_directory(revision), | 127 return '/'.join([self.dartium_android_directory(revision), |
| 124 self.dartium_android_apk_filename(name, arch, mode)]) | 128 self.dartium_android_apk_filename(name, arch, mode)]) |
| 125 | 129 |
| 126 # Functions for querying gs:// directories | 130 # Functions for querying gs:// directories |
| 127 | 131 |
| 128 def dartium_directory(self, revision): | 132 def dartium_directory(self, revision): |
| 129 return self._variant_directory('dartium', revision) | 133 return self._variant_directory('dartium', revision) |
| 130 | 134 |
| 131 def dartium_android_directory(self, revision): | 135 def dartium_android_directory(self, revision): |
| (...skipping 23 matching lines...) Expand all Loading... |
| 155 | 159 |
| 156 def _variant_directory(self, name, revision): | 160 def _variant_directory(self, name, revision): |
| 157 return '%s/channels/%s/%s/%s/%s' % (self.bucket, self.channel, | 161 return '%s/channels/%s/%s/%s/%s' % (self.bucket, self.channel, |
| 158 self.release_type, revision, name) | 162 self.release_type, revision, name) |
| 159 | 163 |
| 160 # Functions for quering filenames | 164 # Functions for quering filenames |
| 161 | 165 |
| 162 def dartium_android_apk_filename(self, name, arch, mode): | 166 def dartium_android_apk_filename(self, name, arch, mode): |
| 163 return '%s-%s-%s.apk' % (name, arch, mode) | 167 return '%s-%s-%s.apk' % (name, arch, mode) |
| 164 | 168 |
| 165 def apidocs_zipfilename(self): | |
| 166 return 'dart-api-docs.zip' | |
| 167 | |
| 168 def dartdocs_zipfilename(self): | 169 def dartdocs_zipfilename(self): |
| 169 return 'dartdocs-gen-api.zip' | 170 return 'dartdocs-gen-api.zip' |
| 170 | 171 |
| 171 def editor_zipfilename(self, system, arch): | 172 def editor_zipfilename(self, system, arch): |
| 172 return 'darteditor-%s-%s.zip' % ( | 173 return 'darteditor-%s-%s.zip' % ( |
| 173 SYSTEM_RENAMES[system], ARCH_RENAMES[arch]) | 174 SYSTEM_RENAMES[system], ARCH_RENAMES[arch]) |
| 174 | 175 |
| 175 def editor_android_zipfilename(self): | 176 def editor_android_zipfilename(self): |
| 176 return 'android.zip' | 177 return 'android.zip' |
| 177 | 178 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 360 |
| 360 return checksum_filename | 361 return checksum_filename |
| 361 | 362 |
| 362 def GetChannelFromName(name): | 363 def GetChannelFromName(name): |
| 363 """Get the channel from the name. Bleeding edge builders don't | 364 """Get the channel from the name. Bleeding edge builders don't |
| 364 have a suffix.""" | 365 have a suffix.""" |
| 365 channel_name = string.split(name, '-').pop() | 366 channel_name = string.split(name, '-').pop() |
| 366 if channel_name in Channel.ALL_CHANNELS: | 367 if channel_name in Channel.ALL_CHANNELS: |
| 367 return channel_name | 368 return channel_name |
| 368 return Channel.BLEEDING_EDGE | 369 return Channel.BLEEDING_EDGE |
| OLD | NEW |