diff --git a/build.gradle.kts b/build.gradle.kts index fea7ee2c..51b10a0a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -100,24 +100,25 @@ tasks { // Kotlin Reduced Jars - register("kotlinReducedResources") { - from("src/main/resources") - into("$buildDir/kt-reduced") - doLast { - val pluginFile = file("$buildDir/kt-reduced/plugin.yml") - var content = pluginFile.readText() - content = content.replace("libraries: ['org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10']", "") - pluginFile.writeText(content) - } - } + register("prepareKotlinReducedJar") { + dependsOn(shadowJar) + from(zipTree(shadowJar.get().archiveFile)) + into("$buildDir/kt-reduced") + doLast { + val pluginFile = file("$buildDir/kt-reduced/plugin.yml") + var content = pluginFile.readText() + content = content.replace("libraries: ['org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10']", "") + pluginFile.writeText(content) + } + } - register("kotlinReducedJar") { - dependsOn("kotlinReducedResources") - from(sourceSets.main.get().output) - from("$buildDir/kt-reduced") - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - archiveClassifier.set("KtReduced") - } + register("kotlinReducedJar") { + dependsOn("prepareKotlinReducedJar") + from("$buildDir/kt-reduced") + include("**/*") + duplicatesStrategy = DuplicatesStrategy.INHERIT + archiveClassifier.set("KtReduced") + } }