Skip to content

Commit 2ec3499

Browse files
committed
TDEPS-272 prep now supports prep of named tool
1 parent 2d50501 commit 2ec3499

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
===========
33

4+
* next
5+
* TDEPS-272 - `prep` now supports prep of named tool
6+
* Update to latest deps
47
* 0.12.105 on Aug 26, 2025
58
* Update to Clojure 1.12.2 and latest tools.deps
69
* 0.11.100 on Aug 14, 2025

src/main/clojure/clojure/tools/deps/cli/api.clj

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@
6060
6161
This program accepts the same basis-modifying arguments from the `basis` program.
6262
Each dep source value can be :standard, a string path, a deps edn map, or nil.
63-
Sources are merged in the order - :root, :user, :project, :extra.
63+
Sources are merged in the order - :root, :user, :project, :extra. Alternately,
64+
provide a :tool name to prep the libs for a tool.
6465
6566
Options:
67+
:tool - Tool name (symbol or string) to prep installed tool
6668
:force - flag on whether to force prepped libs to re-prep (default = false)
6769
:current - flag on whether to prep current project too (default = false)
6870
:log - :none, :info (default), or :debug
@@ -76,11 +78,16 @@
7678
:aliases - coll of kw aliases of argmaps to apply to subprocesses
7779
7880
Returns params used."
79-
[{:keys [force log current] :or {log :info, current false} :as params}]
80-
(let [basis (deps/create-basis params)
81-
opts {:action (if force :force :prep)
81+
[{:keys [force log current tool] :or {log :info, current false} :as params}]
82+
(let [opts {:action (if force :force :prep)
8283
:log log
83-
:current current}]
84+
:current current}
85+
params (if tool
86+
(if-let [{:keys [lib coord]} (tool/resolve-tool (name tool))]
87+
{:project nil, :args {:deps {lib coord}}}
88+
(throw (ex-info (str "Unknown tool: " tool) {:tool tool})))
89+
params)
90+
basis (deps/create-basis params)]
8491
(deps/prep-libs! (:libs basis) opts basis)
8592
params))
8693

@@ -94,6 +101,13 @@
94101
:log :debug
95102
:force true})
96103
nil)
104+
105+
(do
106+
(prep
107+
{:root {:mvn/repos mvn/standard-repos, :deps nil}
108+
:tool 'eden
109+
:log :debug
110+
:force true}))
97111
)
98112

99113
(defn tree

0 commit comments

Comments
 (0)