-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.clj
55 lines (48 loc) · 1.56 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
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at https://mozilla.org/MPL/2.0/.
(ns build
(:require
[clojure.string :as str]
[clojure.tools.build.api :as b]
[deps-deploy.deps-deploy :as dd]))
(def lib 'io.github.noahtheduke/splint)
(def version (str/trim (slurp "./resources/SPLINT_VERSION")))
(def class-dir "classes")
(defn make-opts [opts]
(assoc opts
:lib lib
:version version
:basis (b/create-basis {})
:scm {:tag (str "v" version)}
:jar-file (format "target/%s-%s.jar" (name lib) version)
:class-dir class-dir
:src-dirs ["src"]
:resource-dirs ["resources"]
:uber-file (format "target/%s-%s-standalone.jar" (name lib) version)
:main 'noahtheduke.splint))
(defn jar [opts]
(let [opts (make-opts opts)]
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/jar opts)))
(defn uber [opts]
(let [opts (make-opts opts)]
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(b/compile-clj opts)
(b/uber opts)))
(defn deploy [opts]
(let [opts (make-opts opts)]
(b/delete {:path class-dir})
(b/write-pom opts)
(jar opts)
(dd/deploy {:installer :remote
:artifact (b/resolve-path (:jar-file opts))
:pom-file (b/pom-path opts)})))
(defn install
"Install built jar to local maven repo"
[opts]
(jar opts)
(b/install (make-opts opts))
(println "Installed version" lib version))