Fork me on GitHub
#tools-deps
<
2021-12-26
>
practicalli-johnny12:12:23

From a user point of view, I have a feeling I am missing some understanding in regards to -T tools approach. I appreciate that tools makes it more explicit that the tool is separate from any Clojure project configuration, so an advantage for tool developers. However, the benefit seems less obvious for the user over using -X with a user wide alias or -T with the same user wide aliases. Using an alias in the user wide deps.edn file, I can run a tool without having to install it (although I do have to create the alias initially). I can create explicit names for specific functions from the tool and define my own defaults. I can version the user wide deps.edn file and so is easy to have a wide range of tools immediately available with a clone command. I can also update the library versions for these tools with antq. This seems to save a lot of time installing and updating individual tools. Perhaps its the install aspect of tools I am unclear on. I can list tools that are installed and use my own name for a tool (although I still have to specify the specific function to use from that tool. If I put the .clojure/tools directory under version control, is this enough to 'install' tools if I clone this onto another computer? Does clojure do anything else when installing a tool? It only seems possible to set default values for a tool in an alias (assuming the tool itself doesn't have the defaults I want). For example, I may want to set a default template when using clj-new or deps-new. I tried adding :exec-fn and :exec-args to the .clojure/tools/toolname.edn file for an installed tool, but this does not seem to be passed to a tool. Maybe its tool specific I wonder if tools have a more obvious advantage if they have a number of functions that can be called. The more functions a tool has, the more need for a flexible command line approach. For example, if I have a tool called project-automation that I install as projects Then I can call new, test, build, outdated-deps, uberjar, deploy-jar, etc. However, this is a composite of multiple tools each of which are currently installed using an individual name for each tool. At the very least it seems prudent to update the practicalli/clojure-deps-edn documentation to use -T for those aliases that should be run as an isolated tool, so the do not pick up project paths and deps. Any further insight or documentation I should read is appreciated. Thanks.

Alex Miller (Clojure team)13:12:16

The only thing install does is put the tool file there

Alex Miller (Clojure team)13:12:13

I think the part you're missing is that tools can publish some config in their own deps.edn under :tools/usage

Alex Miller (Clojure team)13:12:01

Right now, only :ns-default and :ns-aliases

Alex Miller (Clojure team)13:12:13

But that may expand in the future

seancorfield20:12:45

@jr0cket I have my tools folder under version control - it's in my dot-clojure repo, and that's how I keep installed tools in sync across my machines. Nothing else is needed.