Permalink
Browse files

Refactor `remove-duplicate-dependencies` and fix #13

  • Loading branch information...
1 parent 85b3859 commit 3929713ad9c070c6616a8475174ecfbd11a13537 @alexander-yakushev alexander-yakushev committed Mar 9, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/leiningen/droid/classpath.clj
View
14 src/leiningen/droid/classpath.clj
@@ -15,11 +15,9 @@
version or groupId. Android-patched version of Clojure is prefered
over the other ones. For the rest the latest version is preferred."
[dependencies]
- (let [tagged (map
- (fn [[artifact version :as dep]]
- (let [[_ group name] (re-find #"(.+/)?(.+)" (str artifact))]
- {:name name, :group group, :ver version, :original dep}))
- dependencies)
+ (let [tagged (for [[artifact version :as dep] dependencies]
+ (let [[_ group name] (re-matches #"(.+/)?(.+)" (str artifact))]
+ {:name name, :group group, :ver version, :original dep}))
grouped (group-by :name tagged)
scheme (GenericVersionScheme.)]
(for [[name same-jars] grouped]
@@ -33,8 +31,10 @@
same-jars))
same-jars)]
(:original
- (reduce #(if (pos? (compare (.parseVersion scheme (:version %2))
- (.parseVersion scheme (:version %1))))
+ (reduce #(if (pos? (compare (.parseVersion scheme (or (:version %2)
+ "0"))
+ (.parseVersion scheme (or (:version %1)
+ "0"))))
%2 %1)
same-jars))))))

0 comments on commit 3929713

Please sign in to comment.