From 5375184892bc32d17f804096c5f13566f282dd0b Mon Sep 17 00:00:00 2001 From: iGabyTM Date: Mon, 10 Jan 2022 00:02:09 +0200 Subject: [PATCH] [plugin] change copyToServer task usage: `gradle copyToServer -PtestServerVersion=1_12_2` --- gradle.properties | 3 ++- plugin/build.gradle | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index 29e08e8..3fe5b9b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ -kotlin.code.style=official \ No newline at end of file +kotlin.code.style=official +testServerVersion= \ No newline at end of file diff --git a/plugin/build.gradle b/plugin/build.gradle index 13bd4c1..8725da2 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -60,6 +60,12 @@ dependencies { compileOnly fileTree(dir: './libs', includes: ['*.jar']) } +compileKotlin { + kotlinOptions { + jvmTarget = "1.8" + } +} + processResources { eachFile { expand version: project.version } } @@ -79,12 +85,11 @@ shadowJar { } task copyToServer(type: Copy) { - from shadowJar - into '../server/plugins' -} - -compileKotlin { - kotlinOptions { - jvmTarget = "1.8" + if (testServerVersion == '') { + from shadowJar + into '../server/plugins' + } else { + from shadowJar + into '../server/.' + testServerVersion + '/plugins' } } \ No newline at end of file