Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.deps.alpha by
When adding a dependency, I'd like to be able to specify aliases in coordinates of libraries that use deps.edn, for example:

{code:clojure|title=lib/deps.edn}
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
        org.openjfx/javafx-base {:mvn/version "12-ea+10"}}
 :aliases {:web {:extra-deps {org.openjfx/javafx-web {:mvn/version "12-ea+10"}}
                 :extra-paths ["src/web"]}
           :controls {:extra-deps {org.openjfx/javafx-controls {:mvn/version "12-ea+10"}}
                      :extra-paths ["src/controls"]}}
 :paths ["src/base"]}


{code:clojure|title=app/deps.edn}
{:deps {git/lib {:git/url "..."
                 :sha "..."
                 :aliases ["controls"]}}}


This way it will be possible to make more fine-grained libraries that may have optional code/dependencies which won't bloat classpath when unneeded.

2 Answers

0 votes
by

Comment made by: borkdude

Interestingly, I think this also implements a feature that some people have been asking for, namely managed dependencies.

libs/deps.edn could be an empty project that only describes groups of dependencies via aliases (managed deps).
app/deps.edn can consume these groups like in the above example.

Minor detail: maybe :aliases should contain keywords instead of strings?

0 votes
by
Reference: https://clojure.atlassian.net/browse/TDEPS-116 (reported by alex+import)
...