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 {
|
plugins {
|
||||||
kotlin("jvm") version "2.0.20-Beta1"
|
kotlin("jvm") version "2.0.20-Beta1"
|
||||||
kotlin("kapt") version "2.0.20-Beta1"
|
kotlin("kapt") version "2.0.20-Beta1"
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
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"
|
group = "io.github.thehrz"
|
||||||
@ -39,18 +34,11 @@ tasks.build {
|
|||||||
dependsOn("shadowJar")
|
dependsOn("shadowJar")
|
||||||
}
|
}
|
||||||
|
|
||||||
val templateSource = file("src/main/templates")
|
tasks.processResources {
|
||||||
val templateDest = layout.buildDirectory.dir("generated/sources/templates")
|
val props = mapOf("version" to version)
|
||||||
val generateTemplates = tasks.register<Copy>("generateTemplates") {
|
|
||||||
val props = mapOf("version" to project.version)
|
|
||||||
inputs.properties(props)
|
inputs.properties(props)
|
||||||
|
filteringCharset = "UTF-8"
|
||||||
from(templateSource)
|
filesMatching("velocity-plugin.json") {
|
||||||
into(templateDest)
|
expand(props)
|
||||||
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.moandjiezana.toml.Toml
|
||||||
import com.velocitypowered.api.event.Subscribe
|
import com.velocitypowered.api.event.Subscribe
|
||||||
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent
|
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent
|
||||||
import com.velocitypowered.api.plugin.Plugin
|
|
||||||
import com.velocitypowered.api.plugin.annotation.DataDirectory
|
import com.velocitypowered.api.plugin.annotation.DataDirectory
|
||||||
import com.velocitypowered.api.proxy.ProxyServer
|
import com.velocitypowered.api.proxy.ProxyServer
|
||||||
import io.github.thehrz.proxyServerHelper.listeners.PlayerDisconnectListener
|
import io.github.thehrz.proxyServerHelper.listeners.PlayerDisconnectListener
|
||||||
@ -14,10 +13,6 @@ import org.slf4j.Logger
|
|||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
|
|
||||||
@Plugin(
|
|
||||||
id = "proxyserverhelper", name = "ProxyServerHelper", version = BuildConstants.VERSION, authors = ["thehrz"]
|
|
||||||
)
|
|
||||||
class ProxyServerHelper @Inject constructor(
|
class ProxyServerHelper @Inject constructor(
|
||||||
val server: ProxyServer,
|
val server: ProxyServer,
|
||||||
val logger: Logger,
|
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