Merge commit 'fb25a6b30b'
This commit is contained in:
commit
032bc15fc3
1 changed files with 9 additions and 7 deletions
|
|
@ -4,6 +4,12 @@ def int maxversionnumber() {
|
||||||
return MAXVERSIONNUMBER
|
return MAXVERSIONNUMBER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int incrementrevision(int current, int increment) {
|
||||||
|
def int newrevision = (current + increment) % (maxversionnumber() + 1)
|
||||||
|
echo "Current revision: ${current} Increment: ${increment} New revision: ${newrevision}"
|
||||||
|
return newrevision
|
||||||
|
}
|
||||||
|
|
||||||
def getGitRevision(String gitrootpath, int basebuildnumber) {
|
def getGitRevision(String gitrootpath, int basebuildnumber) {
|
||||||
def int adjustedchangecount
|
def int adjustedchangecount
|
||||||
def String gitrevision
|
def String gitrevision
|
||||||
|
|
@ -18,7 +24,9 @@ def getGitRevision(String gitrootpath, int basebuildnumber) {
|
||||||
changecount = bat(returnStdout: true, script: "@git rev-list HEAD --count").trim().toInteger()
|
changecount = bat(returnStdout: true, script: "@git rev-list HEAD --count").trim().toInteger()
|
||||||
}
|
}
|
||||||
echo "Change count: ${changecount}"
|
echo "Change count: ${changecount}"
|
||||||
adjustedchangecount = ((changecount + basebuildnumber).abs()) % (maxversionnumber() + 1)
|
def int mvnp1 = maxversionnumber() + 1
|
||||||
|
basebuildnumber = (basebuildnumber < 0) ? mvnp1 - (basebuildnumber.abs() % mvnp1) : basebuildnumber
|
||||||
|
adjustedchangecount = incrementrevision(changecount, basebuildnumber)
|
||||||
echo "Adjusted change count: ${adjustedchangecount}"
|
echo "Adjusted change count: ${adjustedchangecount}"
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
gitrevision = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
|
gitrevision = sh(returnStdout: true, script: "git rev-parse HEAD").trim()
|
||||||
|
|
@ -141,10 +149,4 @@ String generate(meta, String sourcerevision, String sourcepath, String basebuild
|
||||||
return generate(meta, sourcerevision, sourcepath, bbn)
|
return generate(meta, sourcerevision, sourcepath, bbn)
|
||||||
}
|
}
|
||||||
|
|
||||||
int incrementrevision(int current, int increment) {
|
|
||||||
def int newrevision = (current + increment) % (maxversionnumber() + 1)
|
|
||||||
echo "Current revision: ${current} Increment: ${increment} New revision: ${newrevision}"
|
|
||||||
return newrevision
|
|
||||||
}
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue