diff --git a/build.gradle.kts b/build.gradle.kts index 90d9ac6..eed833f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,7 @@ -import org.jetbrains.gradle.ext.settings -import org.jetbrains.gradle.ext.taskTriggers - plugins { kotlin("jvm") version "2.0.20-Beta1" kotlin("kapt") version "2.0.20-Beta1" id("com.github.johnrengelman.shadow") version "8.1.1" - id("eclipse") - id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.8" } group = "io.github.thehrz" @@ -39,18 +34,11 @@ tasks.build { dependsOn("shadowJar") } -val templateSource = file("src/main/templates") -val templateDest = layout.buildDirectory.dir("generated/sources/templates") -val generateTemplates = tasks.register("generateTemplates") { - val props = mapOf("version" to project.version) +tasks.processResources { + val props = mapOf("version" to version) inputs.properties(props) - - from(templateSource) - into(templateDest) - expand(props) + filteringCharset = "UTF-8" + filesMatching("velocity-plugin.json") { + expand(props) + } } - -sourceSets.main.configure { java.srcDir(generateTemplates.map { it.outputs }) } - -project.idea.project.settings.taskTriggers.afterSync(generateTemplates) -project.eclipse.synchronizationTasks(generateTemplates) diff --git a/src/main/kotlin/io/github/thehrz/proxyServerHelper/ProxyServerHelper.kt b/src/main/kotlin/io/github/thehrz/proxyServerHelper/ProxyServerHelper.kt index c3aa8f2..3342e81 100644 --- a/src/main/kotlin/io/github/thehrz/proxyServerHelper/ProxyServerHelper.kt +++ b/src/main/kotlin/io/github/thehrz/proxyServerHelper/ProxyServerHelper.kt @@ -4,7 +4,6 @@ import com.google.inject.Inject import com.moandjiezana.toml.Toml import com.velocitypowered.api.event.Subscribe import com.velocitypowered.api.event.proxy.ProxyInitializeEvent -import com.velocitypowered.api.plugin.Plugin import com.velocitypowered.api.plugin.annotation.DataDirectory import com.velocitypowered.api.proxy.ProxyServer import io.github.thehrz.proxyServerHelper.listeners.PlayerDisconnectListener @@ -14,10 +13,6 @@ import org.slf4j.Logger import java.nio.file.Files import java.nio.file.Path - -@Plugin( - id = "proxyserverhelper", name = "ProxyServerHelper", version = BuildConstants.VERSION, authors = ["thehrz"] -) class ProxyServerHelper @Inject constructor( val server: ProxyServer, val logger: Logger, diff --git a/src/main/resources/velocity-plugin.json b/src/main/resources/velocity-plugin.json new file mode 100644 index 0000000..f69a63b --- /dev/null +++ b/src/main/resources/velocity-plugin.json @@ -0,0 +1,7 @@ +{ + "id": "proxyserverhelper", + "name": "ProxyServerHelper", + "version": "${version}", + "authors": ["thehrz"], + "main": "io.github.thehrz.proxyServerHelper.ProxyServerHelper" +} \ No newline at end of file diff --git a/src/main/templates/io/github/thehrz/proxyServerHelper/BuildConstants.java b/src/main/templates/io/github/thehrz/proxyServerHelper/BuildConstants.java deleted file mode 100644 index f85ce60..0000000 --- a/src/main/templates/io/github/thehrz/proxyServerHelper/BuildConstants.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.github.thehrz.proxyServerHelper; - -// The constants are replaced before compilation -public class BuildConstants { - - public static final String VERSION = "${version}"; -}