This isn't so much a cursive question as an IntelliJ plugin question, but this is the best place I can think of to ask: How hard would it be / what apis should I be looking at to read dependencies from a run configuration. As in, if I had a file like
--class-path ... --module-path ...
under dependencySets/example , make what is on those paths available to the editor. Talking about "regular" java since thats the world that lacks a deps.edn equivalentIt depends on what you mean by "make those paths available". Do you mean something like the deps project sync?
I mean something like the deps project sync
I made a cli tool that turns a file like this
[project]
defaultUsage="--class-path"
[[project.dependencies]]
coordinate="pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.18.2"
[[project.dependencies]]
coordinate="pkg:maven/org.junit.jupiter/junit-jupiter-api@5.11.4"
dependencySets=["test"]
[[project.dependencies]]
coordinate="build/javac"
dependencySets=["junit"]
[[project.dependencies]]
coordinate="pkg:maven/org.junit.platform/junit-platform-console@1.10.2"
dependencySets=["junit"]
[[project.dependencies]]
coordinate="pkg:maven/org.junit.jupiter/junit-jupiter-engine@5.10.2"
dependencySets=["junit"]
[[project.dependencies]]
coordinate="pkg:maven/dev.mccue/tools-jdk@2025.01.31"
dependencySets=["build"]
[[project.dependencies]]
coordinate="pkg:maven/dev.mccue/tools-junit@2025.01.31"
dependencySets=["build"]
[[project.dependencies]]
coordinate="pkg:maven/info.picocli/picocli@4.7.6"
dependencySets=["build"]
[project.dependencySets.test]
extends="default"
[project.dependencySets.junit]
extends="test"
into a folder like
dependencySets/
build
default
junit
test
Where each of these files looks like
--class-path
/Users/emccue/.jresolve/....
--module-path
...
And thats enough to be a "partial basis". java @dependencySets/default src/Main.java gets you your depsbut no editor will see/understand that.
So, that is surprisingly complicated. In general, build tools are the bane of my life, and by far the most complicated ongoing part of Cursive. I would recommend either trying to generate files for an existing, supported build system (e.g. Maven, or perhaps deps? I use it to manage several non-Clojure projects), or perhaps looking into https://build-server-protocol.github.io.
Stepping back a bit, why do you want to do this?
because I want to supplant maven/gradle for early learning usage
What do you mean by "early learning usage"? Just trying to understand the use case a bit better.
i.e. instead of a build tool I want them to use a tool that just gets them dependencies, then they learn how those wire up into the different CLI tools
like instead of the hop being between java src/Main.java --- directly to ---> mvn clean compile package + googling and finding the shade plugin
I want the path to be
java src/Main.java -> java --class-path some.jar src/Main.java -> java @dependencySets/default src/Main.java -> javac @dependencySets/default -d classes --module-source-path ... and so on
basically detaching the "getting dependencies" from "building code" tasks
i've already gone down this path far enough to have written my own clone of tools.deps and a java partial equivalent to tools.build (that directly executes the cli tools)
i got it working if you dump dependencies in a folder
but if I want to explain the --module-path vs the --class-path that makes it a smidge hard
I see. That is unfortunately very complicated in IntelliJ. You could do something like dump the deps in a folder, right, and I believe there's a library type which is "use everything in the folder"
doubly so for --processor-module-path, etc.
Right, but you don't need to sync the module path to IntelliJ, right? Just the deps?
yeah and I can already do that with jresolve --output-directory libs pkg:maven/...
> Right, but you don't need to sync the module path to IntelliJ, right? Just the deps? eh? Like if we consider the one dep i keep seeing that needs to go on the module path; thats javafx
so Ideally the intellij run button would know to put that one path on the module path and the rest on the class path
I think that would be the easiest way do what you want. Next easiest would be to generate the build file for something that already exists.
Oh, right, you want run configs too.
yeah my general vibe check is that the approach makes sense but everythings been kinda "but why not maven?"-ed at their core
I think there's scope for a tool like this, but it's a decent chunk of work to integrate into IntelliJ. I only found BSP the other day, it would make sense for your use case but is still fairly experimental.
yeah... I've told other people this in other ways, but I think reforming Java is pure positive for the Clojure world too. People more educated and more comfortable touching the underlying physics are more likely to consider Clojure
rising tides, all ships, etc. - hence why i'm not going "please don't hate me, but im doing java"