Skip to content

Commit a8bd9f5

Browse files
committed
build requires a version else tests cannot detect the jar to be tested
1 parent 7c9bf20 commit a8bd9f5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
def isDirty = { ->
2+
def stdout = new ByteArrayOutputStream()
3+
exec {
4+
commandLine 'git', 'status', '--porcelain'
5+
standardOutput = stdout
6+
}
7+
return stdout.toString().trim()
8+
}
9+
def getVersionName = { ->
10+
def stdout = new ByteArrayOutputStream()
11+
exec {
12+
commandLine 'git', 'describe', '--tags'
13+
standardOutput = stdout
14+
}
15+
def gitVersionName = stdout.toString().trim()
16+
return isDirty() ? gitVersionName + '-SNAPSHOT' : gitVersionName
17+
}
18+
version = getVersionName()
19+
120
repositories {
221
mavenCentral()
322
}

0 commit comments

Comments
 (0)