Browse files

Update for lein 1.5. Try to use lancet.core, fall back to lancet.

  • Loading branch information...
1 parent bff74f8 commit f8aac202d0ea4205c3321dd342e1b251adef1c75 @mtyaka committed Mar 13, 2011
Showing with 11 additions and 7 deletions.
  1. +11 −7 src/leiningen/oneoff.clj
18 src/leiningen/oneoff.clj
@@ -2,14 +2,18 @@
"Run a one-off script or start a one-off repl/swank server."
(:use [robert.hooke :only [add-hook]]
[leiningen.core :only [abort]])
- (:require [lancet]
- [clojure.main]
- [leiningen compile classpath repl deps])
+ (:require (clojure.main)
+ (leiningen compile classpath repl deps))
- (require 'leiningen.swank)
- (catch e))
+;; Leiningen 1.4 uses lancet, while newer versions use lancet.core.
+(try (require '[lancet.core :as lancet])
+ (catch e (require 'lancet)))
+;; Try to load leiningen.swank. This only succeeds when swank-clojure
+;; is in leiningen's classpath.
+(try (require 'leiningen.swank)
+ (catch e))
(def lein-swank-ns (find-ns 'leiningen.swank))
@@ -37,7 +41,7 @@ Returns a sequence of paths referencing jars in the repository."
(defn get-oneoff-classpath
"Returns a sequence of paths that constitute the full classpath
-for a one-off project."
+of a one-off project."
(concat [(:root project)]
(deps-classpath project)

0 comments on commit f8aac20

Please sign in to comment.