1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-07 14:26:36 +02:00

gradle, set jar version to <version>-<distance>-<sha>

set the version to the last tag, plus the number of commits since the
last tag (called "distance"), and the git hash (sha). an example:
  1.7.94-9-c9d7deca

in case there is an annotated tag on the commit built itself it
is a release, and no distance, and sha is added:
  1.7.94

in case the build is not from main and master branch, the branch
name will be added, special characters are translated to underscore:
  1.7.94-9-c9d7deca-other_branch
This commit is contained in:
soloturn
2021-02-22 02:41:39 +01:00
parent c9d7deca20
commit bfa50147ab

View File

@@ -1,4 +1,5 @@
plugins {
id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
id("jacoco")
id("java")
id("maven-publish")
@@ -29,6 +30,12 @@ group = "com.rarchives.ripme"
version = "1.7.94"
description = "ripme"
jgitver {
gitCommitIDLength = 8
nonQualifierBranches = "main,master"
useGitCommitID = true
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8