| OLD | NEW |
| 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 # This file contains a set of utilities functions used by other Python-based | 5 # This file contains a set of utilities functions used by other Python-based |
| 6 # scripts. | 6 # scripts. |
| 7 | 7 |
| 8 import commands | 8 import commands |
| 9 import contextlib | 9 import contextlib |
| 10 import datetime | 10 import datetime |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 # and the commit. This was true across branches as well, so a number used | 397 # and the commit. This was true across branches as well, so a number used |
| 398 # to archive a build was always unique and unambiguous. | 398 # to archive a build was always unique and unambiguous. |
| 399 # In git there is no such global number, so we loosen the requirement a bit. | 399 # In git there is no such global number, so we loosen the requirement a bit. |
| 400 # We only use numbers on the master branch (bleeding edge). On branches | 400 # We only use numbers on the master branch (bleeding edge). On branches |
| 401 # we use the version number instead for archiving purposes. | 401 # we use the version number instead for archiving purposes. |
| 402 # The number on master is the count of commits on the master branch. | 402 # The number on master is the count of commits on the master branch. |
| 403 def GetArchiveVersion(): | 403 def GetArchiveVersion(): |
| 404 version = ReadVersionFile() | 404 version = ReadVersionFile() |
| 405 if not version: | 405 if not version: |
| 406 raise 'Could not get the archive version, parsing the version file failed' | 406 raise 'Could not get the archive version, parsing the version file failed' |
| 407 if version.channel == 'be': | 407 if version.channel in ['be', 'integration']: |
| 408 return GetGitNumber() | 408 return GetGitNumber() |
| 409 return GetSemanticSDKVersion() | 409 return GetSemanticSDKVersion() |
| 410 | 410 |
| 411 | 411 |
| 412 def GetGitRevision(): | 412 def GetGitRevision(): |
| 413 # When building from tarball use tools/GIT_REVISION | 413 # When building from tarball use tools/GIT_REVISION |
| 414 git_revision_file = os.path.join(DART_DIR, 'tools', 'GIT_REVISION') | 414 git_revision_file = os.path.join(DART_DIR, 'tools', 'GIT_REVISION') |
| 415 try: | 415 try: |
| 416 with open(git_revision_file) as fd: | 416 with open(git_revision_file) as fd: |
| 417 return fd.read() | 417 return fd.read() |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 return contextlib.nested(WindowsCoreDumpEnabler(), | 1043 return contextlib.nested(WindowsCoreDumpEnabler(), |
| 1044 WindowsCoreDumpArchiver()) | 1044 WindowsCoreDumpArchiver()) |
| 1045 else: | 1045 else: |
| 1046 # We don't have support for MacOS yet. | 1046 # We don't have support for MacOS yet. |
| 1047 assert osname == 'macos' | 1047 assert osname == 'macos' |
| 1048 return NooptCoreDumpArchiver() | 1048 return NooptCoreDumpArchiver() |
| 1049 | 1049 |
| 1050 if __name__ == "__main__": | 1050 if __name__ == "__main__": |
| 1051 import sys | 1051 import sys |
| 1052 Main() | 1052 Main() |
| OLD | NEW |