Permalink
Browse files

Fix missing no-project-needed reference

  • Loading branch information...
1 parent 5cb05ce commit a5c1cffb5531ce6bba8c1d5b1601023ef9ea509e @maravillas committed Oct 12, 2010
Showing with 15 additions and 11 deletions.
  1. +15 −11 src/leiningen/multi.clj
View
@@ -1,6 +1,6 @@
(ns leiningen.multi
(:use [leiningen.deps :only [deps]]
- [leiningen.core :only [resolve-task no-project-needed]])
+ [leiningen.core :only [resolve-task arglists]])
(:require [leiningen.test]))
(defn- multi-library-path
@@ -50,24 +50,28 @@
[task project & args]
(print-base-message task project)
(let [task-fn (resolve-task task)
- results (cons (apply task-fn project args)
- (run-multi-task #(apply task-fn % args)
- project
- (partial print-set-message task)))
- valued? (every? number? results)
- success? (every? #(and (number? %) (zero? %)) results)]
+ results (cons (apply task-fn project args)
+ (run-multi-task #(apply task-fn % args)
+ project
+ (partial print-set-message task)))
+ valued? (every? number? results)
+ success? (every? #(and (number? %) (zero? %)) results)]
(if valued?
(if (every? zero? results) 0 1)
results)))
+(defn- project-needed?
+ [task]
+ (some #(= 'project (first %)) (arglists task)))
+
(defn multi
"Run a task against multiple dependency sets as specified by :multi-deps in
project.clj."
[project task & args]
(cond
- (@no-project-needed task) (do
- (println (str "lein multi has no effect for task \""
- task "\" - running task as normal"))
- (apply (resolve-task task) args))
+ (not (project-needed? task)) (do
+ (println (str "lein multi has no effect for task \""
+ task "\" - running task as normal"))
+ (apply (resolve-task task) args))
(= task "deps") (apply run-deps project args)
:else (apply run-task task project args)))

0 comments on commit a5c1cff

Please sign in to comment.