We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc8b3db commit 76b64a0Copy full SHA for 76b64a0
build.gradle
@@ -1,11 +1,13 @@
1
-apply plugin: 'application'
+apply plugin: 'application';
2
apply plugin: 'java';
3
apply plugin: 'eclipse';
4
apply plugin: 'findbugs';
5
apply plugin: 'pmd';
6
apply plugin: 'jacoco';
7
8
-version = '1.1-SNAPSHOT'
+
9
+// -SNAPSHOT is added if the release task is not set
10
+version = '1.1'
11
archivesBaseName = 'STT'
12
13
def javaHome = System.properties['java.home']
@@ -144,3 +146,13 @@ clean {
144
146
task wrapper(type: Wrapper) {
145
147
gradleVersion = '2.2'
148
}
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