Skip to content

Commit

Permalink
[Fix #6] use 'mranderson' 'mranderson-version' as...
Browse files Browse the repository at this point in the history
... default prefix
  • Loading branch information
benedekfazekas committed Jul 6, 2015
1 parent e614348 commit a36a6a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion src/leiningen/source_deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 9 additions & 0 deletions src/mranderson/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit a36a6a0

Please sign in to comment.