dundalek/closh

Figure out how to add deps from within a script

dundalek opened this issue · 5 comments

To support git deps. I think it might be possible to call resolve-deps and make-classpatch from tools.deps programatically. Then add the result to classpath with pomegranate's add-classpath.

https://clojure.org/reference/deps_and_cli#_resolve_deps
https://clojure.org/reference/deps_and_cli#_make_classpath

https://github.com/lambdaisland/kaocha/blob/master/src/kaocha/classpath.clj

Some previous work/thought: clj-commons/pomegranate#106

A collegeau pointed me to a similar thing with tools.deps in IClojure (Clojure in Jupyter) https://github.com/HCADatalab/IClojure/blob/62cda58dee9c57d7d5e120df618e9ffbcd6181d9/src/iclj/core.clj#L368

It seems like add-lib function that would handle this is on the roadmap for Clojure 1.11. I think I will wait for that instead of trying to create some custom solution.

With Sci and GraalVM things have becomes slightly more difficult. However, there is this idea from @borkdude to explore the library feature of GraalVM to host native extensions on Clojars :)

See clj-easy/graal-docs#15

@jeroenvandijk That would be cool, I am definitely interested how the exploration will turn out.