Merge remote-tracking branch 'Moocar/prep-tasks'
Conflicts: leiningen-core/src/leiningen/core/eval.clj
This commit is contained in:
commit
066b557e97
2 changed files with 12 additions and 4 deletions
|
@ -40,6 +40,16 @@
|
|||
"NUL"
|
||||
"/dev/null")))
|
||||
|
||||
(defn prep-tasks
|
||||
"Execute all the prep-tasks. A task can either be a string, or a
|
||||
vector if it takes arguments. see :prep-tasks in sample.project.clj
|
||||
for examples"
|
||||
[{:keys [prep-tasks] :as project}]
|
||||
(doseq [task prep-tasks]
|
||||
(let [[task-name & task-args] (if (vector? task) task [task])
|
||||
task-name (main/lookup-alias task-name project)]
|
||||
(main/apply-task task-name (dissoc project :prep-tasks) task-args))))
|
||||
|
||||
;; # Form Wrangling
|
||||
|
||||
(defn prep [project]
|
||||
|
@ -52,9 +62,7 @@
|
|||
(main/info "It's possible the specified jar is not in any repository.")
|
||||
(main/info "If so, see \"Free-floating Jars\" under http://j.mp/repeatability")
|
||||
(main/abort)))
|
||||
(doseq [task (:prep-tasks project)]
|
||||
(main/apply-task (main/lookup-alias task project)
|
||||
(dissoc project :prep-tasks) []))
|
||||
(prep-tasks project)
|
||||
(.mkdirs (io/file (:compile-path project "/tmp")))
|
||||
(when-let [prepped (:prepped (meta project))]
|
||||
(deliver prepped true)))
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
;; Normally Leiningen runs the javac and compile tasks before
|
||||
;; calling any eval-in-project code, but you can override this with
|
||||
;; the :prep-tasks key to do other things like compile protocol buffers.
|
||||
:prep-tasks ["protoc" "compile"]
|
||||
:prep-tasks [["protobuf" "compile"] "javac" "compile"]
|
||||
;; Warns users of earlier versions of Leiningen.
|
||||
:min-lein-version "2.0.0"
|
||||
;; Paths to include on the classpath from each project in the
|
||||
|
|
Loading…
Reference in a new issue