Skip to content

Commit

Permalink
Support <developers> element in pom task (fixes #233)
Browse files Browse the repository at this point in the history
  • Loading branch information
micha committed Nov 1, 2015
1 parent b059839 commit 1ed1c73
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion boot/core/src/boot/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
["-b" "--boot-script" "Print generated boot script for debugging."]
["-B" "--no-boot-script" "Ignore boot script in current directory."]
["-C" "--no-colors" "Remove ANSI escape codes from printed output."]
["-d" "--dependencies ID:VER" "Add dependency to project (eg. -d foo/bar:1.2.3)."
["-d" "--dependencies SYM:VER" "Add dependency to project (eg. -d foo/bar:1.2.3)."
:assoc-fn #(let [[p v] (string/split %3 #":" 2)]
(update-in %1 [%2] (fnil conj []) [(read-string p) (or v "RELEASE")]))]
["-e" "--set-env KEY=VAL" "Add KEY => VAL to project env map."
Expand Down
17 changes: 10 additions & 7 deletions boot/core/src/boot/task/built_in.clj
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,21 @@
The project and version must be specified to make a pom.xml."

[p project SYM sym "The project id (eg. foo/bar)."
v version VER str "The project version."
d description DESC str "The project description."
u url URL str "The project homepage url."
l license NAME:URL {str str} "The project license map."
s scm KEY=VAL {kw str} "The project scm map (KEY in url, tag)."]
[p project SYM sym "The project id (eg. foo/bar)."
v version VER str "The project version."
d description DESC str "The project description."
u url URL str "The project homepage url."
s scm KEY=VAL {kw str} "The project scm map (KEY is one of url, tag, connection, developerConnection)."
l license NAME:URL {str str} "The map {name url} of project licenses."
o developers NAME:EMAIL {str str} "The map {name email} of project developers."
D dependencies SYM:VER [[sym str]] "The project dependencies vector (overrides boot env dependencies)."]

(let [tgt (core/tmp-dir!)]
(core/with-pre-wrap fileset
(let [tag (or (:tag scm) (util/guard (git/last-commit)))
scm (when scm (assoc scm :tag tag))
opts (assoc *opts* :scm scm :dependencies (:dependencies (core/get-env)))]
deps (or dependencies (:dependencies (core/get-env)))
opts (assoc *opts* :scm scm :dependencies deps :developers developers)]
(core/empty-dir! tgt)
(when-not (and project version)
(throw (Exception. "need project and version to create pom.xml")))
Expand Down
1 change: 1 addition & 0 deletions boot/pod/src/boot/pod.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns boot.pod
(:require
[clojure.set :as set]
[clojure.string :as string]
[boot.util :as util]
[boot.file :as file]
[boot.from.backtick :as bt]
Expand Down
10 changes: 9 additions & 1 deletion boot/worker/src/boot/pom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
(xml/decelems
artifactId connection description dependencies dependency exclusion
exclusions developerConnection enabled groupId id license licenses
modelVersion name project scope tag url scm version comments)
modelVersion name email project scope tag url scm version comments
developer developers)

;;; private ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Expand All @@ -42,6 +43,7 @@
st :tag
sc :connection
sd :developerConnection} :scm
ds :developers
u :url
deps :dependencies
:as env}]
Expand Down Expand Up @@ -70,6 +72,12 @@
(when sd (developerConnection sd))
(when su (url su))
(when st (tag st))))
(when-let [ds (seq ds)]
(developers
(for [[n e] ds]
(developer
(name n)
(email e)))))
(dependencies
(for [[p v & {es :exclusions s :scope}] deps
:let [[g a] (util/extract-ids p)]]
Expand Down

0 comments on commit 1ed1c73

Please sign in to comment.