Skip to content

Commit

Permalink
Move :dependencies back to vector-of-vectors.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Mar 1, 2012
1 parent 861e4f0 commit 5e78087
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
14 changes: 10 additions & 4 deletions leiningen-core/src/leiningen/core/project.clj
Expand Up @@ -59,13 +59,19 @@
(for [[id repo] repositories]
[id (if (map? repo) repo {:url repo})]))))

(defn- dedupe-step [[deps seen] x]
(if (seen (first x))
[deps seen]
[(conj deps x) (conj seen (first x))]))

(defn- dedupe-deps [deps]
(first (reduce dedupe-step [[] #{}] deps)))

(defn normalize-deps [project]
;; TODO: mapize
(update-in project [:dependencies] ordered/ordered-map))
(update-in project [:dependencies] dedupe-deps))

(defn normalize-plugins [project]
;; TODO: mapize
(update-in project [:plugins] ordered/ordered-map))
(update-in project [:plugins] dedupe-deps))

(defn- absolutize [root path]
(str (if (.startsWith path "/")
Expand Down
11 changes: 5 additions & 6 deletions leiningen-core/test/leiningen/core/test/project.clj
Expand Up @@ -26,12 +26,11 @@
:eval-in :leiningen,
:license {:name "Eclipse Public License"}

:dependencies '{leiningen-core {:version "2.0.0-SNAPSHOT"}
clucy {:version "0.2.2"
:exclusions [org.clojure/clojure]}
lancet {:version "1.0.1"}
robert/hooke {:version "1.1.2"}
stencil {:version "0.2.0"}},
:dependencies '[[leiningen-core "2.0.0-SNAPSHOT"]
[clucy "0.2.2" :exclusions [org.clojure/clojure]]
[lancet "1.0.1"]
[robert/hooke "1.1.2"]
[stencil "0.2.0"]],
:twelve 12 ; testing unquote

:repositories {"central" {:url "http://repo1.maven.org/maven2"}
Expand Down

0 comments on commit 5e78087

Please sign in to comment.