Created
November 20, 2014 20:09
-
-
Save micha/a4f5ac429b867b725224 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (set-env! | |
| :resource-paths #{"src"} | |
| :dependencies '[[tailrecursion/warp "0.1.0"]]) | |
| (require | |
| '[clojure.java.io :as io]) | |
| (deftask mytask | |
| "My demo task." | |
| [] | |
| (let [tmpdir (temp-dir!)] | |
| (fn [next-task] | |
| (fn [fileset] | |
| (let [src-files (input-files fileset) | |
| to-delete (atom [])] | |
| (doseq [tf src-files] | |
| (let [path (tmppath tf) | |
| in-file (tmpfile tf) | |
| out-file (io/file tmpdir (str path ".uc"))] | |
| (when (.endsWith path ".lc") | |
| (swap! to-delete conj tf) | |
| (io/make-parents out-file) | |
| (spit out-file (.toUpperCase (slurp in-file)))))) | |
| (-> fileset | |
| (rm! @to-delete) | |
| (add-resource! tmpdir) | |
| commit! | |
| next-task)))))) | |
| (deftask mytask2 | |
| "My demo other task." | |
| [] | |
| (let [server (delay :start-server-or-something)] | |
| (fn [next-task] | |
| (fn [fileset] | |
| @server | |
| (next-task fileset))))) | |
| (deftask mytask3 | |
| "My demo other task." | |
| [] | |
| (comp (mytask) (mytask2))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment