Fork me on GitHub
#deps-new
<
2022-01-12
>
brendnz22:01:54

I read a book yesterday which suggested seancorfield/clj-new, alias :new, starting as clj -X:new etc. I looked up cjl-new readme on github, which suggested deps.new instead, at least for non maven coordinates. The readme's for clj-new and deps-new both suggest starting with clj -Tclj-new or clj -Tnew, i.e. with -T. So I thought -T is now preferred to -X. But I read in Clojurians today a post that suggested -T is deprecated, https://clojurians.slack.com/archives/C03S1KBA2/p1642012260272200 . I was going to ask should I learn to use clj-new and deps-new with -X or -T? But then I noticed it may depend on whether they are installed as tools or not. So my question becomes, how do I decide whether to install as a tool or use deps.edn? Then the above question, should I learn to use clj-new and deps-new with -X or -T?

seancorfield22:01:43

@brendnz He got that warning because he was on an old version of the CLI -- he needed to update his CLI.

seancorfield22:01:22

-T originally had a different meaning, was removed, and then came back with a different meaning.

seancorfield22:01:53

In general, -X executes a function, based on an alias in one of the deps.edn files (either the root one -- which only has the :deps alias -- or your user one -- usually in ~/.clojure/ -- or your project one -- in the current directory).

seancorfield22:01:02

Whereas -T executes a function, based on a globally installed tool name (with no :) or based on an alias as with -X except that it ignores the main dependencies (of your project) and only uses the dependencies from that alias. In addition, -T with an alias puts the current directory on the classpath and ignores any other paths in your deps.edn files.

seancorfield22:01:50

The TL;DR is that the "readme's for clj-new and deps-new both suggest starting with clj -Tclj-new or clj -Tnew, i.e. with -T." -- and that's correct, that's the instructions you should follow.

brendnz22:01:14

Thanks Sean, most appreciated.

seancorfield22:01:56

See https://clojure.org/releases/tools for a lot of the history (but not all of it, unfortunately).