Skip to content

Commit ac7fe42

Browse files
committed
Expose the analyzer as a Clojure CLI tool
so that users can easily verify that their libraries workf fine with cljdoc
1 parent 2585e4c commit ac7fe42

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

README.adoc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,41 @@ clojure -M -m cljdoc-analyzer.main analyze \
162162

163163
We can look at other features as we get a feel for what folks are interested in.
164164

165+
=== use as a Clojure CLI tool
166+
167+
You can also install and use cljdoc-analyzer as a https://clojure.org/reference/deps_and_cli#tool_install[Clojure CLI Tool]. First you need to install it:
168+
169+
[source,bash,no-wrap]
170+
----
171+
clojure -Ttools install io.github.cljdoc/cljdoc-analyzer '{:git/tag "0.10.3"}' :as cljdoc
172+
----
173+
174+
and then you can invoke it in one of the supported ways.
175+
176+
.Analyze a library from a (local) Maven repo
177+
[source,bash,no-wrap]
178+
----
179+
clojure -Tcljdoc analyze \
180+
:project '"io.aviso/pretty"' :version '"0.1.29"' \
181+
# Alt.1.: Download the jar, pom from a maven repo and derive the paths: \
182+
:download? true \
183+
# Alt.2.: Provide paths to the project artifacts manually: \
184+
#:jarpath "/path/to/project.jar" \
185+
#:pompath "/path/to/project.pom" \
186+
:extra-repo '["clojars https://repo.clojars.org/"]'
187+
----
188+
189+
See `cljdoc-analyzer.main/analyze` for accepted configuration.
190+
191+
.Analyze a deps-based library in the current directory
192+
[source,bash,no-wrap]
193+
----
194+
cd git clone [email protected]:fulcrologic/fulcro.git
195+
cd fulcro
196+
clojure -Tcljdoc analyze-local
197+
# provided ./pom.xml and ./target/*.jar exist
198+
----
199+
165200
=== logging
166201

167202
If using cljdoc-analyzer as a library, provide your own logging config as appropriate for your app.

deps.edn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
ch.qos.logback/logback-classic {:mvn/version "1.3.0-alpha12"}
66
org.jsoup/jsoup {:mvn/version "1.14.3"}
77
version-clj/version-clj {:mvn/version "2.0.2"}
8-
cli-matic/cli-matic {:mvn/version "0.4.3"}}
8+
cli-matic/cli-matic {:mvn/version "0.4.3"}
9+
babashka/fs {:mvn/version "0.1.2"}}
10+
:tools/usage {:ns-default cljdoc-analyzer.deps-tool}
911
:aliases {:test
1012
{:extra-paths ["test/unit" "test/integration" "test-resources"]
1113
:extra-deps {lambdaisland/kaocha {:mvn/version "1.60.977"}

src/cljdoc_analyzer/main.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
(let [config (config/load)
1919
extra-repos (extra-repo-arg-to-option extra-repo)
2020
{:keys [jar pom]} (deps/resolve-dep (symbol project) version (:repos config) extra-repos)]
21-
(runner/analyze! (-> (select-keys args [:project :version :exclude-with :output-filename])
21+
(runner/analyze! (-> (merge
22+
{:exclude-with [:no-doc :skip-wiki]}
23+
(select-keys args [:project :version :exclude-with :output-filename]))
2224
(assoc :jarpath jar :pompath pom :extra-repos extra-repos)))))
2325

2426
(spec/def ::extra-repo

0 commit comments

Comments
 (0)