Add support for string deps in project.clj

This is needed for rare cases where maven artifact-ids and/or group-ids
aren't valid symbols (e.g. they start with a number).

Test coverage added.
This commit is contained in:
Wes Morgan 2017-02-01 18:45:34 -07:00
parent bbbead38b2
commit 66cef075e8
No known key found for this signature in database
GPG key ID: 5639E4CBFA17DC84
4 changed files with 29 additions and 7 deletions

View file

@ -6,7 +6,9 @@
[clucy "0.2.2" :exclusions [org.clojure/clojure]]
[lancet "1.0.1"]
[robert/hooke "1.1.2"]
[stencil "0.2.0"]]
[stencil "0.2.0"]
["net.3scale/3scale-api" "3.0.2"]
["clj-http" "3.4.1"]]
:twelve ~(+ 6 2 4)
:disable-implicit-clean true
:eval-in-leiningen true)

View file

@ -14,7 +14,7 @@
</license>
</licenses>
<scm>
<tag>f42a5cfec3c3bbe1fcc7cb63130955519bb7ca3a
<tag>bbbead38b2bbf6e4e7bb315b67dbde6948a6eb84
</tag>
<url/>
</scm>
@ -106,7 +106,7 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>2.10</version>
<version>2.12</version>
</dependency>
<dependency>
<groupId>com.hypirion</groupId>
@ -118,6 +118,11 @@
<artifactId>pedantic</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.22</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>tools.macro</artifactId>

View file

@ -9,7 +9,8 @@
[cemerick.pomegranate.aether :as aether]
[leiningen.core.utils :as utils]
[leiningen.core.user :as user]
[leiningen.core.classpath :as classpath])
[leiningen.core.classpath :as classpath]
[clojure.string :as str])
(:import (clojure.lang DynamicClassLoader)
(java.io PushbackReader Reader)))
@ -48,10 +49,22 @@
[profile]
(vector? profile))
(defn artifact-namespace
[id]
(if (string? id)
(first (str/split id #"/"))
(or (namespace id) (name id))))
(defn artifact-name
[id]
(if (string? id)
(last (str/split id #"/"))
(name id)))
(defn artifact-map
[id]
{:artifact-id (name id)
:group-id (or (namespace id) (name id))})
{:artifact-id (artifact-name id)
:group-id (artifact-namespace id)})
(defn exclusion-map
"Transform an exclusion vector into a map that is easier to combine with

View file

@ -36,11 +36,13 @@
:eval-in :leiningen,
:license {:name "Eclipse Public License"}
:dependencies '[[leiningen-core/leiningen-core "2.0.0-SNAPSHOT"]
:dependencies `[[leiningen-core/leiningen-core "2.0.0-SNAPSHOT"]
[clucy/clucy "0.2.2" :exclusions [[org.clojure/clojure]]]
[lancet/lancet "1.0.1"]
[robert/hooke "1.1.2"]
[stencil/stencil "0.2.0"]
[~(symbol "net.3scale" "3scale-api") "3.0.2"]
[clj-http/clj-http "3.4.1"]
[org.clojure/tools.nrepl "0.2.12"
:exclusions [[org.clojure/clojure]]]
[clojure-complete/clojure-complete "0.2.4"