|
142 | 142 |
|
143 | 143 | (defn- project-clj-v1-patch [{:keys [home-dir rewrite-clj-version]}]
|
144 | 144 | (patch-deps {:filename (str (fs/file home-dir "project.clj"))
|
145 |
| - :removals #{'rewrite-clj} |
146 |
| - :additions [['rewrite-clj rewrite-clj-version]]})) |
| 145 | + :removals #{'rewrite-clj 'rewrite-clj/rewrite-clj} |
| 146 | + :additions [['rewrite-clj/rewrite-clj rewrite-clj-version]]})) |
147 | 147 |
|
148 | 148 | (defn- replace-in-file [fname match replacement]
|
149 | 149 | (let [orig-filename (str fname ".orig")
|
|
252 | 252 | ;; zprint
|
253 | 253 | ;;
|
254 | 254 |
|
255 |
| -(defn- zprint-patch [{:keys [home-dir rewrite-clj-version]}] |
256 |
| - (patch-deps {:filename (str (fs/file home-dir "project.clj")) |
257 |
| - :removals #{'rewrite-clj 'rewrite-cljs} |
258 |
| - :additions [['rewrite-clj rewrite-clj-version]]}) |
259 |
| - |
260 |
| - (status/line :detail "=> Hacking lift-ns to compensate for rewrite-clj v0->v1 change in sexpr on nsmap keys") |
261 |
| - (status/line :detail "- note the word 'hacking' - hacked for to get test passing only") |
262 |
| - (let [src-filename (str (fs/file home-dir "src/zprint/zutil.cljc")) |
263 |
| - orig-filename (str src-filename ".orig") |
264 |
| - content (slurp src-filename) |
265 |
| - find-str "(namespace (z/sexpr k))" |
266 |
| - replace-str "(namespace (keyword (z/string k)))"] |
267 |
| - (fs/copy src-filename orig-filename) |
268 |
| - (status/line :detail "- hacking %s" src-filename) |
269 |
| - (if-let [ndx (string/last-index-of content find-str)] |
270 |
| - (spit src-filename |
271 |
| - (str (subs content 0 ndx) |
272 |
| - replace-str |
273 |
| - (subs content (+ ndx (count find-str))))) |
274 |
| - (throw (ex-info "hacking zprint failed" {}))))) |
275 |
| - |
276 |
| -(defn- zprint-prep [{:keys [target-root-dir home-dir]}] |
277 |
| - (status/line :detail "=> Installing not-yet-released expectations/cljc-test") |
278 |
| - (let [clone-to-dir (str (fs/file target-root-dir "clojure-test"))] |
279 |
| - (shcmd "git" "clone" "--branch" "enhancements" |
280 |
| - "https://github.com/kkinnear/clojure-test.git" clone-to-dir) |
281 |
| - (run! #(shcmd {:dir clone-to-dir} %) |
282 |
| - ["git reset --hard a6c3be067ab06f677d3b1703ee4092d25db2bb60" |
283 |
| - "clojure -M:jar" |
284 |
| - "mvn install:install-file -Dfile=expectations.jar -DpomFile=pom.xml"])) |
| 255 | +(defn- zprint-patch [lib] |
| 256 | + ;; zprint has a project.clj and a deps.edn, patch 'em both |
| 257 | + (deps-edn-v1-patch lib) |
| 258 | + (project-clj-v1-patch lib)) |
285 | 259 |
|
| 260 | +(defn- zprint-prep [{:keys [home-dir]}] |
286 | 261 | (status/line :detail "=> Building uberjar for uberjar tests")
|
287 | 262 | (shcmd {:dir home-dir} "lein uberjar")
|
288 | 263 |
|
| 264 | + ;; not sure if this is still necessary, but probably does not hurt(?) |
289 | 265 | (status/line :detail "=> Installing zprint locally for ClojureScript tests")
|
290 | 266 | (shcmd {:dir home-dir} "lein install"))
|
291 | 267 |
|
|
422 | 398 | :show-deps-fn lein-deps-tree
|
423 | 399 | :test-cmds ["lein test"]}
|
424 | 400 | {:name "zprint"
|
425 |
| - :version "1.1.1" |
| 401 | + :version "1.2.0" |
426 | 402 | :platforms [:clj :cljs]
|
427 |
| - :note "1 minor hack to pass with rewrite-clj v1, skip version 1.1.2 release, skip 1.2.0-alpha1 tag" |
428 | 403 | :github-release {:repo "kkinnear/zprint"}
|
429 | 404 | :patch-fn zprint-patch
|
430 | 405 | :prep-fn zprint-prep
|
|
0 commit comments