| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2015, 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 os.path | 7 import os.path |
| 8 import shutil | 8 import shutil |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 def CreateUploadVersionFile(): | 33 def CreateUploadVersionFile(): |
| 34 file_path = os.path.join(bot_utils.DART_DIR, | 34 file_path = os.path.join(bot_utils.DART_DIR, |
| 35 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), | 35 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), |
| 36 'VERSION') | 36 'VERSION') |
| 37 with open(file_path, 'w') as fd: | 37 with open(file_path, 'w') as fd: |
| 38 fd.write(utils.GetVersionFileContent()) | 38 fd.write(utils.GetVersionFileContent()) |
| 39 DartArchiveUploadVersionFile(file_path) | 39 DartArchiveUploadVersionFile(file_path) |
| 40 | 40 |
| 41 def DartArchiveUploadVersionFile(version_file): | 41 def DartArchiveUploadVersionFile(version_file): |
| 42 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) | 42 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) |
| 43 revision = utils.GetSVNRevision() | 43 revision = utils.GetArchiveVersion() |
| 44 for revision in [revision, 'latest']: | 44 for revision in [revision, 'latest']: |
| 45 destination = namer.version_filepath(revision) | 45 destination = namer.version_filepath(revision) |
| 46 DartArchiveFile(version_file, destination, checksum_files=False) | 46 DartArchiveFile(version_file, destination, checksum_files=False) |
| 47 | 47 |
| 48 def CreateUploadSDKZips(): | 48 def CreateUploadSDKZips(): |
| 49 with bot.BuildStep('Create and upload sdk zips'): | 49 with bot.BuildStep('Create and upload sdk zips'): |
| 50 sdk32_path = os.path.join(bot_utils.DART_DIR, | 50 sdk32_path = os.path.join(bot_utils.DART_DIR, |
| 51 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), | 51 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), |
| 52 'dart-sdk') | 52 'dart-sdk') |
| 53 sdk64_path = os.path.join(bot_utils.DART_DIR, | 53 sdk64_path = os.path.join(bot_utils.DART_DIR, |
| 54 utils.GetBuildRoot(BUILD_OS, 'release', 'x64'), | 54 utils.GetBuildRoot(BUILD_OS, 'release', 'x64'), |
| 55 'dart-sdk') | 55 'dart-sdk') |
| 56 | 56 |
| 57 sdk32_zip = os.path.join(bot_utils.DART_DIR, | 57 sdk32_zip = os.path.join(bot_utils.DART_DIR, |
| 58 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), | 58 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), |
| 59 'dartsdk-%s-32.zip' % BUILD_OS) | 59 'dartsdk-%s-32.zip' % BUILD_OS) |
| 60 sdk64_zip = os.path.join(bot_utils.DART_DIR, | 60 sdk64_zip = os.path.join(bot_utils.DART_DIR, |
| 61 utils.GetBuildRoot(BUILD_OS, 'release', 'x64'), | 61 utils.GetBuildRoot(BUILD_OS, 'release', 'x64'), |
| 62 'dartsdk-%s-64.zip' % BUILD_OS) | 62 'dartsdk-%s-64.zip' % BUILD_OS) |
| 63 FileDelete(sdk32_zip) | 63 FileDelete(sdk32_zip) |
| 64 FileDelete(sdk64_zip) | 64 FileDelete(sdk64_zip) |
| 65 CreateZip(sdk32_path, sdk32_zip) | 65 CreateZip(sdk32_path, sdk32_zip) |
| 66 CreateZip(sdk64_path, sdk64_zip) | 66 CreateZip(sdk64_path, sdk64_zip) |
| 67 DartArchiveUploadSDKs(BUILD_OS, sdk32_zip, sdk64_zip) | 67 DartArchiveUploadSDKs(BUILD_OS, sdk32_zip, sdk64_zip) |
| 68 | 68 |
| 69 def DartArchiveUploadSDKs(system, sdk32_zip, sdk64_zip): | 69 def DartArchiveUploadSDKs(system, sdk32_zip, sdk64_zip): |
| 70 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) | 70 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) |
| 71 revision = utils.GetSVNRevision() | 71 revision = utils.GetArchiveVersion() |
| 72 for revision in [revision, 'latest']: | 72 for revision in [revision, 'latest']: |
| 73 path32 = namer.sdk_zipfilepath(revision, system, 'ia32', 'release') | 73 path32 = namer.sdk_zipfilepath(revision, system, 'ia32', 'release') |
| 74 path64 = namer.sdk_zipfilepath(revision, system, 'x64', 'release') | 74 path64 = namer.sdk_zipfilepath(revision, system, 'x64', 'release') |
| 75 DartArchiveFile(sdk32_zip, path32, checksum_files=True) | 75 DartArchiveFile(sdk32_zip, path32, checksum_files=True) |
| 76 DartArchiveFile(sdk64_zip, path64, checksum_files=True) | 76 DartArchiveFile(sdk64_zip, path64, checksum_files=True) |
| 77 | 77 |
| 78 def CreateUploadSDK(): | 78 def CreateUploadSDK(): |
| 79 BuildSDK() | 79 BuildSDK() |
| 80 CreateUploadSDKZips() | 80 CreateUploadSDKZips() |
| 81 | 81 |
| 82 def CreateUploadAPIDocs(): | 82 def CreateUploadAPIDocs(): |
| 83 api_path = os.path.join(bot_utils.DART_DIR, | 83 api_path = os.path.join(bot_utils.DART_DIR, |
| 84 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), | 84 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), |
| 85 'api_docs') | 85 'api_docs') |
| 86 api_zip = os.path.join(bot_utils.DART_DIR, | 86 api_zip = os.path.join(bot_utils.DART_DIR, |
| 87 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), | 87 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), |
| 88 'dart-api-docs.zip') | 88 'dart-api-docs.zip') |
| 89 shutil.rmtree(api_path, ignore_errors=True) | 89 shutil.rmtree(api_path, ignore_errors=True) |
| 90 FileDelete(api_zip) | 90 FileDelete(api_zip) |
| 91 BuildAPIDocs() | 91 BuildAPIDocs() |
| 92 UploadApiDocs(api_path) | 92 UploadApiDocs(api_path) |
| 93 CreateZip(api_path, api_zip) | 93 CreateZip(api_path, api_zip) |
| 94 DartArchiveUploadAPIDocs(api_zip) | 94 DartArchiveUploadAPIDocs(api_zip) |
| 95 | 95 |
| 96 def DartArchiveUploadAPIDocs(api_zip): | 96 def DartArchiveUploadAPIDocs(api_zip): |
| 97 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) | 97 namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW) |
| 98 revision = utils.GetSVNRevision() | 98 revision = utils.GetArchiveVersion() |
| 99 for revision in [revision, 'latest']: | 99 for revision in [revision, 'latest']: |
| 100 destination = (namer.apidocs_directory(revision) + '/' + | 100 destination = (namer.apidocs_directory(revision) + '/' + |
| 101 namer.apidocs_zipfilename()) | 101 namer.apidocs_zipfilename()) |
| 102 DartArchiveFile(api_zip, destination, checksum_files=False) | 102 DartArchiveFile(api_zip, destination, checksum_files=False) |
| 103 | 103 |
| 104 def UploadApiDocs(dir_name): | 104 def UploadApiDocs(dir_name): |
| 105 apidocs_namer = bot_utils.GCSNamerApiDocs(CHANNEL) | 105 apidocs_namer = bot_utils.GCSNamerApiDocs(CHANNEL) |
| 106 revision = utils.GetSVNRevision() | 106 revision = utils.GetArchiveVersion() |
| 107 apidocs_destination_gcsdir = apidocs_namer.docs_dirpath(revision) | 107 apidocs_destination_gcsdir = apidocs_namer.docs_dirpath(revision) |
| 108 apidocs_destination_latestfile = apidocs_namer.docs_latestpath(revision) | 108 apidocs_destination_latestfile = apidocs_namer.docs_latestpath(revision) |
| 109 | 109 |
| 110 # Return early if the documents have already been uploaded. | 110 # Return early if the documents have already been uploaded. |
| 111 # (This can happen if a build was forced, or a commit had no changes in the | 111 # (This can happen if a build was forced, or a commit had no changes in the |
| 112 # dart repository (e.g. DEPS file update).) | 112 # dart repository (e.g. DEPS file update).) |
| 113 if GsutilExists(apidocs_destination_gcsdir): | 113 if GsutilExists(apidocs_destination_gcsdir): |
| 114 print ("Not uploading api docs, since %s is already present." | 114 print ("Not uploading api docs, since %s is already present." |
| 115 % apidocs_destination_gcsdir) | 115 % apidocs_destination_gcsdir) |
| 116 return | 116 return |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 if __name__ == '__main__': | 189 if __name__ == '__main__': |
| 190 if CHANNEL != bot_utils.Channel.BLEEDING_EDGE: | 190 if CHANNEL != bot_utils.Channel.BLEEDING_EDGE: |
| 191 # We always clobber the bot, to make sure releases are build from scratch | 191 # We always clobber the bot, to make sure releases are build from scratch |
| 192 bot.Clobber(force=True) | 192 bot.Clobber(force=True) |
| 193 | 193 |
| 194 CreateUploadSDK() | 194 CreateUploadSDK() |
| 195 if BUILD_OS == 'linux': | 195 if BUILD_OS == 'linux': |
| 196 CreateUploadVersionFile() | 196 CreateUploadVersionFile() |
| 197 CreateUploadAPIDocs() | 197 CreateUploadAPIDocs() |
| OLD | NEW |