Skip to content

Instantly share code, notes, and snippets.

@alandipert
Created August 17, 2016 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alandipert/2ef0a4b3708e96c11432f09ea7584e8e to your computer and use it in GitHub Desktop.
Save alandipert/2ef0a4b3708e96c11432f09ea7584e8e to your computer and use it in GitHub Desktop.
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