mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-28 17:37:52 +01:00
Add git branch and first 7 of hash to version when version is a snapshot
This commit is contained in:
parent
9bfc5c8be1
commit
37bddcbe81
14
build.gradle
14
build.gradle
@ -17,8 +17,20 @@ subprojects {
|
||||
apply plugin: 'net.kyori.indra.git'
|
||||
apply plugin: 'dev.vankka.dependencydownload.plugin'
|
||||
|
||||
var versionExtra = ""
|
||||
if (rootProject.version.startsWith("-SNAPSHOT") && indraGit.isPresent()) {
|
||||
var branch = indraGit.branchName()
|
||||
if (branch == null) {
|
||||
branch = "detached-head"
|
||||
}
|
||||
var gitHash = indraGit.commit().getName()
|
||||
if (gitHash.length() > 7) {
|
||||
gitHash = gitHash.substring(0, 7);
|
||||
}
|
||||
versionExtra = "-" + branch + "-" + gitHash
|
||||
}
|
||||
group 'com.discordsrv'
|
||||
version = rootProject.version
|
||||
version = rootProject.version + versionExtra
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
Loading…
Reference in New Issue
Block a user