diff --git a/test/leiningen/test/deploy.clj b/test/leiningen/test/deploy.clj index c0f878dd..b9fccb56 100644 --- a/test/leiningen/test/deploy.clj +++ b/test/leiningen/test/deploy.clj @@ -3,7 +3,8 @@ [clojure.java.io :only [file]] [leiningen.deploy] [leiningen.test.helper :only [delete-file-recursively - tmp-dir sample-project]])) + tmp-dir sample-project + sample-deploy-project]])) (defn- repo-path [relative-repo-path] @@ -45,6 +46,21 @@ repo-path repo-url)}}) "deploy-only-repo"))) +(deftest ^:online test-deploy-classifier + (testing "deployment with explicit file names uploads classifiers to repo" + (let [deploy-dir (repo-path "deploy-classifier") + project (assoc sample-deploy-project + :deploy-repositories + {"snapshots" {:url (repo-url deploy-dir)}})] + (delete-file-recursively deploy-dir :silently) + (deploy project "snapshots" + "deploy-me/deploy-me" + (:version project) + (str (:root project) "/deploy-me-0.1.0-SNAPSHOT-fat.jarr")) + (let [dir (file deploy-dir "deploy-me/deploy-me/0.1.0-SNAPSHOT/") + files (.list dir)] + (is (seq (filter #(re-find #"deploy-me-0.1.0-[\d.]+-\d+-fat.jarr$" %) files))))))) + (deftest signing (testing "GPG invocation" (is (= (signing-args "foo.jar" nil) diff --git a/test/leiningen/test/helper.clj b/test/leiningen/test/helper.clj index 8037bb48..9ea06cae 100644 --- a/test/leiningen/test/helper.clj +++ b/test/leiningen/test/helper.clj @@ -50,6 +50,8 @@ (def sample-fixture-error-project (read-test-project "sample-fixture-error")) +(def sample-deploy-project (read-test-project "sample-deploy")) + (def tricky-name-project (read-test-project "tricky-name")) (def native-project (read-test-project "native")) diff --git a/test_projects/sample-deploy/deploy-me-0.1.0-SNAPSHOT-fat.jarr b/test_projects/sample-deploy/deploy-me-0.1.0-SNAPSHOT-fat.jarr new file mode 100644 index 00000000..bafa43d1 --- /dev/null +++ b/test_projects/sample-deploy/deploy-me-0.1.0-SNAPSHOT-fat.jarr @@ -0,0 +1 @@ +I am a teapot! diff --git a/test_projects/sample-deploy/project.clj b/test_projects/sample-deploy/project.clj new file mode 100644 index 00000000..c174326e --- /dev/null +++ b/test_projects/sample-deploy/project.clj @@ -0,0 +1,6 @@ +(defproject deploy-me "0.1.0-SNAPSHOT" + :description "FIXME: write description" + :url "http://example.com/FIXME" + :license {:name "Eclipse Public License" + :url "http://www.eclipse.org/legal/epl-v10.html"} + :dependencies [[org.clojure/clojure "1.8.0"]])