Support overriding pom.xml version via :exec-args and cli#21
Support overriding pom.xml version via :exec-args and cli#21RickMoynihan wants to merge 3 commits intoslipset:masterfrom
Conversation
We rename the deploy multi-method to deploy* and consequently there is a chance this may break any users who were extending this multimethod, so we can wrap this with a new deploy function. Also renames :clojars key to :remote to indicate the mechanism for repositories is more generic than just clojars.
| coordinates (coordinates-from-pom pom) | ||
| versioned-pom (spit (versioned-pom-filename coordinates) pom)] | ||
|
|
||
| (defn- tag-val-replacer [tag->val] |
There was a problem hiding this comment.
I tend to prefer creating fns which take the required amount of args, and then rather bind the args using partial (to which I'm, ehrm, partial) or with an anon-fn #(replace-tag {version-tag [version] group-id-tag [group-id] ...} %)
There was a problem hiding this comment.
👍 Cool. I'm quite partial to doing things that way too ;-) it was even my first instinct, which I held back on because I figured it'd be bikeshedded the other way. Happy to change.
| (defn- tag-val-replacer [tag->val] | ||
| (fn [{:keys [tag content attrs] :as el}] | ||
| (let [replacement-val (tag->val tag ::default)] | ||
| (if (= ::default replacement-val) |
There was a problem hiding this comment.
This is a great use-case for cond->:
(cond-> el
(not= ::default replacement-val) (assoc :content replacement-val))It's almost like this is an update right?
(update el :content (fn [c] (if (= ::default replacement-val) c replacement-val)))There was a problem hiding this comment.
Indeed it is. Will revise both of those. Thanks for caring.
| versioned-pom (spit (versioned-pom-filename coordinates) pom)] | ||
|
|
||
| (defn- tag-val-replacer [tag->val] | ||
| (fn [{:keys [tag content attrs] :as el}] |
slipset
left a comment
There was a problem hiding this comment.
I've added some comments, I'm mostly concerned with making the higher-order tag-val-replacer into a normal fn.
|
FYI I'm less sure about this PR belonging in I'll see if we can put this somewhere. |
Implements #20
Extends PR #18 to support overriding a version number in a pom.xml. This allows CI systems etc to easily deploy an artifact with a generated build number, or for a version override to be supplied via the CLI when using
:exec-fn