Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow :checksum policy to be set at the top-level of project.clj as w…

…ell.
  • Loading branch information...
commit 7d641026e4a0ba38dc9f1f3fb18832dc03949e67 1 parent 3780bf6
@technomancy authored
View
15 leiningen-core/src/leiningen/core/classpath.clj
@@ -53,6 +53,10 @@
"Call f with args when keys in project.clj have changed since the last run.
Stores value of project keys in stale directory inside :target-path."
[keys project f & args]
+ (prn :target-path (:target-path project))
+ (when-not (:target-path project)
+ (prn :no-target project)
+ (throw (Exception. "No target path!")))
(let [file (io/file (:target-path project) "stale"
(str/join "+" (map name keys)))
current-value (pr-str (map (juxt identity project) keys))
@@ -101,14 +105,17 @@
:username username
:password password})))
-(defn- update-policy [update [repo-name opts]]
- [repo-name (if update (assoc opts :update update) opts)])
+(defn- update-policies [update checksum [repo-name opts]]
+ (let [opts (if update (assoc opts :update update) opts)
+ opts (if checksum (assoc opts :checksum checksum) opts)]
+ [repo-name opts]))
(defn- root-cause [e]
(last (take-while identity (iterate (memfn getCause) e))))
(defn- get-dependencies
- [dependencies-key {:keys [repositories local-repo offline? update] :as project}
+ [dependencies-key {:keys [repositories local-repo offline? update checksum]
+ :as project}
& {:keys [add-classpath?]}]
{:pre [(every? vector? (project dependencies-key))]}
(try
@@ -119,7 +126,7 @@
:offline? offline?
:repositories (->> repositories
(map add-repo-auth)
- (map (partial update-policy update)))
+ (map (partial update-policies update checksum)))
:coordinates (project dependencies-key)
:transfer-listener :stdout
:proxy (get-proxy-settings))
View
2  sample.project.clj
@@ -141,7 +141,7 @@
"snapshots" "http://blueant.com/archiva/snapshots"
"releases" "http://blueant.com/archiva/internal"}
;; You can set :update and :checksum policies here to have them
- ;; apply for all :repositories. Usually you will not set this
+ ;; apply for all :repositories. Usually you will not set :update
;; directly but apply the "update" profile instead.
:update :always
;; the deploy task will give preference to repositories specified in
View
2  todo.org
@@ -8,7 +8,7 @@ See also https://github.com/technomancy/leiningen/issues
- [X] Make offline profile use dev profile (#514) (LHF)
- [X] Fix $JVM_OPTS (#565)
- [X] Move lein-newnew plugin into default profile (#540)
- - [ ] Force checking of snapshots (#518) (LHF)
+ - [X] Force checking of snapshots (#518) (LHF)
** Intermediate
- [X] Pretty-print pom
- [X] deps :tree
Please sign in to comment.
Something went wrong with that request. Please try again.