1- .PHONY : test quick-test fast-test eastwood cljfmt install fast-install smoketest deploy clean detect_timeout lein-repl repl lint light-kondo docs
1+ .PHONY : test quick-test fast-test eastwood cljfmt install fast-install smoketest deploy clean detect_timeout lein-repl repl lint light-kondo docs test_impl 
22.DEFAULT_GOAL  := quick-test
33
44CLOJURE_VERSION  ?= 1.11
@@ -9,9 +9,26 @@ CLOJURE_VERSION ?= 1.11
99#  Don't use spaces here.
1010LEIN_PROFILES  ?= "+dev,+test"
1111
12+ TEST_PROFILES  ?= "-user,-dev,+test"
13+ 
1214#  The enrich-classpath version to be injected.
1315#  Feel free to upgrade this.
14- ENRICH_CLASSPATH_VERSION ="1.17.1"
16+ ENRICH_CLASSPATH_VERSION ="1.18.0"
17+ 
18+ #  Set bash instead of sh for the @if [[ conditions,
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 
1532
1633test/resources/cider/nrepl/clojuredocs/export.edn :
1734	curl -o $@  https://github.com/clojure-emacs/clojuredocs-export-edn/raw/master/exports/export.compact.edn
@@ -24,12 +41,35 @@ dump-version:
2441	lein with-profile -user,-dev inline-deps
2542	touch $@ 
2643
27- test : clean .inline-deps  test/resources/cider/nrepl/clojuredocs/export.edn
44+ test_impl :  $( TEST_RUNNER_SOURCE_DIR )   test/resources/cider/nrepl/clojuredocs/export.edn
2845	rm -f .no-mranderson
29- 	lein with-profile -user,-dev,+$(CLOJURE_VERSION ) ,+test,+plugin.mranderson/config test 
46+ 	@if [[ " $$ PARSER_TARGET"   ==  " parser-next"   ]] ;  then  \ 
47+ 		export  SKIP_INLINING_TEST_DEPS=true;  \ 
48+ 		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;  \ 
49+ 		cat .test-classpath;  \ 
50+ 		eval  " $$ (cat .test-classpath)" ;  \ 
51+ 		rm .test-classpath;  \ 
52+ 	elif  [[ " $$ PARSER_TARGET"   ==  " parser"   ]] ;  then  \ 
53+ 		export  SKIP_INLINING_TEST_DEPS=true;  \ 
54+ 		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;  \ 
55+ 		cat .test-classpath;  \ 
56+ 		sed $(SED_INPLACE )  ' s/--add-opens=jdk.compiler\/com.sun.tools.javac.code=ALL-UNNAMED//g'   .test-classpath;  \ 
57+ 		sed $(SED_INPLACE )  ' s/--add-opens=jdk.compiler\/com.sun.tools.javac.tree=ALL-UNNAMED//g'   .test-classpath;  \ 
58+ 		cat .test-classpath;  \ 
59+ 		eval  " $$ (cat .test-classpath)" ;  \ 
60+ 		rm .test-classpath;  \ 
61+ 	elif  [[ " $$ PARSER_TARGET"   ==  " legacy-parser"   ]] ;  then  \ 
62+ 		export  SKIP_INLINING_TEST_DEPS=true;  \ 
63+ 		lein with-profile +$(CLOJURE_VERSION ) ,$(TEST_PROFILES )  test ;  \ 
64+ 	else  \ 
65+ 		echo  " PARSER_TARGET unset!" ;  \ 
66+ 		exit  1;  \ 
67+ 	fi 
68+ 
69+ test : clean .inline-deps
70+ 	@make test_impl TEST_PROFILES=" $( TEST_PROFILES)  ,+plugin.mranderson/config" 
3071
31- quick-test : clean
32- 	lein with-profile -user,-dev,+$(CLOJURE_VERSION ) ,+test test 
72+ quick-test : clean test_impl
3373
3474fast-test : quick-test
3575
@@ -81,7 +121,9 @@ fast-install: dump-version check-install-env
81121	make clean
82122	git checkout resources/cider/nrepl/version.edn
83123
84- smoketest : install
124+ smoketest :
125+ 	export  SKIP_INLINING_TEST_DEPS=true
126+ 	make install
85127	cd  test/smoketest &&  \ 
86128        lein with-profile -user,-dev,+$(CLOJURE_VERSION) uberjar && \
87129        java -jar target/smoketest-0.1.0-SNAPSHOT-standalone.jar
@@ -127,6 +169,7 @@ clean:
127169#  Launches a repl, falling back to vanilla lein repl if something went wrong during classpath calculation.
128170lein-repl : .enrich-classpath-lein-repl
129171	@if grep --silent "  -cp "   .enrich-classpath-lein-repl;  then  \ 
172+ 		export  YOURKIT_SESSION_NAME=" $( basename $( PWD) ) " ; 
130173		eval  " $$ (cat .enrich-classpath-lein-repl) --interactive" ;  \ 
131174	else  \ 
132175		echo  " Falling back to lein repl... (you can avoid further falling back by removing .enrich-classpath-lein-repl)" ;  \ 
0 commit comments