Skip to content

Commit 3b034cc

Browse files
committed
Allow users to specify build version by passing -Pvers=someversion to the command line
1 parent fc7afcd commit 3b034cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ plugins {
1515
}
1616
apply plugin: 'nebula-aggregate-javadocs'
1717

18-
1918
def getGitCommit = { ->
2019
String HEAD_REF = new File(rootDir, '.git/HEAD').text.replace("ref: ", "").replace("\n", "")
2120
String COMMIT_HASH = new File(rootDir, ".git/${HEAD_REF}").text.substring(0, 7)
@@ -27,6 +26,7 @@ def getGitCommit = { ->
2726
* http://ryanharter.com/blog/2013/07/30/automatic-versioning-with-git-and-gradle/
2827
*/
2928
def getVersionName = { ->
29+
if (project.hasProperty("vers")) return vers
3030
try {
3131
def stdout = new ByteArrayOutputStream()
3232
exec {
@@ -41,6 +41,7 @@ def getVersionName = { ->
4141
}
4242

4343
def getVersionSimple = { ->
44+
if (project.hasProperty("vers")) return vers
4445
try {
4546
def stdout = new ByteArrayOutputStream()
4647
exec {

0 commit comments

Comments
 (0)