Add commit hash to platform versions

This commit is contained in:
jmp committed 2021-05-09 02:09:53 -07:00
1 parent a0fcd2256d
commit eb09819a69
6 files changed
+21 -17

No files matched your search

+10 -6
View File
@@ -9,18 +9,15 @@ plugins {
id("net.kyori.indra")
id("net.kyori.indra.git")
id("net.kyori.indra.checkstyle")
id("net.kyori.indra.publishing")
id("net.kyori.indra.publishing") apply false
id("com.github.johnrengelman.shadow") apply false
id("org.checkerframework") apply false
}
ext["github"] = "https://github.com/Hexaoxide/Carbon"
val projectVersion: String by project
group = "net.draycia"
description = "CarbonChat - A modern chat plugin"
version = projectVersion // todo: include git hash
val projectVersion: String by project // get from gradle.properties
version = projectVersion
subprojects {
apply<IndraPlugin>()
@@ -28,6 +25,13 @@ subprojects {
apply<IndraPublishingPlugin>()
apply<CheckerFrameworkPlugin>()
if (projectVersion.endsWith("-SNAPSHOT")) {
// Add git commit hash to version for platforms, but not for API
if (this != rootProject.projects.carbonchatApi.dependencyProject) {
version = "$projectVersion+${indraGit.commit()?.name?.substring(0, 7) ?: error("Failed to retrieve git commit hash")}"
}
}
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")