Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update deploy task

  • Loading branch information...
commit 8baf33ec80bae1d3509590215262351aa2d72fbe 1 parent 7ff1e2e
@xeqi xeqi authored
View
1  project.clj
@@ -7,7 +7,6 @@
:license {:name "Eclipse Public License"}
:dependencies [[leiningen-core "2.0.0-SNAPSHOT"]
[clucy "0.2.2"]
- [lancet "1.0.1"]
[stencil "0.2.0"]
[useful "0.7.6-alpha1"]
[org.clojars.ninjudd/data.xml "0.0.1-SNAPSHOT"]]
View
38 sample.project.clj
@@ -103,30 +103,30 @@
;; if any artifacts are not found, Maven Central will still be reported to
;; have been checked, even though it was not.
:omit-default-repositories true
- :repositories {"java.net" "http://download.java.net/maven/2"
- "sonatype"
- {:url "http://oss.sonatype.org/content/repositories/releases"
- ;; If a repository contains releases only; setting :snapshots
- ;; to false will speed up dependency checking.
- :snapshots false
- ;; You can also set the policies for how to handle :checksum
- ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
- ;; :always, and :never are supported.
- :releases {:checksum :fail
- :update :always}}
+ :repositories [["java.net" "http://download.java.net/maven/2"]
+ ["sonatype"
+ {:url "http://oss.sonatype.org/content/repositories/releases"
+ ;; If a repository contains releases only; setting :snapshots
+ ;; to false will speed up dependency checking.
+ :snapshots false
+ ;; You can also set the policies for how to handle :checksum
+ ;; failures to :fail, :warn, or :ignore. In :releases, :daily,
+ ;; :always, and :never are supported.
+ :releases {:checksum :fail
+ :update :always}}]
;; Repositories named "snapshots" and "releases" automatically
;; have their :snapshots and :releases disabled as appropriate.
- "snapshots" {:url "http://blueant.com/archiva/snapshots"
- ;; Also supports :private-key and :passphrase.
- :username "milgrim" :password "locative.1"}
- "releases" {:url "http://blueant.com/archiva/internal"
- :username "milgrim" :password "locative.1"}}
+ ["snapshots" {:url "http://blueant.com/archiva/snapshots"
+ ;; Also supports :private-key and :passphrase.
+ :username "milgrim" :password "locative.1"}]
+ ["releases" {:url "http://blueant.com/archiva/internal"
+ :username "milgrim" :password "locative.1"}]]
;; the deploy task will give preference to repositories specified in
;; :deploy-repositories, and repos listed there will not be used for
;; dependency resolution
- :deploy-repositories {"releases" {:url "http://blueant.com/archiva/internal/releases"
- :username "milgrim" :password "locative.1"}
- "snapshots" "http://blueant.com/archiva/internal/snapshots"}
+ :deploy-repositories [["releases" {:url "http://blueant.com/archiva/internal/releases"
+ :username "milgrim" :password "locative.1"}]
+ ["snapshots" "http://blueant.com/archiva/internal/snapshots"]]
;; If you'd rather use a different directory structure, you can set these.
:source-path ["src" "src/main/clojure"]
:compile-path "target/classes" ; for .class files
View
22 src/leiningen/deploy.clj
@@ -1,6 +1,6 @@
(ns leiningen.deploy
"Build and deploy jar to remote repository."
- (:require [lancet.core :as lancet])
+ (:require [cemerick.pomegranate.aether :as aether])
(:use [leiningen.core :only [abort repositories-for]]
[leiningen.jar :only [jar]]
[leiningen.pom :only [pom snapshot?]]
@@ -27,7 +27,25 @@ control:
(def leiningen-auth {\"https://blueant.com/archiva/internal\"
{:passphrase \"vorpalbunny\"}})
"
- ([project repository-name])
+ ([project repository-name]
+ (let [jarfile (jar project)
+ pomfile (pom project)
+ repo-opts (or (get (apply hash-map (flatten (:deploy-repositories project))) repository-name)
+ (get (apply hash-map (flatten (:repositories project))) repository-name))
+ repo (if repo-opts
+ {repository-name repo-opts}
+ {"inline" repository-name})]
+ (if (number? jarfile)
+ ;; if we failed to create the jar, return the status code for exit
+ jarfile
+ (do ;; (install-shell-wrappers (JarFile. jarfile))
+ (aether/deploy :coordinates [(symbol (:group project)
+ (:name project))
+ (:version project)]
+ :jar-file (file jarfile)
+ :pom-file (file pomfile)
+ :repository repo)
+ 0))))
([project]
(deploy project (if (snapshot? project)
"snapshots"
View
7 test/leiningen/test/deploy.clj
@@ -2,7 +2,6 @@
(:use [clojure.test]
[clojure.java.io :only [file]]
[leiningen.deploy]
- [leiningen.core :only [read-project defproject]]
[leiningen.test.helper :only [delete-file-recursively
tmp-dir sample-project]]))
@@ -40,7 +39,5 @@
(testing "preferring repository specified in :deploy-repositories over one specified in :repositories"
(deploy-snapshots (assoc sample-project
:deploy-repositories
- {"snapshots" (-> "deploy-only-repo" repo-path repo-url)})
- "deploy-only-repo")))
-
-(doseq [[_ var] (ns-publics *ns*)] (alter-meta! var assoc :busted true))
+ [["snapshots" (-> "deploy-only-repo" repo-path repo-url)]])
+ "deploy-only-repo")))
View
2  todo.org
@@ -58,7 +58,7 @@ See also https://github.com/technomancy/leiningen/issues
- [ ] deps (native-deps and :repositories options)
- [ ] compile (transitive cleaning)
- [ ] shell wrappers
- - [ ] deploy
+ - [X] deploy
- [ ] javac (can we do this without ant?)
- [ ] trampoline
* For 1.6.2
Please sign in to comment.
Something went wrong with that request. Please try again.