Kotlin / kotlin-interactive-shell

Kotlin Language Interactive Shell
Apache License 2.0
587 stars 36 forks source link

Dependencies from Gradle/Maven #90

Open gregopet opened 2 years ago

gregopet commented 2 years ago

Feature suggestion: it would be nice to be able to pull in all Gradle/Maven dependencies of a project by "loading" the build file :smile:

asm0dey commented 2 years ago

@gregopet could you clarify a bit, please? Doesn't :dependsOn work for you?

scottysinclair commented 2 years ago

I assume gregopet means to support import of type "pom" and which also brings in the transitive dependencies, I tried this myself with no luck

asm0dey commented 2 years ago

Wow, we didn't even have such an idea! Could you please describe your workflow? To be more precise: why is it not enough to just add regular (jar) dependencies?

scottysinclair commented 2 years ago

Hmm, sorry, Seems I was confused you can only import manager dependencies with a Pom import.

What would be nice is to import project X and automatically have all of project X's transitive dependencies in so I don't have to manually import them all myself.

Then I could put together a script super quickly.

asm0dey commented 2 years ago

Like "If I open ki inside project X I want to get all the configuration of this project"?

scottysinclair commented 2 years ago

Yeah, that sounds good, import the project Pom file and take it from there.

asm0dey commented 2 years ago

I believe that currently, it's an extremely complex task requiring building a big part of IntelliJ IJDEA into ki: in the general case, it's very hard to even find all gradle dependencies.

scottysinclair commented 2 years ago

Ah ok, I thought as KI uses some eclipse maven tools that it could be possible for maven to get the transitive dependencies and do it that way. No biggie, thanks for creating this awesome tool

asm0dey commented 2 years ago

Sorry to say this, but no :( It includes a small subset of Maven responsible for downloading dependencies.

gregopet commented 2 years ago

Yes, what @scottysinclair wrote was the idea. To have an environment set up like my project to test, prototype, experiment or even interact with a running instance easily :smiley:

Thanks for the tool from me as well!

tjerkw commented 2 years ago

Can't we have a gradle task that finds all dependencies of a project through ./gradlew dependencies and then uses that to start a kotlin ki repl? Should be doable.