Skip to content

Commit 1b18386

Browse files
committed
Upgrade development setup
1 parent 13c043e commit 1b18386

File tree

3 files changed

+55
-9
lines changed

3 files changed

+55
-9
lines changed

Diff for: Makefile

+43-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
1-
.PHONY: test deploy clean
2-
1+
.PHONY: test kondo eastwood cljfmt lint deploy clean repl lein-repl
32
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
440

541
clean:
642
lein clean
@@ -15,11 +51,14 @@ cljfmt-fix:
1551
lein with-profile -user,+$(VERSION),+test,+cljfmt cljfmt fix
1652

1753
eastwood:
18-
lein with-profile -user,+$(VERSION),+test,+deploy,+eastwood eastwood
54+
lein with-profile -user,-dev,+$(VERSION),+test,+deploy,+eastwood eastwood
1955

2056
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
2260

61+
lint: kondo cljfmt eastwood
2362

2463
# Deployment is performed via CI by creating a git tag prefixed with "v".
2564
# Please do not deploy locally as it skips various measures.

Diff for: README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ the `+*cider-log*+` buffer. Additionally a log consumer will be
6161
attached to the appender to receive log events matching the search
6262
criteria after the search command has been issued. The log appender
6363
will be removed automatically once a new search has been submitted or
64-
when the `+*cider-log*+` buffer gets killed.
64+
when the `*cider-log*` buffer gets killed.
6565

6666
### Log Filters
6767

@@ -109,6 +109,10 @@ like:
109109

110110
## Development
111111

112+
#### Makefile
113+
114+
The Makefile offers a variety of tasks: `test kondo eastwood cljfmt lint clean repl`.
115+
112116
#### Deployment
113117

114118
Here's how to deploy to Clojars:
@@ -128,6 +132,6 @@ on his private development tooling.
128132

129133
## License
130134

131-
Copyright © 2023 CIDER Contributors
135+
Copyright © 2023-2024 CIDER Contributors
132136

133137
Distributed under the Eclipse Public License, the same as Clojure.

Diff for: project.clj

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; whenever we perform a deployment.
33
(defproject mx.cider/logjam (or (not-empty (System/getenv "PROJECT_VERSION"))
44
"0.0.0")
5-
:description ""
5+
:description "An interactive, nrepl-oriented logging backend"
66
:url "https://github.com/clojure-emacs/logjam"
77
:license {:name "Eclipse Public License"
88
:url "https://www.eclipse.org/legal/epl-v10.html"}
@@ -19,6 +19,9 @@
1919
[ch.qos.logback/logback-classic "1.3.7"]
2020
[org.clojure/clojure "1.11.1"]]}
2121

22+
:dev {:plugins [[cider/cider-nrepl "0.44.0"]
23+
[refactor-nrepl "3.9.0"]]}
24+
2225
:1.9 {:dependencies [[org.clojure/clojure "1.9.0"]]}
2326

2427
:1.10 {:dependencies [[org.clojure/clojure "1.10.3"]]}
@@ -36,9 +39,9 @@
3639

3740
:cljfmt {:plugins [[lein-cljfmt "0.9.2" :exclusions [org.clojure/clojure
3841
org.clojure/clojurescript]]]}
39-
:eastwood {:plugins [[jonase/eastwood "1.4.0"]]
42+
:eastwood {:plugins [[jonase/eastwood "1.4.2"]]
4043
:eastwood {:add-linters [:performance :boxed-math]
4144
:config-files ["eastwood.clj"]}}
42-
:clj-kondo {:dependencies [[clj-kondo "2023.05.26"]
45+
:clj-kondo {:dependencies [[clj-kondo "2023.12.15"]
4346
[com.fasterxml.jackson.core/jackson-core "2.14.2"]]}
4447
:deploy {:source-paths [".circleci/deploy"]}})

0 commit comments

Comments
 (0)