Fix run bungeecord not build jar
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
pluginVersion=0.1.4
|
pluginVersion=0.1.5
|
||||||
@@ -22,6 +22,10 @@ abstract class RunBrokerBungeeCordTask : DefaultTask() {
|
|||||||
|
|
||||||
private val logger = LoggerFactory.getLogger("RunBrokerBungeeCord")
|
private val logger = LoggerFactory.getLogger("RunBrokerBungeeCord")
|
||||||
|
|
||||||
|
init {
|
||||||
|
dependsOn(project.tasks.named("shadowJar"))
|
||||||
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun runSubserver() {
|
fun runSubserver() {
|
||||||
val settings = project.extensions.getByType(RunBrokerSubserverExtension::class.java)
|
val settings = project.extensions.getByType(RunBrokerSubserverExtension::class.java)
|
||||||
@@ -39,6 +43,11 @@ abstract class RunBrokerBungeeCordTask : DefaultTask() {
|
|||||||
logger.info("BungeeCord downloaded...")
|
logger.info("BungeeCord downloaded...")
|
||||||
if (!bungeeCord.exists()) bungeeCord.writeBytes(bungeeCordBytes)
|
if (!bungeeCord.exists()) bungeeCord.writeBytes(bungeeCordBytes)
|
||||||
val executablePath = settings.javaExecPath.get().path
|
val executablePath = settings.javaExecPath.get().path
|
||||||
|
val previousPluginJar = File(pluginsDir, "_broker-plugin.jar")
|
||||||
|
if (previousPluginJar.exists()) previousPluginJar.delete()
|
||||||
|
val shadowJarTask = project.tasks.named("shadowJar").get()
|
||||||
|
val builtJar = shadowJarTask.outputs.files.singleFile
|
||||||
|
builtJar.copyTo(previousPluginJar, overwrite = true)
|
||||||
project.exec {
|
project.exec {
|
||||||
it.executable = if (executablePath == "-") "java" else executablePath
|
it.executable = if (executablePath == "-") "java" else executablePath
|
||||||
it.workingDir = project.layout.projectDirectory.dir("run/bungee/").asFile
|
it.workingDir = project.layout.projectDirectory.dir("run/bungee/").asFile
|
||||||
|
|||||||
Reference in New Issue
Block a user