Skip to content

Commit

Permalink
fix kotlin reduced jars
Browse files Browse the repository at this point in the history
  • Loading branch information
Jsinco committed Nov 13, 2024
1 parent 2e489f5 commit 28cd69a
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,25 @@ tasks {


// Kotlin Reduced Jars
register<Copy>("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<Copy>("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<Jar>("kotlinReducedJar") {
dependsOn("kotlinReducedResources")
from(sourceSets.main.get().output)
from("$buildDir/kt-reduced")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("KtReduced")
}
register<Jar>("kotlinReducedJar") {
dependsOn("prepareKotlinReducedJar")
from("$buildDir/kt-reduced")
include("**/*")
duplicatesStrategy = DuplicatesStrategy.INHERIT
archiveClassifier.set("KtReduced")
}


}
Expand Down

0 comments on commit 28cd69a

Please sign in to comment.