Skip to content

Commit 2fcc007

Browse files
committed
dev: libs tests takes advantage of bb 0.3.2
Babashka 0.3.2 now has built in support for rewrite-clj! We take advantage of this in libs_tests.clj.
1 parent 0266584 commit 2fcc007

File tree

4 files changed

+11
-23
lines changed

4 files changed

+11
-23
lines changed

deps.edn

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696

9797
;;
9898
;; Deployment
99-
;;
99+
;;
100100
:jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.0.206"}}
101101
:exec-fn hf.depstar/jar
102102
:exec-args {:jar "target/rewrite-clj.jar"
@@ -119,12 +119,5 @@
119119
:outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "0.12.2"}
120120
org.slf4j/slf4j-simple {:mvn/version "1.7.30"} ;; to rid ourselves of logger warnings
121121
}
122-
:main-opts ["-m" "antq.core"]}
123-
124-
;;
125-
;; 3rd party lib testing support
126-
;;
127-
128-
:deps-patcher {:extra-paths ["script"]
129-
:ns-default lread.deps-patcher}}}
122+
:main-opts ["-m" "antq.core"]}}}
130123

doc/02-developer-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ On Windows we only test against JDK11 as tool setup for JDK8 on Windows seemed o
2121
* NodeJs v12 or above
2222
* Clojure v1.10.1.697 or above for `clojure` command
2323
** Note that rewrite-clj v1 itself supports Clojure v1.9 and above
24-
* Babashka v0.3.1 or above
24+
* Babashka v0.3.2 or above
2525
* GraalVM v21.0.0 (if you want to run GraalVM native image tests)
2626

2727
=== Windows Notes

script/lread/deps_patcher.clj renamed to script/helper/deps_patcher.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
;; Called with clojure in support of libs tests
2-
(ns lread.deps-patcher
1+
(ns helper.deps-patcher
32
"Quick and dirty little project.clj and deps.edn patcher"
43
(:require [rewrite-clj.zip :as z]))
54

script/libs_tests.clj

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
[docopt.core :as docopt]
1111
[docopt.match :as docopt-match]
1212
[doric.core :as doric]
13+
[helper.deps-patcher :as deps-patcher]
1314
[helper.env :as env]
1415
[helper.shell :as shell]
1516
[helper.status :as status]
@@ -131,24 +132,19 @@
131132
(spit f new-content))))
132133
(fs/glob home-dir "**/*.{clj,cljc,cljs}"))))
133134

134-
(defn- patch-deps [{:keys [filename removals additions]}]
135+
(defn- patch-deps [{:keys [filename] :as opts}]
135136
(status/line :detail (format "=> Patching deps in: %s" filename))
136-
(shcmd ["clojure" "-X:deps-patcher"
137-
(if (string/ends-with? filename "deps.edn")
138-
"update-deps-deps"
139-
"update-project-deps")
140-
:filename (pr-str filename)
141-
:removals (str removals)
142-
:additions (str additions)]))
137+
(if (string/ends-with? filename "deps.edn")
138+
(deps-patcher/update-deps-deps opts)
139+
(deps-patcher/update-project-deps opts)))
143140

144141
;;
145-
;; Generic patch for deps.edn rewrite-clj v1 projects
142+
;; Generic patch for deps.edn rewrite-clj v1 projects to v1 current
146143
;;
147144
(defn deps-edn-v1-patch [{:keys [home-dir rewrite-clj-version]}]
148145
(patch-deps {:filename (str (fs/file home-dir "deps.edn"))
149146
:removals #{'rewrite-clj 'rewrite-clj/rewrite-clj}
150-
:additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}})
151-
(patch-rewrite-cljc-sources home-dir))
147+
:additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}}))
152148

153149
(defn- replace-in-file [fname match replacement]
154150
(let [orig-filename (str fname ".orig")

0 commit comments

Comments
 (0)