1
- .PHONY : test quick-test fast-test eastwood cljfmt cljfmt-fix install fast-install smoketest deploy clean detect_timeout lein-repl repl lint light-kondo docs test_impl
1
+ .PHONY : test quick-test eastwood cljfmt cljfmt-fix install fast-install smoketest deploy clean detect_timeout lein-repl repl lint light-kondo docs test_impl
2
2
.DEFAULT_GOAL := quick-test
3
3
4
4
CLOJURE_VERSION ?= 1.11
@@ -17,63 +17,42 @@ ENRICH_CLASSPATH_VERSION="1.18.2"
17
17
18
18
# Set bash instead of sh for the @if [[ conditions,
19
19
# and use the usual safety flags:
20
- SHELL = /bin/bash -Eeu
21
-
22
- ifeq ($(OS ) ,Darwin) # macOS
23
- SED_INPLACE = -i ''
24
- else
25
- SED_INPLACE = -i
26
- endif
27
-
28
- TEST_RUNNER_SOURCE_DIR = test-runner
29
-
30
- $(TEST_RUNNER_SOURCE_DIR ) :
31
- @if [ ! -d " $( TEST_RUNNER_SOURCE_DIR) " ]; then git clone https://github.com/cognitect-labs/test-runner.git $(TEST_RUNNER_SOURCE_DIR ) --depth=1; fi
20
+ SHELL = /bin/bash -Ee
21
+
22
+ # We need Java sources to test Java parsing functionality, but the Docker images
23
+ # we use on CircleCI doesn't include src.zip. So we have to download them from
24
+ # Github and repackage in a form that is resemblant to src.zip from normal
25
+ # distributions.
26
+ base-src.zip :
27
+ wget https://github.com/adoptium/jdk21u/archive/refs/tags/jdk-21.0.5+3.zip -O full-src.zip
28
+ unzip -q full-src.zip
29
+ cp -r jdk21u-* /src/java.base/share/classes java.base
30
+ cp -r jdk21u-* /src/java.desktop/share/classes java.desktop
31
+ zip -qr base-src.zip java.base java.desktop
32
+ rm -rf java.base java.desktop jdk21u-* full-src.zip
32
33
33
34
test/resources/cider/nrepl/clojuredocs/export.edn :
34
35
curl -o $@ https://github.com/clojure-emacs/clojuredocs-export-edn/raw/master/exports/export.compact.edn
35
36
36
37
dump-version :
37
38
echo ' "$(PROJECT_VERSION)"' > resources/cider/nrepl/version.edn
38
39
39
- .inline-deps : project.clj clean
40
- rm -f .no-mranderson
40
+ target/srcdeps : project.clj
41
41
lein with-profile -user,-dev inline-deps
42
42
# Remove cljfmt.main because it depends on tools.cli which we explicitly removed.
43
43
rm -f target/srcdeps/cider/nrepl/inlined/deps/cljfmt/*/cljfmt/main.clj
44
- touch $@
45
44
46
- test_impl : $(TEST_RUNNER_SOURCE_DIR ) test/resources/cider/nrepl/clojuredocs/export.edn
47
- rm -f .no-mranderson
45
+ test_impl : test/resources/cider/nrepl/clojuredocs/export.edn base-src.zip
48
46
@if [[ " $$ PARSER_TARGET" == " parser-next" ]] ; then \
49
- export SKIP_INLINING_TEST_DEPS=true; \
50
- bash ' lein' ' update-in' ' :plugins' ' conj' " [mx.cider/lein-enrich-classpath \" $( ENRICH_CLASSPATH_VERSION) \" ]" ' --' ' with-profile' $(TEST_PROFILES ) ,+cognitest,+$(CLOJURE_VERSION ) ' update-in' ' :middleware' ' conj' ' cider.enrich-classpath.plugin-v2/middleware' ' --' ' repl' | grep " -cp " > .test-classpath; \
51
- cat .test-classpath; \
52
- eval " $$ (cat .test-classpath)" ; \
53
- rm .test-classpath; \
54
- elif [[ " $$ PARSER_TARGET" == " parser" ]] ; then \
55
- export SKIP_INLINING_TEST_DEPS=true; \
56
- bash ' lein' ' update-in' ' :plugins' ' conj' " [mx.cider/lein-enrich-classpath \" $( ENRICH_CLASSPATH_VERSION) \" ]" ' --' ' with-profile' $(TEST_PROFILES ) ,+cognitest,+$(CLOJURE_VERSION ) ' update-in' ' :middleware' ' conj' ' cider.enrich-classpath.plugin-v2/middleware' ' --' ' repl' | grep " -cp " > .test-classpath; \
57
- cat .test-classpath; \
58
- sed $(SED_INPLACE ) ' s/--add-opens=jdk.compiler\/com.sun.tools.javac.code=ALL-UNNAMED//g' .test-classpath; \
59
- sed $(SED_INPLACE ) ' s/--add-opens=jdk.compiler\/com.sun.tools.javac.tree=ALL-UNNAMED//g' .test-classpath; \
60
- cat .test-classpath; \
61
- eval " $$ (cat .test-classpath)" ; \
62
- rm .test-classpath; \
63
- elif [[ " $$ PARSER_TARGET" == " legacy-parser" ]] ; then \
64
- export SKIP_INLINING_TEST_DEPS=true; \
65
- lein with-profile +$(CLOJURE_VERSION ) ,$(TEST_PROFILES ) test ; \
47
+ lein with-profile $(TEST_PROFILES ) ,+$(CLOJURE_VERSION ) ,+parser-next test ; \
66
48
else \
67
- echo " PARSER_TARGET unset!" ; \
68
- exit 1; \
49
+ lein with-profile $(TEST_PROFILES ) ,+$(CLOJURE_VERSION ) test ; \
69
50
fi
70
51
71
- test : clean .inline-deps
52
+ test : target/srcdeps
72
53
@make test_impl TEST_PROFILES=" $( TEST_PROFILES) ,+plugin.mranderson/config"
73
54
74
- quick-test : clean test_impl
75
-
76
- fast-test : quick-test
55
+ quick-test : test_impl
77
56
78
57
eastwood :
79
58
lein with-profile -user,-dev,+$(CLOJURE_VERSION ) ,+deploy,+eastwood eastwood
@@ -85,47 +64,28 @@ cljfmt-fix:
85
64
lein with-profile -user,-dev,+$(CLOJURE_VERSION ) ,+cljfmt cljfmt fix
86
65
87
66
.make_kondo_prep : project.clj .clj-kondo/config.edn
88
- touch .no-pedantic
89
- touch .no-mranderson
90
- lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION ) clj-kondo --copy-configs --dependencies --lint ' $$classpath' > $@
91
- rm -f .no-pedantic
92
- rm -f .no-mranderson
67
+ CIDER_NO_MRANDERSON=" true" CIDER_NO_PEDANTIC=" true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION ) clj-kondo --copy-configs --dependencies --lint ' $$classpath' > $@
93
68
94
69
kondo : .make_kondo_prep clean
95
- touch .no-pedantic
96
- touch .no-mranderson
97
- lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION ) clj-kondo
98
- rm -f .no-pedantic
99
- rm -f .no-mranderson
70
+ CIDER_NO_MRANDERSON=" true" CIDER_NO_PEDANTIC=" true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION ) clj-kondo
100
71
101
72
# A variation that does not analyze the classpath, as it OOMs otherwise on CircleCI.
102
73
light-kondo : clean
103
- touch .no-pedantic
104
- touch .no-mranderson
105
- lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION ) clj-kondo
106
- rm -f .no-pedantic
107
- rm -f .no-mranderson
74
+ CIDER_NO_MRANDERSON=" true" CIDER_NO_PEDANTIC=" true" lein with-profile -user,-dev,+test,+clj-kondo,+deploy,+$(CLOJURE_VERSION ) clj-kondo
108
75
109
76
lint : kondo cljfmt eastwood
110
77
111
- # PROJECT_VERSION=0.49.3 make install
112
- install : dump-version check-install-env .inline-deps
113
- rm -f .no-mranderson
114
- touch .no-pedantic
115
- lein with-profile -user,-dev,+$(CLOJURE_VERSION ) ,+plugin.mranderson/config install
116
- touch .no-pedantic
117
- make clean
78
+ # PROJECT_VERSION=x.y.z make install
79
+ install : dump-version check-install-env target/srcdeps
80
+ CIDER_NO_PEDANTIC=" true" lein with-profile -user,-dev,+$(CLOJURE_VERSION ) ,+plugin.mranderson/config install
118
81
git checkout resources/cider/nrepl/version.edn
119
82
120
- # PROJECT_VERSION=0.49.3 make fast-install
83
+ # PROJECT_VERSION=x.y.z make fast-install
121
84
fast-install : dump-version check-install-env
122
85
lein with-profile -user,-dev,+$(CLOJURE_VERSION ) install
123
- make clean
124
86
git checkout resources/cider/nrepl/version.edn
125
87
126
- smoketest :
127
- export SKIP_INLINING_TEST_DEPS=true
128
- make install
88
+ smoketest : install
129
89
cd test/smoketest && \
130
90
lein with-profile -user,-dev,+$(CLOJURE_VERSION) uberjar && \
131
91
java -jar target/smoketest-0.1.0-SNAPSHOT-standalone.jar
@@ -138,7 +98,7 @@ detect_timeout:
138
98
139
99
# Deployment is performed via CI by creating a git tag prefixed with "v".
140
100
# Please do not deploy locally as it skips various measures (particularly around mranderson).
141
- deploy : check-env .inline-deps
101
+ deploy : check-env target/srcdeps
142
102
rm -f .no-mranderson
143
103
lein with-profile -user,+$(CLOJURE_VERSION ) ,+plugin.mranderson/config deploy clojars
144
104
@@ -161,7 +121,6 @@ endif
161
121
clean :
162
122
lein with-profile -user clean
163
123
cd test/smoketest && lein with-profile -user clean
164
- rm -f .inline-deps
165
124
166
125
# Create and cache a `java` command. project.clj is mandatory; the others are optional but are taken into account for cache recomputation.
167
126
# It's important not to silence with step with @ syntax, so that Enrich progress can be seen as it resolves dependencies.
0 commit comments