Don't include the commit hash in the real version

This commit is contained in:
Vankka 2023-12-23 01:04:39 +02:00
parent d29d91b97a
commit e7c82eb386
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
2 changed files with 10 additions and 11 deletions

View File

@ -17,16 +17,8 @@ subprojects {
apply plugin: 'net.kyori.indra.git'
apply plugin: 'dev.vankka.dependencydownload.plugin'
var versionExtra = ""
if (rootProject.version.endsWith("-SNAPSHOT") && indraGit.isPresent()) {
var gitHash = indraGit.commit().getName()
if (gitHash.length() > 7) {
gitHash = gitHash.substring(0, 7);
}
versionExtra = "-" + gitHash
}
group 'com.discordsrv'
version = rootProject.version + versionExtra
version = rootProject.version
java {
sourceCompatibility = JavaVersion.VERSION_1_8
@ -141,6 +133,13 @@ subprojects {
)
if (indraGit.isPresent()) {
indraGit.applyVcsInformationToManifest(manifest)
if (rootProject.version.endsWith("-SNAPSHOT")) {
var gitHash = indraGit.commit().getName()
if (gitHash.length() > 7) {
gitHash = gitHash.substring(0, 7);
}
archiveClassifier = gitHash
}
}
}

View File

@ -6,8 +6,8 @@ task copyOutput(type: Copy) {
}
shadowJar {
// Don't add -all to the end of the jar name
archiveClassifier = ''
// Adds the commit for snapshots to the end of the file name
archiveClassifier = tasks.jar.archiveClassifier
// Include the license in the jar
from(rootProject.file('LICENSE')) {