1
- .PHONY : test deploy clean
2
-
1
+ .PHONY : test kondo eastwood cljfmt lint deploy clean repl lein-repl
3
2
VERSION ?= 1.11
3
+ HOME =$(shell echo $$HOME)
4
+ HERE =$(shell echo $$PWD)
5
+
6
+ # This makefile offers high-performance (cached) wrappers that enrich the classpath, for optimal IDE functioning.
7
+ # We suggest that you copy/merge this file into your project.
8
+ # We believe it's best to give you something that you can freely understand and hack locally.
9
+ # The tradeoff is that you may have to catch up with important fixes/improvements to this Makefile, if any.
10
+ # Feel free to suggest any improvements at:
11
+ # https://github.com/clojure-emacs/enrich-classpath/issues
12
+
13
+ # Set bash instead of sh for the @if [[ conditions,
14
+ # and use the usual safety flags:
15
+ SHELL = /bin/bash -Eeu
16
+
17
+ # The Lein profiles that will be selected for `lein-repl`.
18
+ # Feel free to upgrade this, or to override it with an env var named LEIN_PROFILES.
19
+ # Expected format: "+dev,+test"
20
+ # Don't use spaces here.
21
+ LEIN_PROFILES ?= "+dev,+test"
22
+
23
+ # The enrich-classpath version to be injected.
24
+ # Feel free to upgrade this.
25
+ ENRICH_CLASSPATH_VERSION ="1.19.0"
26
+
27
+ # Create and cache a `java` command. project.clj is mandatory; the others are optional but are taken into account for cache recomputation.
28
+ # It's important not to silence with step with @ syntax, so that Enrich progress can be seen as it resolves dependencies.
29
+ .enrich-classpath-lein-repl : Makefile project.clj $(wildcard checkouts/* /project.clj) $(wildcard deps.edn) $(wildcard $(HOME ) /.clojure/deps.edn) $(wildcard profiles.clj) $(wildcard $(HOME ) /.lein/profiles.clj) $(wildcard $(HOME ) /.lein/profiles.d) $(wildcard /etc/leiningen/profiles.clj)
30
+ bash ' lein' ' update-in' ' :plugins' ' conj' " [mx.cider/lein-enrich-classpath \" $( ENRICH_CLASSPATH_VERSION) \" ]" ' --' ' with-profile' $(LEIN_PROFILES ) ' update-in' ' :middleware' ' conj' ' cider.enrich-classpath.plugin-v2/middleware' ' --' ' repl' | grep " -cp " > $@
31
+
32
+ # Launches a repl, falling back to vanilla lein repl if something went wrong during classpath calculation.
33
+ lein-repl : .enrich-classpath-lein-repl
34
+ @if grep --silent " -cp " .enrich-classpath-lein-repl; then \
35
+ eval " $$ (cat .enrich-classpath-lein-repl) --interactive" ; \
36
+ else \
37
+ echo " Falling back to lein repl... (you can avoid further falling back by removing .enrich-classpath-lein-repl)" ; \
38
+ lein with-profiles $(LEIN_PROFILES ) repl; \
39
+ fi
4
40
5
41
clean :
6
42
lein clean
@@ -15,11 +51,14 @@ cljfmt-fix:
15
51
lein with-profile -user,+$(VERSION ) ,+test,+cljfmt cljfmt fix
16
52
17
53
eastwood :
18
- lein with-profile -user,+$(VERSION ) ,+test,+deploy,+eastwood eastwood
54
+ lein with-profile -user,-dev, +$(VERSION ) ,+test,+deploy,+eastwood eastwood
19
55
20
56
kondo :
21
- lein with-profile -dev,+$(VERSION ) ,+test,+clj-kondo run -m clj-kondo.main --lint src test .circleci/deploy
57
+ lein with-profile -dev,-dev,+$(VERSION ) ,+test,+clj-kondo run -m clj-kondo.main --lint src test .circleci/deploy
58
+
59
+ repl : lein-repl
22
60
61
+ lint : kondo cljfmt eastwood
23
62
24
63
# Deployment is performed via CI by creating a git tag prefixed with "v".
25
64
# Please do not deploy locally as it skips various measures.
0 commit comments