-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
56 lines (49 loc) · 1.75 KB
/
build.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
;; see https://ask.clojure.org/index.php/10905/control-transient-deps-that-compiled-assembled-into-uberjar?show=10913#c10913
(require 'clojure.tools.deps.alpha.util.s3-transporter)
(ns build
(:refer-clojure :exclude [compile])
(:require
[clojure.string :as str]
[clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]))
(def lib 'com.github.clj-easy/lib-deprecations)
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def with-svm-basis (b/create-basis {:project "deps.edn"
:aliases [:svm]}))
(def version-file "resources/LIB_DEPRECATIONS_VERSION")
(def version (str/trim (slurp version-file )))
(def jar-file (format "target/%s-%s.jar" (name lib) version))
(defn clean [_]
(b/delete {:path "target"}))
(defn jar [_]
(println "Producing jar:" jar-file)
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["src"]})
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/jar {:class-dir class-dir
:jar-file jar-file})
(println "Done building jar.")
(println "Jar is up to date."))
(defn install
[_]
(jar {})
(b/install {:basis basis
:lib lib
:version version
:jar-file jar-file
:class-dir class-dir})
(println "Installed" lib version "in local maven repo."))
(defn deploy [opts]
(println "All set for deployment 🚀🚀")
(jar {})
(println "Deploying version" jar-file "to Clojars.")
(dd/deploy (merge {:installer :remote
:artifact jar-file
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}
opts))
opts)