|
151 | 151 | :removals (str removals)
|
152 | 152 | :additions (str additions)]))
|
153 | 153 |
|
| 154 | +;; |
| 155 | +;; Generic patch for deps.edn rewrite-clj v1 projects |
| 156 | +;; |
| 157 | +(defn deps-edn-v1-patch [{:keys [home-dir rewrite-clj-version]}] |
| 158 | + (patch-deps {:filename (str (fs/file home-dir "deps.edn")) |
| 159 | + :removals #{'rewrite-clj 'rewrite-clj/rewrite-clj} |
| 160 | + :additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}}) |
| 161 | + (patch-rewrite-cljc-sources home-dir)) |
| 162 | + |
154 | 163 | ;;
|
155 | 164 | ;; antq
|
156 | 165 | ;;
|
|
223 | 232 | "[$1 :exclusions [rewrite-clj rewrite-cljs]]")
|
224 | 233 | (->> (spit p)))))
|
225 | 234 |
|
226 |
| -;; |
227 |
| -;; rewrite-edn |
228 |
| -;; |
229 |
| -;; |
230 |
| -(defn rewrite-edn-patch [{:keys [home-dir rewrite-clj-version]}] |
231 |
| - (patch-deps {:filename (str (fs/file home-dir "deps.edn")) |
232 |
| - :removals #{'lread/rewrite-cljc} |
233 |
| - :additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}}) |
234 |
| - (patch-rewrite-cljc-sources home-dir)) |
235 |
| - |
236 |
| -;; |
237 |
| -;; update-leiningen-dependencies-skill |
238 |
| -;; |
239 |
| - |
240 |
| -(defn- update-leiningen-dependencies-skill-patch [{:keys [home-dir rewrite-clj-version]}] |
241 |
| - (patch-deps {:filename (str (fs/file home-dir "deps.edn")) |
242 |
| - :removals #{'rewrite-cljs} |
243 |
| - :additions {'rewrite-clj/rewrite-clj {:mvn/version rewrite-clj-version}}})) |
244 |
| - |
245 |
| -(defn- update-leiningen-dependencies-skill-prep [{:keys [home-dir]}] |
246 |
| - (status/line :detail "=> Installing node deps") |
247 |
| - (shcmd ["npm" "ci"] {:dir home-dir}) |
248 |
| - (status/line :detail "=> Running tests as recommended, but this cmd always exits with 0, so consider this a prep step") |
249 |
| - (shcmd ["npm" "run" "test"] {:dir home-dir})) |
250 |
| - |
251 | 235 | ;;
|
252 | 236 | ;; zprint
|
253 | 237 | ;;
|
|
296 | 280 | ;;
|
297 | 281 |
|
298 | 282 | (def libs [{:name "antq"
|
299 |
| - :version "0.11.2" |
| 283 | + :version "0.12.0" |
300 | 284 | :platforms [:clj]
|
301 | 285 | :github-release {:repo "liquidz/antq"}
|
302 |
| - :patch-fn antq-patch |
| 286 | + :patch-fn deps-edn-v1-patch |
303 | 287 | :show-deps-fn cli-deps-tree
|
304 | 288 | :test-cmds [["clojure" "-M:dev:test"]]}
|
305 | 289 | {:name "carve"
|
|
322 | 306 | {:name "clojure-lsp"
|
323 | 307 | :platforms [:clj]
|
324 | 308 | :version "2021.03.06-17.05.35"
|
325 |
| - :github-release {:repo "clojure-lsp/clojure-lsp" } |
| 309 | + :github-release {:repo "clojure-lsp/clojure-lsp"} |
326 | 310 | :patch-fn clojure-lsp-patch
|
327 | 311 | :show-deps-fn lein-deps-tree
|
328 | 312 | :test-cmds [["lein" "test"]]}
|
|
335 | 319 | :patch-fn mranderson-patch
|
336 | 320 | :show-deps-fn lein-deps-tree
|
337 | 321 | :test-cmds [["lein" "test"]]}
|
338 |
| - {:name "rewrite-edn" |
339 |
| - :version "665f61cf273c79b44baacb0897d72c2157e27b09" |
| 322 | + {;; has a release on clojars but no release in GitHub repo |
| 323 | + :name "rewrite-edn" |
| 324 | + :version "8f75cf124984c6c4494df93ce10359de8beb588d" |
340 | 325 | :platforms [:clj]
|
341 | 326 | :github-release {:repo "borkdude/rewrite-edn"
|
342 | 327 | :via :sha}
|
343 |
| - :patch-fn rewrite-edn-patch |
| 328 | + :patch-fn deps-edn-v1-patch |
344 | 329 | :show-deps-fn cli-deps-tree
|
345 | 330 | :test-cmds [["clojure" "-M:test"]]}
|
346 | 331 | {:name "refactor-nrepl"
|
|
353 | 338 | :show-deps-fn lein-deps-tree
|
354 | 339 | :prep-fn refactor-nrepl-prep
|
355 | 340 | :test-cmds [["lein" "with-profile" "+1.10,+plugin.mranderson/config" "test"]]}
|
356 |
| - {:name "update-leiningen-dependencies-skill" |
357 |
| - :version "21c7ce794c83d6eed9c2a27e2fdd527b5da8ebb3" |
358 |
| - :platforms [:cljs] |
359 |
| - :github-release {:repo "atomist-skills/update-leiningen-dependencies-skill" |
360 |
| - :via :sha} |
361 |
| - :patch-fn update-leiningen-dependencies-skill-patch |
362 |
| - :prep-fn update-leiningen-dependencies-skill-prep |
| 341 | + {:name "test-doc-blocks" |
| 342 | + :version "1.0.114-alpha" |
| 343 | + :platforms [:clj :cljs] |
| 344 | + :note "generates tests under clj, but can also be run under cljs" |
| 345 | + :github-release {:repo "lread/test-doc-blocks" |
| 346 | + :version-prefix "v"} |
| 347 | + :patch-fn deps-edn-v1-patch |
363 | 348 | :show-deps-fn cli-deps-tree
|
364 |
| - :test-cmds [;; running tests a 2nd time via node to get non-zero exit code on failure |
365 |
| - ["node" "tests.js"]]} |
| 349 | + :test-cmds [["bb" "./script/ci_tests.clj"]]} |
366 | 350 | {:name "zprint"
|
367 | 351 | :version "1.1.1"
|
368 | 352 | :platforms [:clj :cljs]
|
369 | 353 | :note "zprint src hacked to pass with rewrite-clj v1"
|
370 | 354 | :github-release {:repo "kkinnear/zprint"}
|
371 | 355 | :patch-fn zprint-patch
|
372 | 356 | :prep-fn zprint-prep
|
373 |
| - :show-deps-fn (fn [lib] |
374 |
| - (status/line :detail "=> Deps for Clojure run:") |
375 |
| - (lein-deps-tree lib) |
376 |
| - (status/line :detail "=> Deps Clojurescript run:") |
377 |
| - (cli-deps-tree lib)) |
| 357 | + :show-deps-fn (fn [lib] |
| 358 | + (status/line :detail "=> Deps for Clojure run:") |
| 359 | + (lein-deps-tree lib) |
| 360 | + (status/line :detail "=> Deps Clojurescript run:") |
| 361 | + (cli-deps-tree lib)) |
378 | 362 | :test-cmds [["lein" "with-profile" "expectations" "test"]
|
379 | 363 | ["clojure" "-M:cljs-runner"]]}])
|
380 | 364 |
|
|
436 | 420 | (-> (doric/table [:name :version :available-version] outdated-libs) println)
|
437 | 421 | (status/line :detail "=> All libs seems up to date"))))
|
438 | 422 |
|
| 423 | +(defn- print-results [results] |
| 424 | + (status/line :info "Summary") |
| 425 | + (println (doric/table [:name :version :platforms :exit-codes] results)) |
| 426 | + (when (seq (filter :note results)) |
| 427 | + (status/line :detail "Notes") |
| 428 | + (println (doric/table [:name :note] (filter :note results))))) |
| 429 | + |
439 | 430 | (defn run-tests [requested-libs]
|
440 | 431 | (status/line :info "Testing 3rd party libs")
|
441 | 432 | (status/line :detail "Test popular 3rd party libs against current rewrite-clj.")
|
|
448 | 439 | :target-root-dir target-root-dir
|
449 | 440 | :rewrite-clj-version rewrite-clj-version))
|
450 | 441 | requested-libs))]
|
451 |
| - (status/line :info "Summary") |
452 |
| - (println (doric/table [:name :version :platforms :note :exit-codes] results)) |
| 442 | + (print-results results) |
453 | 443 | (System/exit (if (->> results
|
454 | 444 | (map :exit-codes)
|
455 | 445 | flatten
|
@@ -489,28 +479,3 @@ Specifying no lib-names selects all libraries.")
|
489 | 479 | (status/fatal docopt-usage)))
|
490 | 480 |
|
491 | 481 | (main *command-line-args*)
|
492 |
| - |
493 |
| - |
494 |
| -#_(-> (curl/get "https://api.github.com/repos/borkdude/rewrite-edn/releases") |
495 |
| - :body |
496 |
| - (json/parse-string true) |
497 |
| - #_#_first |
498 |
| - :tag_name) |
499 |
| - |
500 |
| -#_(-> (curl/get "https://api.github.com/repos/borkdude/rewrite-edn/git/refs/heads/master") |
501 |
| - :body |
502 |
| - (json/parse-string true) |
503 |
| - :object |
504 |
| - :sha) |
505 |
| - |
506 |
| -#_(-> (curl/get "https://api.github.com/repos/weavejester/cljfmt/tags") |
507 |
| - :body |
508 |
| - (json/parse-string true) |
509 |
| - first) |
510 |
| - |
511 |
| -#_(get-current-version (nth libs 5)) |
512 |
| - |
513 |
| - |
514 |
| -#_(docopt/docopt docopt-usage |
515 |
| - *command-line-args* |
516 |
| - (fn [arg-map] arg-map)) |
0 commit comments