Skip to content

Commit 8fd8cd6

Browse files
committed
derive version from git tags
1 parent 646df8e commit 8fd8cd6

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

build.gradle

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
buildscript {
2-
repositories {
3-
mavenCentral()
1+
def isDirty = { ->
2+
def stdout = new ByteArrayOutputStream()
3+
exec {
4+
commandLine 'git', 'status', '--porcelain'
5+
standardOutput = stdout
46
}
5-
dependencies {
6-
classpath 'com.github.townsfolk:gradle-release:1.2'
7+
return stdout.toString().trim()
8+
}
9+
def getVersionName = { ->
10+
def stdout = new ByteArrayOutputStream()
11+
exec {
12+
commandLine 'git', 'describe', '--tags'
13+
standardOutput = stdout
714
}
15+
def gitVersionName = stdout.toString().trim()
16+
return isDirty() ? gitVersionName + '-SNAPSHOT' : gitVersionName
817
}
18+
version = getVersionName()
919

1020
repositories {
1121
mavenCentral()
@@ -19,7 +29,6 @@ ext {
1929
apply plugin: 'idea'
2030
apply plugin: 'maven'
2131
apply plugin: 'groovy'
22-
apply plugin: 'release'
2332

2433
group 'org.scoverage'
2534

gradle.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)