Merge pull request #1497 from jcrossley3/dedupe-group
Include group in dedupe key to fix #1480
This commit is contained in:
commit
7cc9d61632
3 changed files with 15 additions and 7 deletions
|
@ -195,10 +195,9 @@
|
|||
|
||||
(defn- dep-key
|
||||
"The unique key used to dedupe dependencies."
|
||||
[[id version & opts]]
|
||||
(-> (apply hash-map opts)
|
||||
(select-keys [:classifier :extension])
|
||||
(assoc :id id)))
|
||||
[dep]
|
||||
(-> (dependency-map dep)
|
||||
(select-keys [:group-id :artifact-id :classifier :extension])))
|
||||
|
||||
(defn- reduce-dep-step [deps dep]
|
||||
(let [k (dep-key dep)]
|
||||
|
|
|
@ -510,6 +510,15 @@
|
|||
[org.clojure/clojure "1.3.0"]]})
|
||||
(:dependencies)))))
|
||||
|
||||
(deftest test-dedupe-non-group-deps
|
||||
(is (= '[[foo/foo "1.1"]]
|
||||
(-> (make-project
|
||||
{:dependencies empty-dependencies
|
||||
:profiles {:a {:dependencies '[[foo "1.0"]]}
|
||||
:b {:dependencies '[[foo "1.1"]]}}})
|
||||
(merge-profiles [:a :b])
|
||||
(:dependencies)))))
|
||||
|
||||
(deftest test-warn-user-repos
|
||||
(if (System/getenv "LEIN_SUPPRESS_USER_LEVEL_REPO_WARNINGS")
|
||||
(testing "no output with suppression"
|
||||
|
|
|
@ -250,13 +250,13 @@
|
|||
(make-pom (with-profile
|
||||
sample-project
|
||||
:dev {:dependencies '[[rome "0.8"]]})))]
|
||||
(is (= ["org.clojure" "rome" "ring" "org.clojure" "clojure-complete" "rome"]
|
||||
(is (= ["org.clojure" "rome" "ring" "rome" "org.clojure" "clojure-complete"]
|
||||
(map #(first-in % [:dependency :groupId])
|
||||
(deep-content xml [:project :dependencies]))))
|
||||
(is (= ["clojure" "rome" "ring" "tools.nrepl" "clojure-complete" "rome"]
|
||||
(is (= ["clojure" "rome" "ring" "rome" "tools.nrepl" "clojure-complete"]
|
||||
(map #(first-in % [:dependency :artifactId])
|
||||
(deep-content xml [:project :dependencies]))))
|
||||
(is (= ["1.3.0" "0.9" "1.0.0" "0.2.3" "0.2.3" "0.8"]
|
||||
(is (= ["1.3.0" "0.9" "1.0.0" "0.8" "0.2.3" "0.2.3"]
|
||||
(map #(first-in % [:dependency :version])
|
||||
(deep-content xml [:project :dependencies]))))
|
||||
(is (= [nil nil nil "test" "test" "test"]
|
||||
|
|
Loading…
Reference in a new issue