diff --git a/build.gradle b/build.gradle index d63421ed..195f1096 100644 --- a/build.gradle +++ b/build.gradle @@ -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 + } } } diff --git a/buildscript/final.gradle b/buildscript/final.gradle index dde959cd..c7fe364f 100644 --- a/buildscript/final.gradle +++ b/buildscript/final.gradle @@ -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')) {