Skip to content
This repository was archived by the owner on Jan 4, 2026. It is now read-only.

Commit 297fb94

Browse files
committed
chore: automatically replace version
1 parent c2e0450 commit 297fb94

5 files changed

Lines changed: 40 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ nb-configuration.xml
4242

4343
# Ignore DevSpace cache and log folder
4444
.devspace/
45+
46+
# Ignore kotlin folder
47+
.kotlin

paper/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ tasks.shadowJar {
1414
archiveClassifier.set("") // Removes the 'all' classifier
1515
archiveVersion.set("") // Removes the version from the jar name
1616
}
17+
18+
tasks.processResources {
19+
inputs.property("version", project.version)
20+
21+
filesMatching(listOf("**/plugin.yml")) {
22+
expand("VERSION" to project.version.toString())
23+
}
24+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: GroundsServerDiscovery
2-
version: 1.0.0-SNAPSHOT
2+
version: ${VERSION}
33
main: gg.grounds.GroundsPluginServerDiscovery
44

55
api-version: 1.21

velocity/build.gradle.kts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
plugins { id("com.gradleup.shadow") version "9.3.0" }
1+
plugins {
2+
id("com.gradleup.shadow") version "9.3.0"
3+
id("com.opencastsoftware.gradle.buildinfo") version "0.3.1"
4+
}
25

36
dependencies {
47
implementation(project(":common"))
@@ -15,3 +18,19 @@ tasks.shadowJar {
1518
archiveClassifier.set("") // Removes the 'all' classifier
1619
archiveVersion.set("") // Removes the version from the jar name
1720
}
21+
22+
buildInfo {
23+
packageName.set("gg.grounds")
24+
className.set("BuildInfo")
25+
properties.set(mapOf("version" to "${project.version}"))
26+
}
27+
28+
val generateBuildInfo: TaskProvider<Task> = tasks.named("generateBuildInfo")
29+
30+
tasks
31+
.matching { it.name == "kaptGenerateStubsKotlin" }
32+
.configureEach { dependsOn(generateBuildInfo) }
33+
34+
tasks.matching { it.name == "kaptKotlin" }.configureEach { dependsOn(generateBuildInfo) }
35+
36+
tasks.matching { it.name == "compileKotlin" }.configureEach { dependsOn(generateBuildInfo) }

velocity/src/main/kotlin/gg/grounds/GroundsPluginServerDiscovery.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ import gg.grounds.discovery.VelocityDiscoveryConfig
1111
import gg.grounds.discovery.VelocityDiscoveryService
1212
import org.slf4j.Logger
1313

14-
@Plugin(id = "plugin-server-discovery", name = "Grounds Server Discovery Plugin")
14+
@Plugin(
15+
id = "plugin-server-discovery",
16+
name = "Grounds Server Discovery Plugin",
17+
version = BuildInfo.version,
18+
description = "Grounds server discovery plugin for Velocity",
19+
authors = ["Grounds Development Team and contributors"],
20+
url = "https://github.com/groundsgg/plugin-server-discovery",
21+
)
1522
class GroundsPluginServerDiscovery
1623
@Inject
1724
constructor(private val proxyServer: ProxyServer, private val logger: Logger) {

0 commit comments

Comments
 (0)