I tried this but failed
i want to pass -include-runtime but the jar file dont have those classes
im using gradle 6.7. and my ide says: No candidates found for method call kotlinOptions. but gradle still can run task "build"
and i also tried shadow plugin. it successed.. but i dont want shadow plugin to pack other optional depencies(optional is only relative to software, not compiling software is optional, so "compile" is what i used.). is there a way to only pack kotlin runtime to the jar file?
use compiler args:
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += '-include-runtime'
}
}
use shadow plugin:
shadowJar {
baseName = 'Test'
}
question from:
https://stackoverflow.com/questions/65931453/how-to-pass-compile-args-to-kotlinc-with-gradle 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…