Skip to content
Browse files

Add special handling for non-project.clj tasks

  • Loading branch information...
1 parent 0eb3ea4 commit 8596bd32e21f566e77e462fe9509eb8a15fa449b @maravillas committed Aug 3, 2010
Showing with 10 additions and 2 deletions.
  1. +5 −2 src/leiningen/multi.clj
  2. +5 −0 test/leiningen/test/multi.clj
View
7 src/leiningen/multi.clj
@@ -1,6 +1,6 @@
(ns leiningen.multi
(:use [leiningen.deps :only [deps]]
- [leiningen.core :only [resolve-task]])
+ [leiningen.core :only [resolve-task no-project-needed]])
(:require [leiningen.test]))
(def task-whitelist ["deps" "test" "run" "compile" "jar" "uberjar"])
@@ -61,5 +61,8 @@
(defn multi
[project task & args]
- (cond (= task "deps") (apply run-deps project 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))
+ (= task "deps") (apply run-deps project args)
:else (apply run-task task project args)))
View
5 test/leiningen/test/multi.clj
@@ -51,3 +51,8 @@
;; If the 'sample2 namespace argument is ignored, sample/failing-test-1.1.0
;; will result in a return value of 1, as in test-failing-multi-tests
(is (= result 0))))
+
+(deftest test-multi-new-ignored
+ (multi test-project "new" "multi-test-new-project")
+ (is (.exists (file "multi-test-new-project")))
+ (delete-file-recursively (file "multi-test-new-project") true))

0 comments on commit 8596bd3

Please sign in to comment.
Something went wrong with that request. Please try again.