Created
August 17, 2016 14:17
-
-
Save alandipert/2ef0a4b3708e96c11432f09ea7584e8e to your computer and use it in GitHub Desktop.
Filter tests from fileset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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