-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
as prompted by #365, #430, #447 and a thread on the google group. - split version bumping out of generateSingleHeader script - separate scripts for bumping each version component - "build" number only incremented for "develop" builds
- Loading branch information
1 parent
f5fef1e
commit 21f7ef6
Showing
13 changed files
with
238 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from __future__ import print_function | ||
from releaseCommon import Version | ||
|
||
v = Version() | ||
v.incrementBuildNumber() | ||
v.updateVersionFile() | ||
v.updateReadmeFile() | ||
|
||
print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from __future__ import print_function | ||
from releaseCommon import Version | ||
|
||
v = Version() | ||
v.incrementMajorVersion() | ||
v.updateVersionFile() | ||
v.updateReadmeFile() | ||
|
||
print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from __future__ import print_function | ||
from releaseCommon import Version | ||
|
||
v = Version() | ||
v.incrementMinorVersion() | ||
v.updateVersionFile() | ||
v.updateReadmeFile() | ||
|
||
print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from __future__ import print_function | ||
from releaseCommon import Version | ||
|
||
v = Version() | ||
v.incrementPatchNumber() | ||
v.updateVersionFile() | ||
v.updateReadmeFile() | ||
|
||
print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
from __future__ import print_function | ||
|
||
import os | ||
import sys | ||
import re | ||
import string | ||
|
||
from scriptCommon import catchPath | ||
|
||
versionParser = re.compile( r'(\s*Version\slibraryVersion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' ) | ||
rootPath = os.path.join( catchPath, 'include/' ) | ||
versionPath = os.path.join( rootPath, "internal/catch_version.hpp" ) | ||
readmePath = os.path.join( catchPath, "README.md" ) | ||
|
||
class Version: | ||
def __init__(self): | ||
f = open( versionPath, 'r' ) | ||
for line in f: | ||
m = versionParser.match( line ) | ||
if m: | ||
self.variableDecl = m.group(1) | ||
self.majorVersion = int(m.group(2)) | ||
self.minorVersion = int(m.group(3)) | ||
self.patchNumber = int(m.group(4)) | ||
self.branchName = m.group(5) | ||
self.buildNumber = int(m.group(6)) | ||
f.close() | ||
|
||
def nonDevelopRelease(self): | ||
if self.branchName != "": | ||
self.branchName = "" | ||
self.buildNumber = 0 | ||
def developBuild(self): | ||
if self.branchName == "": | ||
self.branchName = "develop" | ||
self.buildNumber = 0 | ||
|
||
def incrementBuildNumber(self): | ||
self.developBuild() | ||
self.buildNumber = self.buildNumber+1 | ||
|
||
def incrementPatchNumber(self): | ||
self.nonDevelopRelease() | ||
self.patchNumber = self.patchNumber+1 | ||
|
||
def incrementMinorVersion(self): | ||
self.nonDevelopRelease() | ||
self.patchNumber = 0 | ||
self.minorVersion = self.minorVersion+1 | ||
|
||
def incrementMajorVersion(self): | ||
self.nonDevelopRelease() | ||
self.patchNumber = 0 | ||
self.minorVersion = 0 | ||
self.majorVersion = self.majorVersion+1 | ||
|
||
def getVersionString(self): | ||
versionString = '{0}.{1}.{2}'.format( self.majorVersion, self.minorVersion, self.patchNumber ) | ||
if self.branchName != "": | ||
versionString = versionString + '-{0}.{1}'.format( self.branchName, self.buildNumber ) | ||
return versionString | ||
|
||
def updateVersionFile(self): | ||
f = open( versionPath, 'r' ) | ||
lines = [] | ||
for line in f: | ||
m = versionParser.match( line ) | ||
if m: | ||
lines.append( '{0}( {1}, {2}, {3}, "{4}", {5} );'.format( self.variableDecl, self.majorVersion, self.minorVersion, self.patchNumber, self.branchName, self.buildNumber ) ) | ||
else: | ||
lines.append( line.rstrip() ) | ||
f.close() | ||
f = open( versionPath, 'w' ) | ||
for line in lines: | ||
f.write( line + "\n" ) | ||
|
||
def updateReadmeFile(self): | ||
f = open( readmePath, 'r' ) | ||
lines = [] | ||
for line in f: | ||
lines.append( line.rstrip() ) | ||
f.close() | ||
f = open( readmePath, 'w' ) | ||
for line in lines: | ||
if line.startswith( "*v" ): | ||
f.write( '*v{0}*\n'.format( self.getVersionString() ) ) | ||
else: | ||
f.write( line + "\n" ) | ||
|
Oops, something went wrong.