diff --git a/build.gradle b/build.gradle index 083f61db..bb199dbe 100644 --- a/build.gradle +++ b/build.gradle @@ -52,6 +52,24 @@ if (branch != null) { def isCanary = version.toString().contains('canary') +buildscript { + repositories { + maven {url "https://plugins.gradle.org/m2/"} + mavenCentral() + mavenLocal() + } + dependencies { + classpath "org.apache.httpcomponents:httpmime:4.5.13" + classpath "com.google.code.gson:gson:2.8.6" + classpath "org.apache.httpcomponents:httpclient:4.5.13" + } +} + + +plugins { + id 'dev.s7a.gradle.minecraft.server' version '1.1.0' +} + allprojects { apply plugin: 'java' @@ -70,19 +88,6 @@ allprojects { targetCompatibility = 1.8 } -buildscript { - repositories { - maven {url "https://plugins.gradle.org/m2/"} - mavenCentral() - mavenLocal() - } - dependencies { - classpath "org.apache.httpcomponents:httpmime:4.5.13" - classpath "com.google.code.gson:gson:2.8.6" - classpath "org.apache.httpcomponents:httpclient:4.5.13" - } -} - apply from: 'env-variables.gradle' archivesBaseName = "Advanced-Portals" @@ -180,6 +185,31 @@ task discordupload { println("Discord webhook unspecified") } } + +} +minecraftServerConfig { + jarUrl.set('https://download.getbukkit.org/spigot/spigot-1.18.2.jar') + jvmArgument = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-DIReallyKnowWhatIAmDoingISwear=true"] +} + + +task copyPlugin() { + doLast { + copy { + println "$buildDir/libs/Advanced-Portals-${getVersion()}.jar" + println "$buildDir/MinecraftServer/plugins/Advanced-Portals-${getVersion()}.jar" + try { + delete fileTree("$buildDir/MinecraftServer/plugins/") { + include "*.jar" + } + } + catch (RuntimeException e) { + println e.getLocalizedMessage() + } + from file("$buildDir/libs/Advanced-Portals-${getVersion()}.jar") + into file("$buildDir/MinecraftServer/plugins") + } + } } minecraftServerConfig {