deps-new

brendnz 2022-01-12T22:22:54.013100Z

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?

seancorfield 2022-01-12T22:36:43.014Z

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

seancorfield 2022-01-12T22:37:22.014700Z

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

seancorfield 2022-01-12T22:38:53.015900Z

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).

seancorfield 2022-01-12T22:41:02.018100Z

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.

seancorfield 2022-01-12T22:41:50.018900Z

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.

brendnz 2022-01-12T22:44:14.019400Z

Thanks Sean, most appreciated.

seancorfield 2022-01-12T22:48:56.019800Z

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