File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,11 @@ println("Version: $version")
17
17
fun computeVersion (): Any {
18
18
val versionFile = file(" version.txt" )
19
19
val gitVersion: groovy.lang.Closure <String > by extra
20
- var version = if (versionFile.exists()) versionFile.readText().trim() else gitVersion()
21
- if (! versionFile.exists() && " true" != project.findProperty(" ciBuild" )) {
22
- version = " $version -SNAPSHOT"
20
+ return if (versionFile.exists()) {
21
+ versionFile.readText().trim()
22
+ } else {
23
+ gitVersion().let { if (it.endsWith(" -SNAPSHOT" )) it else " $it -SNAPSHOT" }.also { versionFile.writeText(it) }
23
24
}
24
- return version
25
25
}
26
26
27
27
subprojects {
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
3
set -e
4
- cd " $( dirname " $0 " ) "
5
-
6
4
(
7
- cd ..
8
- ./modelix-version.sh # ensure the version.txt exists
9
- ./gradlew publishToMavenLocal
5
+ cd " $( dirname " $0 " ) "
6
+ ./gradlew build
10
7
)
11
-
12
- ./gradlew build
You can’t perform that action at this time.
0 commit comments