Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filter tests from fileset
(require '[clojure.java.io :as io]
'[boot.core :as c]
'[boot.file :as f])
(defn make-test-manifest
[test-dir]
(->> test-dir
io/file
file-seq
(filter #(.isFile %))
(map #(f/relative-to (io/file test-dir) %))
(map #(.getPath %))))
(c/deftask without-tests
[d test-dir DIR str "Name of test directory"]
(c/with-pre-wrap [fileset]
(let [tests (make-test-manifest (or test-dir "test"))]
(c/commit! (update fileset :tree #(reduce dissoc % tests))))))
(comment
(set-env! :resource-paths #{"src" "test"})
(boot (show :fileset true)
(without-tests "test")
(show :fileset true)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.