diff --git a/src/leiningen/classpath.clj b/src/leiningen/classpath.clj index b416312a..6942b4eb 100644 --- a/src/leiningen/classpath.clj +++ b/src/leiningen/classpath.clj @@ -1,6 +1,6 @@ (ns leiningen.classpath "Print the classpath of the current project." - (:use [leiningen.core :only [read-project]] + (:use [leiningen.core :only [read-project no-dev?]] [leiningen.deps :only [find-jars]] [leiningen.util.paths :only [leiningen-home]] [clojure.java.io :only [file]] @@ -45,15 +45,17 @@ (defn get-classpath "Answer a list of classpath entries for PROJECT." [project] - (concat [(:source-path project) - (:test-path project) + (concat (if-not (no-dev?) + [(:test-path project) + (:dev-resources-path project)]) + [(:source-path project) (:compile-path project) - (:dev-resources-path project) (:resources-path project)] (:extra-classpath-dirs project) (checkout-deps-paths project) (find-jars project) - (user-plugins))) + (if-not (no-dev?) + (user-plugins)))) (defn get-classpath-string [project] (join java.io.File/pathSeparatorChar (get-classpath project))) diff --git a/src/leiningen/core.clj b/src/leiningen/core.clj index b2395df3..bef8d002 100644 --- a/src/leiningen/core.clj +++ b/src/leiningen/core.clj @@ -25,6 +25,13 @@ (defdeprecated normalize-path paths/normalize-path) +(defn no-dev? + "Should the dev dependencies and directories be ignored? + +Warning: alpha; subject to change." + [] + (System/getenv "LEIN_NO_DEV")) + (defn user-init "Load the user's ~/.lein/init.clj file, if present." [] diff --git a/src/leiningen/deps.clj b/src/leiningen/deps.clj index 125206ea..5b912495 100644 --- a/src/leiningen/deps.clj +++ b/src/leiningen/deps.clj @@ -1,7 +1,7 @@ (ns leiningen.deps "Download all dependencies and put them in :library-path." (:require [lancet.core :as lancet]) - (:use [leiningen.core :only [repositories-for user-settings]] + (:use [leiningen.core :only [repositories-for user-settings no-dev?]] [leiningen.util.maven :only [make-dependency]] [leiningen.util.file :only [delete-file-recursively]] [leiningen.util.paths :only [get-os get-arch]] @@ -190,7 +190,8 @@ (delete-file-recursively (:library-path project) :silently) (delete-file-recursively (File. (:root project) "native") :silently)) (let [fileset (do-deps project :dependencies)] - (do-deps project :dev-dependencies) + (when-not (no-dev?) + (do-deps project :dev-dependencies)) (extract-native-deps project) (when (:checksum-deps project) (spit (new-deps-checksum-file project) (deps-checksum project)))