This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-26
Channels
- # adventofcode (2)
- # babashka (17)
- # babashka-sci-dev (4)
- # beginners (8)
- # chlorine-clover (4)
- # clj-kondo (18)
- # clj-on-windows (1)
- # clojure (11)
- # clojure-india (12)
- # clojure-nl (1)
- # clojure-spec (9)
- # clojure-uk (3)
- # clojurescript (9)
- # conjure (3)
- # events (1)
- # graalvm (6)
- # lsp (6)
- # meander (4)
- # music (2)
- # off-topic (10)
- # other-languages (9)
- # re-frame (2)
- # releases (1)
- # reveal (8)
- # sci (1)
- # tools-deps (6)
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.
The only thing install does is put the tool file there
I think the part you're missing is that tools can publish some config in their own deps.edn under :tools/usage
Right now, only :ns-default and :ns-aliases
But that may expand in the future
@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.