Browse files

added prep-tasks which allows prep tasks to include args

  • Loading branch information...
Anthony Marcar
Anthony Marcar committed Jul 9, 2012
1 parent 03d4411 commit 5b73ce321b3c7ecc3ed5da6b1614aa46dddc6ea6
Showing with 10 additions and 2 deletions.
  1. +10 −2 leiningen-core/src/leiningen/core/eval.clj
@@ -40,6 +40,15 @@
+(defn prep-tasks
+ "Execute all the prep-tasks. A prep task is just a string e.g
+ \"javac\". If the task takes arguments, you can just add them in the
+ string. E.g \"protobuf compile\""
+ [{:keys [prep-tasks] :as project}]
+ (doseq [task-string prep-tasks]
+ (let [[task & task-args] (string/split (string/trim task-string) #"\s+")]
+ (main/apply-task task (dissoc project :prep-tasks) task-args))))
;; # Form Wrangling
(defn prep [project]
@@ -52,8 +61,7 @@
(main/info "It's possible the specified jar is not in any repository.")
(main/info "If so, see \"Free-floating Jars\" under")
- (doseq [task (:prep-tasks project)]
- (main/apply-task task (dissoc project :prep-tasks) []))
+ (prep-tasks project)
(.mkdirs (io/file (:compile-path project "/tmp")))
(when-let [prepped (:prepped (meta project))]
(deliver prepped true)))

0 comments on commit 5b73ce3

Please sign in to comment.