-
Notifications
You must be signed in to change notification settings - Fork 19
/
deps.edn
326 lines (250 loc) · 11.3 KB
/
deps.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
;; The deps.edn file describes the information needed to build a classpath.
;;
;; deps.edn configuration is a combination of
;; - install-level (latest Clojure version at install time)
;; - user level - $HOME/.clojure/deps.edn
;; - project level - deps.edn in root of project
;;
;; For all attributes other than :paths, these config files are merged left to right.
;; Only the last :paths is kept and others are dropped.
{
;; Paths
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Directories in the current project to include in the classpath
;; :paths ["src"]
;; External dependencies
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:deps
{org.clojure/clojure {:mvn/version "1.10.1"}}
:aliases
{
;; Aliases
;; resolve-deps aliases (-R) affect dependency resolution, options:
;; :extra-deps - specifies extra deps to add to :deps
;; :override-deps - specifies a coordinate to use instead of that in :deps
;; :default-deps - specifies a coordinate to use for a lib if one isn't found
;; make-classpath aliases (-C) affect the classpath generation, options:
;; :extra-paths - vector of additional paths to add to the classpath
;; :classpath-overrides - map of lib to path that overrides the result of resolving deps
;; Creating projects from templates
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; https://github.com/seancorfield/clj-new
;;
;; clj -A:new template-name domain/namespace
;; clj -m myname.myapp
;; clj -A:test:runner
:new
{:extra-deps {seancorfield/clj-new {:mvn/version "1.0.199"}}
:main-opts ["-m" "clj-new.create"]}
;; REPL experience
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clojure REPL with syntax highlighting, built in docs and a quit command `:repl/quit`
:rebel
{:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}}
:main-opts ["-m" "rebel-readline.main"]}
;; ClojureScript REPL rebel readline service
;; https://github.com/bhauman/rebel-readline/tree/master/rebel-readline-cljs
;; Starts the default CLJS repl, eg. nashorn
:rebel-cljs
{:extra-deps {com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}}
:main-opts ["-m" "rebel-readline-cljs.main"]}
;; Java Sources
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Look up Java Class and method definitions, eg. `cider-find-var` in Emacs
;; Requires: Java sources installed locally
;; Examples are from Ubuntu package install locations
:java-8-source
{:extra-deps
{java-sources {:local/root "/usr/lib/jvm/openjdk-8/lib/src.zip"}}}
:java-11-source
{:extra-deps
{java-sources {:local/root "/usr/lib/jvm/openjdk-11/lib/src.zip"}}}
;; Testing frameworks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Clojure.test
;; Nothing required as it is part of the Clojure library.
;; ;; Clojure spec
:spec
{:extra-deps {org.clojure/spec.alpha {:mvn/version "0.2.176"}}}
;; ;; Clojure spec 2 - under active development
:spec2
{:extra-deps {org.clojure/spec-alpha2
{:git/url "https://github.com/clojure/spec-alpha2"
:sha "495e5ac3238be002b4de72d1c48479f6bec06bb3"}}}
;; Expectations test framework
;; - see https://github.com/clojure-expectations/expectations
;; - and https://github.com/clojure-expectations/clojure-test
;; clj -A:test:expect:test-runner (cognitect test runner)
:expectations
{:extra-deps {expectations {:mvn/version "RELEASE"}
expectations/clojure-test {:mvn/version "RELEASE"}}}
;; Test runners
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Cognitect test-runner
;; https://github.com/cognitect-labs/test-runner
:test-runner-cognitect
{:extra-paths ["test"]
:extra-deps {com.cognitect/test-runner
{:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "f7ef16dc3b8332b0d77bc0274578ad5270fbfedd"}}
:main-opts ["-m" "cognitect.test-runner"]}
;; midje-runner
;; https://github.com/miorimmax/midje-runner
:test-runner-midje
{:extra-paths ["test"]
:extra-deps {midje-runner
{:git/url "https://github.com/miorimmax/midje-runner.git"
:sha "ee9c2813e150ae6b3ea41b446b09ba40fc89bdc1"}}
:main-opts ["-m" "midje-runner.runner"]}
;; eftest - fast and pretty test runner
;; There may be a nicer way to do the main-opts - see the Eastwood and kibit issue discussion
;; https://github.com/jonase/eastwood/commit/4d1d05cc6de6ce565207d9a3c86864364f53f006
:test-runner-eftest
{:extra-paths ["test"]
:extra-deps {eftest {:mvn/version "0.5.9"}}
:main-opts ["-e" "(require,'[eftest.runner,:refer,[find-tests,run-tests]]),(run-tests,(find-tests,\"test\"))"]}
;; kaocha - comprehensive test runner for Clojure/Script
;; tests.edn should be created for each project
;; https://github.com/lambdaisland/kaocha
:test-runner-kaocha
{:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.0-612"}}
:main-opts ["-m" "kaocha.runner"]}
;; Linting/ static analysis
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; clj-kondo - comprehensive and fast linter
;; https://github.com/borkdude/clj-kondo/
:lint
{:extra-deps {clj-kondo {:mvn/version "RELEASE"}}
:main-opts ["-m" "clj-kondo.main"]}
;; Eastwood - classic lint tool
;; https://github.com/jonase/eastwood#running-eastwood-in-a-repl
:lint-eastwood
{:main-opts ["-m" "eastwood.lint" {:source-paths ["src"]}]
:extra-deps {jonase/eastwood {:mvn/version "RELEASE"}}}
;; kibit - suggest idiomatic use of Clojure
;; https://github.com/jonase/kibit/issues/221
:idiom-check
{:extra-deps {tvaughan/kibit-runner {:mvn/version "0.2.3"}}
:main-opts ["-m" "kibit-runner.cmdline"]}
;; Dependency version management
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Manage versions for maven and git dependencies
;; https://github.com/Olical/depot
;; Report dependencies that have newer versions available
:outdated
{:extra-deps {olical/depot {:mvn/version "1.8.4"}}
:main-opts ["-m" "depot.outdated.main"]}
;; clj -A:outdated-update
:outdated-update
{:extra-deps {olical/depot {:mvn/version "1.8.4"}}
:main-opts ["-m" "depot.outdated.main"
"--update"]}
;; The classic project for checking maven based dependencies
:outdated-ancient
{:main-opts ["-m" "deps-ancient.deps-ancient"]
:extra-deps {deps-ancient {:mvn/version "RELEASE"}}}
;; Hot loading dependencies
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Add new deps to a running REPL:
;; (require '[clojure.tools.deps.alpha.repl :refer [add-lib]])
;; (add-lib 'domain/library {:mvn/version "RELEASE"})
;; Git deps
;; (require '[clojure.tools.gitlibs :as gitlibs])
;; (defn load-master [lib]
;; (let [git (str "https://github.com/" lib ".git")]
;; (add-lib lib {:git/url git :sha (gitlibs/resolve git "master")})))
;; - e.g., using the GitHub path (not the usual Maven group/artifact):
;; (load-master 'clojure/tools.trace)
:hot-load-deps
{:extra-deps {org.clojure/tools.deps.alpha
{:git/url "https://github.com/clojure/tools.deps.alpha"
:sha "80c1b56e5cbd083193b868cbdc8f87413688c9e9"}}}
;; Visualizing dependencies
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Morpheus - visualize project var relationships
;; https://github.com/benedekfazekas/morpheus
;; Options:
;; -d to specify output directory (this must exist)
;; -f to specify image format, dot (default), png or svg
;; Options are followed by list of paths to analyze.
;; clojure -A:graph-vars -d graphs -f png src test
:graph-vars
{:extra-deps {thomasa/morpheus
{:git/url "https://github.com/benedekfazekas/morpheus.git"
:sha "d3decebc1cb9ef697cd34781f9cf83d44a071e85"}}
:main-opts ["-m" "thomasa.morpheus.main"]}
;; Generate PNG image of dependency graph in directory called `graphs`
;; clojure -A:graph-vars-png
:graph-vars-png
{:extra-deps {thomasa/morpheus
{:git/url "https://github.com/benedekfazekas/morpheus.git"
:sha "d3decebc1cb9ef697cd34781f9cf83d44a071e85"}}
:main-opts ["-m" "thomasa.morpheus.main"
"-d" "graphs" "-f" "png" "src" "test"]}
;; Generate SVG image of dependency graph in directory called `graphs`
;; clojure -A:graph-vars-svg
:graph-vars-svg
{:extra-deps {thomasa/morpheus
{:git/url "https://github.com/benedekfazekas/morpheus.git"
:sha "d3decebc1cb9ef697cd34781f9cf83d44a071e85"}}
:main-opts ["-m" "thomasa.morpheus.main"
"-d" "graphs" "-f" "svg" "src" "test"]}
;; Visualize connections between library dependencies and project namespaces
;; https://github.com/SevereOverfl0w/vizns
;; clj -A:graph-deps navigate # navigable folder of SVGs
;; clj -A:graph-deps # deps-graph.dot file
;; clj -A:graph-deps single -o deps-graph.png -f png # png file
;; clj -A:graph-deps single -o deps-graph.svg -f svg # svg file
;; clj -A:graph-deps single --show # View graph without saving
:graph-deps
{:deps {io.dominic/vizns {:git/url "https://github.com/SevereOverfl0w/vizns.git"
:sha "fb2391a4af24246ac4e46f3a573970ba5b7c92de"}}
:main-opts ["-m" "io.dominic.vizns.core"]}
;; Generate single PNG image of library dependencies
:graph-deps-png
{:deps {io.dominic/vizns {:git/url "https://github.com/SevereOverfl0w/vizns.git"
:sha "fb2391a4af24246ac4e46f3a573970ba5b7c92de"}}
:main-opts ["-m" "io.dominic.vizns.core" "single" "-o" "deps-graph.png" "-f" "png"]}
;; Deployment
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; depstar - build jars, uberjars
;; https://github.com/seancorfield/depstar
;; clojure -A:depstar -m hf.depstar.jar MyLib.jar
;; clojure -A:depstar -m hf.depstar.uberjar MyProject.jar
:build-depstar
{:extra-deps
{seancorfield/depstar {:mvn/version "1.0.94"}}}
;; uberdeps - uberjar builder
;; https://github.com/tonsky/uberdeps
;; "--target" "target/cdeps-0.1.0.jar" in `:main-opts` to specify output file
:build-uberdeps
{:extra-deps {uberdeps {:mvn/version "0.1.10"}}
:main-opts ["-m" "uberdeps.uberjar"]}
;; Performance testing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Benchmarking library for Clojure
;; https://github.com/hugoduncan/criterium/
;; (require '[criterium.core :refer [bench quick-bench]]) ; require criterium
;; (bench (adhoc-expression)) ; timing of a self contained expression
;;
;; (require '[practicalli/namespace-name]) ; require project source code
;; (in-ns 'practicalli/namespace-name)
;; (quick-bench (project-function args))
:benchmark
{:extra-deps {criterium {:mvn/version "0.4.5"}}}
;; - see https://github.com/clojure-goes-fast/clj-memory-meter
;; - (require '[clj-memory-meter.core :as memory-meter])
;; - (memory-meter/measure (your-expression))
:measure
{:extra-deps {com.clojure-goes-fast/clj-memory-meter {:mvn/version "0.1.2"}}}
} ;; End of alias definitions
;; Provider attributes
;; Maven Central and Clojars are the canonical repositories for library dependencies
;; JCenter is large and fast mirror
:mvn/repos {
"central" {:url "https://repo1.maven.org/maven2/"}
"clojars" {:url "https://repo.clojars.org/"}
"jcenter" {:url "https://jcenter.bintray.com"}
}
}