From 4993ecccf298ee4f54f8ce43ab75545de47dde68 Mon Sep 17 00:00:00 2001 From: Alex Miller Date: Fri, 17 Nov 2023 15:51:57 -0600 Subject: [PATCH] add section to tdeps guide on dep list/tree --- content/guides/deps_and_cli.adoc | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/content/guides/deps_and_cli.adoc b/content/guides/deps_and_cli.adoc index 57780b39..f72e731d 100644 --- a/content/guides/deps_and_cli.adoc +++ b/content/guides/deps_and_cli.adoc @@ -509,3 +509,37 @@ user=> (+ 1 1) Use Ctrl-D to exit the repl and Ctrl-C to exit the server. +[[list_deps]] +=== List all dependencies + +There are several helpful tools in the built-in `:deps` alias to explore the full set of transitive deps. + +To https://clojure.github.io/tools.deps.cli/clojure.tools.deps.cli.api-api.html#clojure.tools.deps.cli.api/list[list the full set of all the deps] included on your classapth, use `clj -X:deps list`. For example in the `hello-world` application at the top of this guide, you would see something like this: + +[source,shell] +---- +% clj -X:deps list +clojure.java-time/clojure.java-time 1.1.0 (MIT) +org.clojure/clojure 1.11.1 (EPL-1.0) +org.clojure/core.specs.alpha 0.2.62 (EPL-1.0) +org.clojure/spec.alpha 0.3.218 (EPL-1.0) +time-lib/time-lib ../cli-getting-started/time-lib +---- + +The full set of transitive dependencies used by your application is listed in alphabetical order with version and license. See the api docs for additional printing options. + +If you want to understand the https://clojure.github.io/tools.deps.cli/clojure.tools.deps.cli.api-api.html#clojure.tools.deps.cli.api/tree[tree structure of your dependencies] and how version selection choices were made, use `clj -X:deps tree`: + +[source,shell] +---- +% clj -X:deps tree +org.clojure/clojure 1.11.1 + . org.clojure/spec.alpha 0.3.218 + . org.clojure/core.specs.alpha 0.2.62 +time-lib/time-lib /Users/alex.miller/tmp/cli-getting-started/time-lib + . clojure.java-time/clojure.java-time 1.1.0 +---- + +There were no version selections made here, but see https://clojure.org/reference/dep_expansion#_tree_printing[the docs] for more on how the choices are explained in the tree. + +Both of these helper functions take an optional `:aliases` argument if you wish to examine the dependency list or tree with one or more aliases applied, such as `clj -X:deps list '[:alias1 :alias2]'`.