3 [clojure.tools.build.api :as b]
4 [deps-deploy.deps-deploy :as d]))
6 (def repo "github.com/omar-polo/gemini.git")
7 (def lib 'com.omarpolo/gemini)
8 (def version (format "0.2.0"))
9 (def class-dir "target/classes")
10 (def basis (b/create-basis {:project "deps.edn"}))
11 (def jar-file (format "target/%s-%s.jar" (name lib) version))
12 (def pom-file (format "%s/META-INF/maven/%s/pom.xml" class-dir lib))
15 (b/delete {:path "target"}))
18 (b/javac {:src-dirs ["src"]
21 :javac-opts ["-source" "11" "-target" "11"]}))
25 (b/write-pom {:class-dir class-dir
30 :scm {:connection (str "scm:git:git://" repo)
31 :developerConnection (str "scm:git:ssh://git@" repo)
33 :url (str "https://" repo)}})
34 (b/copy-dir {:src-dirs ["src"]
35 :target-dir class-dir})
36 (b/jar {:class-dir class-dir
39 ;; NB: set CLOJARS_USERNAME and CLOJARS_PASSWORD
41 (when-not (or (System/getenv "CLOJARS_USERNAME")
42 (System/getenv "CLOJARS_PASWORD"))
43 (throw (Exception. "Missing CLOJARS_USERNAME or PASSWORD!")))
45 ;; deploy both locally *and* on clojars
46 (doseq [place [:local :remote]]
47 (d/deploy {:artifact jar-file
50 :sign-releases? true})))