We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f338da commit 768daeeCopy full SHA for 768daee
buildSrc/src/main/kotlin/versioning.kt
@@ -15,7 +15,9 @@ fun Project.gitVersion(): String {
15
val lastTag = if (runCommand("git tag", "").isEmpty()) "" else runCommand("git describe --tags --abbrev=0", "")
16
val lastVersion = if (lastTag.isEmpty()) "0.0" else lastTag.substring(1) // remove the leading 'v'
17
val commits = runCommand("git rev-list --count $lastTag..HEAD", "0")
18
+ val branch = runCommand("git branch --show-current")
19
val gitVersion = lastVersion +
20
+ (if (branch == "master") "" else "-${branch.replace('/', '.')}") +
21
(if (commits == "0") "" else "-$commits") +
22
(if (gitClean()) "" else "-dirty")
23
0 commit comments