Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
id 'maven-publish' // for jitpack.io
}

String group = System.getenv('GROUP') ?: properties['group']
String version = System.getenv('VERSION') ?: properties['version']
String group = System.getenv("GROUP") ?: properties["group"]
String commitHash = "";

rootProject.group = group
rootProject.version = version
rootProject.version = properties["version"] + "." + commitHash

repositories {
mavenCentral()
Expand Down Expand Up @@ -100,6 +100,17 @@ tasks.named('deploy').configure {
dependsOn jar
}

tasks.register('getGitCommitHash') {
doLast {
def ch = 'git rev-parse --short HEAD'.execute().text.trim()
commitHash = ch
}
}

tasks.named("build").configure {
dependsOn getGitCommitHash
}

wrapper {
gradleVersion = '8.9'
distributionType = Wrapper.DistributionType.BIN
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ org.gradle.vfs.watch = false
# Other properties
name = TheBase
group = com.github.server-utilities
version = 1.0-SNAPSHOT
version = 1.0
Loading