make version a function, not class

This commit is contained in:
dfsek
2021-11-24 19:25:49 -07:00
parent 05911027bd
commit 0940611b89
2 changed files with 10 additions and 16 deletions

View File

@@ -19,3 +19,11 @@ fun Project.gitClone(name: String) {
standardOutput = stdout
}
}
fun Project.version(major: String, minor: String, revision: String, preRelease: Boolean = false): String {
return if (!preRelease)
"$major.$minor.$revision"
else //Only use git hash if it's a prerelease.
"$major.$minor.$revision-BETA+${getGitHash()}"
}