Skip to content

Commit 76b64a0

Browse files
author
Bytekeeper
committed
Added release configuration
1 parent dc8b3db commit 76b64a0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
apply plugin: 'application'
1+
apply plugin: 'application';
22
apply plugin: 'java';
33
apply plugin: 'eclipse';
44
apply plugin: 'findbugs';
55
apply plugin: 'pmd';
66
apply plugin: 'jacoco';
77

8-
version = '1.1-SNAPSHOT'
8+
9+
// -SNAPSHOT is added if the release task is not set
10+
version = '1.1'
911
archivesBaseName = 'STT'
1012

1113
def javaHome = System.properties['java.home']
@@ -144,3 +146,13 @@ clean {
144146
task wrapper(type: Wrapper) {
145147
gradleVersion = '2.2'
146148
}
149+
150+
task release(dependsOn: 'distZip') << {
151+
println "Built release for $project.version"
152+
}
153+
154+
gradle.taskGraph.whenReady {taskGraph ->
155+
if (!taskGraph.hasTask(release)) {
156+
version += '-SNAPSHOT'
157+
}
158+
}

0 commit comments

Comments
 (0)