diff --git a/project.clj b/project.clj index 0877b2f..6d5a267 100644 --- a/project.clj +++ b/project.clj @@ -7,6 +7,7 @@ :plugins [[thomasa/mranderson "0.4.0"]] :java-source-paths ["java-src"] :javac-options ["-target" "1.6" "-source" "1.6"] + :filespecs [{:type :bytes :path "mranderson/project.clj" :bytes ~(slurp "project.clj")}] :dependencies [^:source-dep [com.cemerick/pomegranate "0.3.0"] ^:source-dep [org.clojure/tools.namespace "0.2.7"] ^:source-dep [me.raynes/fs "1.4.6"] diff --git a/src/leiningen/source_deps.clj b/src/leiningen/source_deps.clj index d2c2a21..a6b901a 100644 --- a/src/leiningen/source_deps.clj +++ b/src/leiningen/source_deps.clj @@ -256,7 +256,7 @@ (let [source-dependencies (filter source-dep? dependencies) opts (map #(edn/read-string %) args) project-prefix (lookup-opt :project-prefix opts) - pprefix (or project-prefix (clean-name-version name version)) + pprefix (or project-prefix (clean-name-version "mranderson" (mranderson-version))) srcdeps-relative (str (apply str (drop (inc (count root)) target-path)) "/srcdeps") dep-hierarchy (->> (aether/resolve-dependencies :coordinates source-dependencies :repositories repositories) (aether/dependency-hierarchy source-dependencies)) diff --git a/src/mranderson/util.clj b/src/mranderson/util.clj index 90f2382..9ea608f 100644 --- a/src/mranderson/util.clj +++ b/src/mranderson/util.clj @@ -99,3 +99,12 @@ (->> (str/split (str file) #"/") (drop 2) (str/join "/"))) + +(defn mranderson-version [] + (let [v (-> (io/resource "mranderson/project.clj") + slurp + read-string + (nth 2))] + (assert (string? v) + (str "Something went wrong, version is not a string: " v)) + v))