mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-01-17 04:38:18 +01:00
permit to override the jgitver version
for packaging a tar ball, jgitver takes the default version of 0.0.0, not practical. putting a version into a file would be possible, but we try to produce a new version with every commit, which then can be released if tests pass, without rebuild. this means the source code should NOT have the version in the commit, but derived. for tar balls, we know the name of the tar, so its easy to set the same version in a script, or put a desired version. pay attention, that ripme checks the version towards github, and suggests an update, if the running version is less than the released one. fixes #145.
This commit is contained in:
parent
aeeac429fe
commit
0bb8d8b2d9
@ -1,6 +1,9 @@
|
||||
// permits to start the build setting the javac release parameter, no parameter means build for java8:
|
||||
// gradle clean build -PjavacRelease=8
|
||||
// gradle clean build -PjavacRelease=17
|
||||
// the build derives a version with the jgitver plugin out of a tag in the git history. when there is no
|
||||
// git repo, the jgitver default would be 0.0.0. one can override this version with a parameter. also, permit
|
||||
// to start the build setting the javac release parameter, no parameter means build for java-17:
|
||||
// gradle clean build -PjavacRelease=21
|
||||
// gradle clean build -PcustomVersion=1.0.0-10-asdf
|
||||
val customVersion = (project.findProperty("customVersion") ?: "") as String
|
||||
val javacRelease = (project.findProperty("javacRelease") ?: "17") as String
|
||||
|
||||
plugins {
|
||||
@ -48,6 +51,12 @@ jgitver {
|
||||
useGitCommitID = true
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if (customVersion != "") {
|
||||
project.version = customVersion
|
||||
}
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
options.release.set(Integer.parseInt(javacRelease))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user