diff options
| author | Martin Hořeňovský | 2017-08-10 11:34:26 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2017-08-10 11:34:26 +0200 |
| commit | aa42dd92d104e894e2b54d29a3defdf4b00eec21 (patch) | |
| tree | 4bdf430c746a2c98e6092705760d3f78c5421436 /scripts | |
| parent | e658bacb04ef5c14c1dcb192c9e5c99cef390582 (diff) | |
| parent | 7e4038d8488596e850a11c8fe236b59bca605444 (diff) | |
| download | catch3-aa42dd92d104e894e2b54d29a3defdf4b00eec21.tar.gz | |
Merge branch 'master' into dev-modernize
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/developBuild.py | 4 | ||||
| -rwxr-xr-x | scripts/majorRelease.py | 4 | ||||
| -rwxr-xr-x | scripts/minorRelease.py | 4 | ||||
| -rwxr-xr-x | scripts/patchRelease.py | 4 | ||||
| -rw-r--r-- | scripts/releaseCommon.py | 31 | ||||
| -rw-r--r-- | scripts/updateVcpkgPackage.py | 25 |
6 files changed, 53 insertions, 19 deletions
diff --git a/scripts/developBuild.py b/scripts/developBuild.py index c16c8a6d..d751f108 100755 --- a/scripts/developBuild.py +++ b/scripts/developBuild.py @@ -7,5 +7,7 @@ v = Version() v.incrementBuildNumber() v.updateVersionFile() v.updateReadmeFile() +v.updateConanFile() +v.updateConanTestFile() -print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file +print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) ) diff --git a/scripts/majorRelease.py b/scripts/majorRelease.py index f367506a..e8116d3b 100755 --- a/scripts/majorRelease.py +++ b/scripts/majorRelease.py @@ -7,5 +7,7 @@ v = Version() v.incrementMajorVersion() v.updateVersionFile() v.updateReadmeFile() +v.updateConanFile() +v.updateConanTestFile() -print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file +print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) ) diff --git a/scripts/minorRelease.py b/scripts/minorRelease.py index ac36df96..dff2d8c8 100755 --- a/scripts/minorRelease.py +++ b/scripts/minorRelease.py @@ -7,5 +7,7 @@ v = Version() v.incrementMinorVersion() v.updateVersionFile() v.updateReadmeFile() +v.updateConanFile() +v.updateConanTestFile() -print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file +print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) ) diff --git a/scripts/patchRelease.py b/scripts/patchRelease.py index 878662f8..e33e4064 100755 --- a/scripts/patchRelease.py +++ b/scripts/patchRelease.py @@ -7,5 +7,7 @@ v = Version() v.incrementPatchNumber() v.updateVersionFile() v.updateReadmeFile() +v.updateConanFile() +v.updateConanTestFile() -print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file +print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) ) diff --git a/scripts/releaseCommon.py b/scripts/releaseCommon.py index 652985c9..6737f13b 100644 --- a/scripts/releaseCommon.py +++ b/scripts/releaseCommon.py @@ -11,6 +11,8 @@ versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(. rootPath = os.path.join( catchPath, 'include/' ) versionPath = os.path.join( rootPath, "internal/catch_version.cpp" ) readmePath = os.path.join( catchPath, "README.md" ) +conanPath = os.path.join(catchPath, 'conanfile.py') +conanTestPath = os.path.join(catchPath, 'test_package', 'conanfile.py') class Version: def __init__(self): @@ -86,3 +88,32 @@ class Version: line = downloadParser.sub( r'<a href="https://github.com/philsquared/Catch/releases/download/v{0}/catch.hpp">'.format(self.getVersionString()) , line) f.write( line + "\n" ) + def updateConanFile(self): + conanParser = re.compile( r' version = "\d+\.\d+\.\d+.*"') + f = open( conanPath, 'r' ) + lines = [] + for line in f: + m = conanParser.match( line ) + if m: + lines.append( ' version = "{0}"'.format(format(self.getVersionString())) ) + else: + lines.append( line.rstrip() ) + f.close() + f = open( conanPath, 'w' ) + for line in lines: + f.write( line + "\n" ) + + def updateConanTestFile(self): + conanParser = re.compile( r' requires = \"Catch\/\d+\.\d+\.\d+.*@%s\/%s\" % \(username, channel\)') + f = open( conanTestPath, 'r' ) + lines = [] + for line in f: + m = conanParser.match( line ) + if m: + lines.append( ' requires = "Catch/{0}@%s/%s" % (username, channel)'.format(format(self.getVersionString())) ) + else: + lines.append( line.rstrip() ) + f.close() + f = open( conanTestPath, 'w' ) + for line in lines: + f.write( line + "\n" ) diff --git a/scripts/updateVcpkgPackage.py b/scripts/updateVcpkgPackage.py index a7c8dee6..4d20d11c 100644 --- a/scripts/updateVcpkgPackage.py +++ b/scripts/updateVcpkgPackage.py @@ -57,24 +57,21 @@ def update_portfile(path, header_hash, licence_hash): for line in f: lines.append(line) with open(portfile_path, 'w') as f: - # Two things we need to change/update - # 1) Link and hash of releaseCommon - # 2) Link and hash of licence + # There are three things we need to change/update + # 1) CATCH_VERSION cmake variable + # 2) Hash of header + # 3) Hash of licence # We could assume licence never changes, but where is the fun in that? - first_hash = True for line in lines: - # Check what we are updating + # Update the version + if 'set(CATCH_VERSION' in line: + line = 'set(CATCH_VERSION v{})'.format(v.getVersionString()) + + # Determine which file we are updating if 'vcpkg_download_distfile' in line: kind = line.split('(')[-1].strip() - print(kind) - - # Deal with URLS - if 'URLS' in line and kind == 'HEADER': - line = ' URLS "https://github.com/philsquared/Catch/releases/download/v{}/catch.hpp"\n'.format(v.getVersionString()) - if 'URLS' in line and kind == 'LICENSE': - line = ' URLS "https://raw.githubusercontent.com/philsquared/Catch/v{}/LICENSE.txt"\n'.format(v.getVersionString()) - # Deal with hashes + # Update the hashes if 'SHA512' in line and kind == 'HEADER': line = ' SHA512 {}\n'.format(header_hash) if 'SHA512' in line and kind == 'LICENSE': @@ -86,8 +83,6 @@ def git_push(path_to_repo): v = Version() ver_string = v.getVersionString() - # Move to the repo dir - old_path = os.getcwd() os.chdir(path_to_repo) # Work with git |