pref: add velocity-plugin.json
This commit is contained in:
parent
889313a734
commit
49440ddc0a
@ -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<Copy>("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)
|
||||
|
@ -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,
|
||||
|
7
src/main/resources/velocity-plugin.json
Normal file
7
src/main/resources/velocity-plugin.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "proxyserverhelper",
|
||||
"name": "ProxyServerHelper",
|
||||
"version": "${version}",
|
||||
"authors": ["thehrz"],
|
||||
"main": "io.github.thehrz.proxyServerHelper.ProxyServerHelper"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package io.github.thehrz.proxyServerHelper;
|
||||
|
||||
// The constants are replaced before compilation
|
||||
public class BuildConstants {
|
||||
|
||||
public static final String VERSION = "${version}";
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user