Add auto-clean to deploy task. Fixes #1512.

This commit is contained in:
Phil Hagelberg 2014-05-01 15:49:40 -07:00
parent 7cd81ed78c
commit 4776eeb8e0
2 changed files with 7 additions and 0 deletions

View file

@ -349,6 +349,10 @@
:jar-exclusions [#"(?:^|/).svn/"]
;; Same thing, but for uberjars.
:uberjar-exclusions [#"META-INF/DUMMY.SF"]
;; By default Leiningen will run a clean before deploying to prevent
;; undeclared AOT from leaking to downstream consumers; this disables
;; that behaviour.
:auto-clean false
;; Files to merge programmatically in uberjars when multiple same-named files
;; exist across project and dependencies. Should be a map of filename strings
;; or regular expressions to a sequence of three functions:

View file

@ -9,6 +9,7 @@
[clojure.java.io :as io]
[leiningen.pom :as pom]
[leiningen.jar :as jar]
[leiningen.clean :as clean]
[clojure.java.shell :as sh]
[clojure.string :as str]))
@ -158,6 +159,8 @@ be able to depend on jars that are deployed without a pom."
(apply main/abort "Can only deploy from branches listed in"
":deploy-branches:" branches)))
(warn-missing-metadata project)
(when (:auto-clean project true)
(clean/clean project))
(let [repo (repo-for project repository)
files (files-for project repo)]
(try