Skip to content

Commit

Permalink
add section to tdeps guide on dep list/tree
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Nov 17, 2023
1 parent 7fd2837 commit 4993ecc
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions content/guides/deps_and_cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]'`.

0 comments on commit 4993ecc

Please sign in to comment.