tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
arohner 2021-01-12T13:06:58.299900Z

API usage: given a deps.edn file, what is the proper way to merge aliases and come up with the list of :paths that will be used in the classpath?

alexmiller 2021-01-12T13:10:08.300400Z

Call calc-basis

alexmiller 2021-01-12T13:10:43.301Z

Do you mean just local paths?

arohner 2021-01-12T13:11:39.302100Z

Yes, local paths. With a deps.edn that looks like: {:aliases {:test {:extra-paths ["test"]}}, I’d like to get the resolved and merged :paths

arohner 2021-01-12T13:14:20.303Z

I tried (deps/calc-basis (merge read-deps (deps/combine-aliases read-deps [:dev :test]))), but I still see :extra-paths ["test"]

alexmiller 2021-01-12T13:15:38.304100Z

Yeah, the key method is private right now - you’re asking for just part of the job

alexmiller 2021-01-12T13:16:20.304800Z

flatten-paths is the method that does the work you’re asking about

alexmiller 2021-01-12T13:16:53.305700Z

You pass it the deps edn map and the classpath arg map

arohner 2021-01-12T13:17:18.306200Z

ok. I’m fine with hacking it for now

alexmiller 2021-01-12T13:17:25.306500Z

So you wouldn’t call calc-basis

arohner 2021-01-12T13:17:28.306700Z

I wasn’t sure if that was exposed or I wasn’t understanding something

alexmiller 2021-01-12T13:18:10.307700Z

It’s not exactly right now (other than as a prefix of the classpath)

alexmiller 2021-01-12T13:18:52.308600Z

I’m not at a computer but I can be more precise when I am if that’s not enough to go on

arohner 2021-01-12T13:19:25.308900Z

It’s fine, I can hack around it

arohner 2021-01-12T14:01:34.309800Z

(calc-basis deps :resolve-args (combine-aliases deps [:dev :test]) :classpath-args (combine-aliases deps [:dev :test])) appears to do what I need