Permalink
Browse files

Use leiningen.core.classpath from classpath task.

  • Loading branch information...
1 parent eacddf1 commit 708a586242860614bc0eeccf6a31aa80a6cbed4f @technomancy committed Dec 2, 2011
Showing with 4 additions and 50 deletions.
  1. +3 −49 src/leiningen/classpath.clj
  2. +1 −1 todo.org
@@ -1,56 +1,10 @@
(ns leiningen.classpath
"Print the classpath of the current project."
- (:use [leiningen.core :only [read-project no-dev?]]
- [leiningen.deps :only [find-deps-files]]
- [leiningen.util.paths :only [leiningen-home]]
- [clojure.java.io :only [file]]
- [clojure.string :only [join]]))
-
-(defn- read-dependency-project [dep]
- (let [project (.getAbsolutePath (file dep "project.clj"))]
- (try (read-project project)
- (catch Exception e
- (throw (Exception. (format "Problem loading %s" project) e))))))
-
-(defn- ensure-absolute [path root]
- (.getCanonicalPath
- (let [f (file path)]
- (if (.isAbsolute f)
- f
- (file root f)))))
-
-(defn checkout-deps-paths [project]
- (apply concat (for [dep (.listFiles (file (:root project) "checkouts"))
- ;; Note that this resets the leiningen.core/project var!
- :let [proj (read-dependency-project dep)]
- :when proj]
- (for [d (:checkout-deps-shares project [:source-path
- :compile-path
- :resources-path])]
- (ensure-absolute (d proj) dep)))))
-
-(defn user-plugins []
- (for [jar (.listFiles (file (leiningen-home) "plugins"))
- :when (re-find #"\.jar$" (.getName jar))]
- (.getAbsolutePath jar)))
-
-(defn get-classpath
- "Answer a list of classpath entries for PROJECT."
- [project]
- (concat (if-not (no-dev?)
- [(:test-path project)
- (:dev-resources-path project)])
- [(:source-path project)
- (:compile-path project)
- (:resources-path project)]
- (:extra-classpath-dirs project)
- (checkout-deps-paths project)
- (find-deps-files project)
- (if-not (no-dev?)
- (user-plugins))))
+ (:require [leiningen.core.classpath :as classpath]
+ [clojure.string :as str]))
(defn get-classpath-string [project]
- (join java.io.File/pathSeparatorChar (get-classpath project)))
+ (str/join java.io.File/pathSeparatorChar (classpath/get-classpath project)))
(defn classpath
"Print the classpath of the current project.
View
@@ -26,7 +26,7 @@ See also https://github.com/technomancy/leiningen/issues
- [ ] Allow disabling of all injected code
- [ ] Drop clojars snapshots from default repos
** Adapt existing tasks to new API
- - [ ] classpath
+ - [X] classpath
- [X] clean
- [ ] compile
- [ ] deploy

0 comments on commit 708a586

Please sign in to comment.