fancyholograms: update versioning and refactor version retrieval method

This commit is contained in:
Oliver
2025-03-15 19:49:44 +01:00
parent b648e86ace
commit 04a861562e
4 changed files with 16 additions and 9 deletions

View File

@@ -1,4 +1,3 @@
fancyhologramsVersion=2.4.2
fancyvisualsVersion=0.0.1 fancyvisualsVersion=0.0.1
fancylibVersion=36 fancylibVersion=36
fancysitulaVersion=0.0.13 fancysitulaVersion=0.0.13

View File

@@ -1 +1 @@
2.4.2 3.0.0-SNAPSHOT.1

View File

@@ -48,7 +48,7 @@ tasks {
create<MavenPublication>("maven") { create<MavenPublication>("maven") {
groupId = "de.oliver" groupId = "de.oliver"
artifactId = "FancyHolograms" artifactId = "FancyHolograms"
version = findProperty("fancyhologramsVersion") as String version = getFHVersion()
from(project.components["java"]) from(project.components["java"])
} }
} }
@@ -68,4 +68,8 @@ tasks {
options.release.set(17) options.release.set(17)
} }
}
fun getFHVersion(): String {
return file("../VERSION").readText()
} }

View File

@@ -33,7 +33,7 @@ val supportedVersions =
allprojects { allprojects {
group = "de.oliver" group = "de.oliver"
version = findProperty("fancyhologramsVersion") as String version = getFHVersion()
description = "Simple, lightweight and fast hologram plugin using display entities" description = "Simple, lightweight and fast hologram plugin using display entities"
repositories { repositories {
@@ -78,7 +78,7 @@ paper {
bootstrapper = "de.oliver.fancyholograms.main.FancyHologramsBootstrapper" bootstrapper = "de.oliver.fancyholograms.main.FancyHologramsBootstrapper"
loader = "de.oliver.fancyholograms.main.FancyHologramsLoader" loader = "de.oliver.fancyholograms.main.FancyHologramsLoader"
foliaSupported = true foliaSupported = true
version = findProperty("fancyhologramsVersion") as String version = getFHVersion()
description = "Simple, lightweight and fast hologram plugin using display entities" description = "Simple, lightweight and fast hologram plugin using display entities"
apiVersion = "1.19" apiVersion = "1.19"
load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD
@@ -141,7 +141,7 @@ tasks {
val props = mapOf( val props = mapOf(
"description" to project.description, "description" to project.description,
"version" to findProperty("fancyhologramsVersion") as String, "version" to getFHVersion(),
"hash" to getCurrentCommitHash(), "hash" to getCurrentCommitHash(),
) )
@@ -177,9 +177,13 @@ fun getLastCommitMessage(): String {
return "" return ""
} }
fun getFHVersion(): String {
return file("VERSION").readText()
}
hangarPublish { hangarPublish {
publications.register("plugin") { publications.register("plugin") {
version = findProperty("fancyhologramsVersion") as String version = getFHVersion()
id = "FancyHolograms" id = "FancyHolograms"
channel = "Alpha" channel = "Alpha"
@@ -199,9 +203,9 @@ hangarPublish {
modrinth { modrinth {
token.set(System.getenv("MODRINTH_PUBLISH_API_TOKEN")) token.set(System.getenv("MODRINTH_PUBLISH_API_TOKEN"))
projectId.set("fancyholograms") projectId.set("fancyholograms")
versionNumber.set(findProperty("fancyhologramsVersion") as String) versionNumber.set(getFHVersion())
versionType.set("alpha") versionType.set("alpha")
uploadFile.set(file("build/libs/FancyHolograms-${findProperty("fancyhologramsVersion") as String}.jar")) uploadFile.set(file("build/libs/FancyHolograms-${getFHVersion()}.jar"))
gameVersions.addAll(supportedVersions) gameVersions.addAll(supportedVersions)
loaders.add("paper") loaders.add("paper")
loaders.add("folia") loaders.add("folia")