Exclude branch name from file name

This commit is contained in:
Vankka 2023-12-23 00:47:26 +02:00
parent 9a97cf7578
commit d29d91b97a
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0

View File

@ -19,15 +19,11 @@ subprojects {
var versionExtra = "" var versionExtra = ""
if (rootProject.version.endsWith("-SNAPSHOT") && indraGit.isPresent()) { if (rootProject.version.endsWith("-SNAPSHOT") && indraGit.isPresent()) {
var branch = indraGit.branchName()
if (branch == null) {
branch = "detached-head"
}
var gitHash = indraGit.commit().getName() var gitHash = indraGit.commit().getName()
if (gitHash.length() > 7) { if (gitHash.length() > 7) {
gitHash = gitHash.substring(0, 7); gitHash = gitHash.substring(0, 7);
} }
versionExtra = "-" + branch + "-" + gitHash versionExtra = "-" + gitHash
} }
group 'com.discordsrv' group 'com.discordsrv'
version = rootProject.version + versionExtra version = rootProject.version + versionExtra