-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
build.clj
32 lines (28 loc) · 929 Bytes
/
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
(ns build
(:require
[clojure.tools.build.api :as b])
(:import
(java.time
LocalDate)))
(def class-dir "target/classes")
(def basis (b/create-basis {:aliases [:default]}))
(def uber-file "target/clojars-web-standalone.jar")
(defn clean [_]
(b/delete {:path "target"}))
(defn uberjar [_]
(clean nil)
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(println "Compiling...")
(b/compile-clj {:basis basis
:src-dirs ["src"]
:class-dir class-dir})
(printf "Building uberjar %s...\n" uber-file)
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis
:main 'clojars.main}))
(defn tag-release [_]
(let [version (format "%s.%s" (LocalDate/now) (b/git-count-revs nil))]
(b/git-process {:git-args (format "tag %s" version)})
(b/git-process {:git-args (format "push origin %s" version)})))