tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
arohner 2020-07-03T15:40:23.206Z

is there a way to exclude a dep from the tree, regardless of how it got there?

arohner 2020-07-03T15:40:40.206500Z

:exclusions appears to be per-dep only, but I want to assert e.g. logback should never be present

neumann 2020-07-03T19:31:45.211400Z

Is there a way to replace or remove paths in an alias? I want to exclude on of my source paths in just one alias.

neumann 2020-07-03T19:32:52.212300Z

My current coping mechanism is to set -Sdeps '{:paths ["some" "paths" ...]}' on the command line.

dominicm 2020-07-03T19:45:36.212800Z

@neumann why not move the optional paths to an alias?

neumann 2020-07-03T19:50:02.215300Z

@dominicm I'd like to avoid that because I don't want to have to specify another -A: in all of the cases except one. The extra -A: is just another thing to forget to do.

borkdude 2020-07-03T19:54:42.215900Z

@neumann major hack, this removes the src path from the classpath:

borkdude@vps1918:~$ export classpath=$(clojure -Spath)
borkdude@vps1918:~$ new_classpath=$(bb -o -e '(let [path (System/getenv "classpath"), paths (str/split path #":"), paths (remove #(= "src" %) paths)] (str/join ":" paths))')
borkdude@vps1918:~$ clojure -Scp "$new_classpath"
Clojure 1.9.0
user=>

neumann 2020-07-03T19:56:24.216800Z

@borkdude Nice! Yes, I was thinking of maybe using babashka. (Which is amazing! Thank you so much for creating it!)

neumann 2020-07-03T20:01:06.217500Z

@borkdude Something like this, using "src" as the example:

cat deps.edn | bb -I -e '(->> *input* first :paths (remove #{"src"}) vec)'

borkdude 2020-07-03T20:02:25.217900Z

@neumann if you need only one EDN input value:

$ cat deps.edn | bb -e '(->> *input* :paths (remove #{"src"}) vec)'
["parser" "resources" "inlined"]

borkdude 2020-07-03T20:02:44.218300Z

-I is for collecting a lazy seq of multiple EDN input values

neumann 2020-07-03T20:03:21.218500Z

Oh! Very nice! Thanks!