kscripting / kscript

Scripting enhancements for Kotlin
MIT License
2.08k stars 126 forks source link

Resolve build target automatically like Gradle #341

Open gad2103 opened 2 years ago

gad2103 commented 2 years ago

I'm not sure this is possible, but I didn't realize that if you are using a multiplatform capable library, you have to only depend on the jvm version of it. I was banging my head against the wall until i looked in my external dependencies folder and saw only jvm versions of libraries that gradle auto-resolved. it would be nice if kscript could do the same.

example:

works @file:DependsOn("com.github.ajalt.clikt:clikt-jvm:3.4.0")

fails during kscript package step @file:DependsOn("com.github.ajalt.clikt:clikt:3.4.0")

holgerbrandl commented 2 years ago

I have not used mulitplatform yet, and won't be of much help here. I guess the support boils down to the kotlin-scripting dependency resolver, which is used under the hood.