kotlin-interactive-shell icon indicating copy to clipboard operation
kotlin-interactive-shell copied to clipboard

Dependencies from Gradle/Maven

Open gregopet opened this issue 4 years ago • 11 comments

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:

gregopet avatar Oct 21 '21 11:10 gregopet

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

asm0dey avatar Jan 13 '22 08:01 asm0dey

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

scottysinclair avatar Jan 14 '22 09:01 scottysinclair

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?

asm0dey avatar Jan 14 '22 10:01 asm0dey

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.

scottysinclair avatar Jan 15 '22 13:01 scottysinclair

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

asm0dey avatar Jan 15 '22 15:01 asm0dey

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

scottysinclair avatar Jan 15 '22 16:01 scottysinclair

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.

asm0dey avatar Jan 15 '22 20:01 asm0dey

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

scottysinclair avatar Jan 15 '22 20:01 scottysinclair

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

asm0dey avatar Jan 15 '22 20:01 asm0dey

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!

gregopet avatar Jan 17 '22 07:01 gregopet

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.

tjerkw avatar Jun 13 '22 07:06 tjerkw