diff --git a/project.clj b/project.clj index 0c645b7..6b77b3b 100644 --- a/project.clj +++ b/project.clj @@ -1,9 +1,10 @@ -(defproject thomasa/mranderson "0.2.0-SNAPSHOT" +(defproject thomasa/mranderson "0.2.0" :description "Leiningen plugin to download and use some dependencies as source." :url "https://github.com/benedekfazekas/mranderson" :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :eval-in-leiningen true - :dependencies [[com.cemerick/pomegranate "0.3.0"] - [org.clojure/tools.namespace "0.2.5"] - [me.raynes/fs "1.4.4"]]) + :plugins [[thomasa/mranderson "0.2.0"]] + :dependencies [^:source-dep [com.cemerick/pomegranate "0.3.0"] + ^:source-dep [org.clojure/tools.namespace "0.2.5"] + ^:source-dep [me.raynes/fs "1.4.4"]]) diff --git a/src/leiningen/source_deps.clj b/src/leiningen/source_deps.clj index 8c1dd70..d4be3d7 100644 --- a/src/leiningen/source_deps.clj +++ b/src/leiningen/source_deps.clj @@ -88,15 +88,15 @@ (info (format "retrieving %s artifact. modified dependency name: %s modified version string: %s" art-name art-name-cleaned art-version)) (info " modified namespace prefix: " repl-prefix) (doseq [clj-file clj-files] - (let [old-ns (->> clj-file (fs/file srcdeps) read-file-ns-decl second) - new-ns (replacement repl-prefix old-ns nil) - new-deftype (replacement repl-prefix old-ns true)] - ;; fixing generated classes/deftypes - (when (.contains (name old-ns) "-") - (doseq [file (clojure-source-files [srcdeps])] - (update-deftypes file old-ns new-deftype))) - ;; move actual ns-s - (move-ns old-ns new-ns srcdeps [srcdeps]))) + (when-let [old-ns (->> clj-file (fs/file srcdeps) read-file-ns-decl second)] + (let [new-ns (replacement repl-prefix old-ns nil) + new-deftype (replacement repl-prefix old-ns true)] + ;; fixing generated classes/deftypes + (when (.contains (name old-ns) "-") + (doseq [file (clojure-source-files [srcdeps])] + (update-deftypes file old-ns new-deftype))) + ;; move actual ns-s + (move-ns old-ns new-ns srcdeps [srcdeps])))) ;; fixing prefixes (doseq [file (clojure-source-files [srcdeps])] (doall (map (partial update-file file prefixes) (keys prefixes))))