forked from clj-commons/humanize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.clj
40 lines (33 loc) · 903 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
33
34
35
36
37
38
39
40
(ns build
(:require [clojure.tools.build.api :as b]
[org.corfield.build :as bb]))
(def lib 'clj-commons/humanize)
(def version "0.3")
(defn make-version [opts]
(or (:version opts)
(str version "."
(b/git-count-revs nil)
(when-not (:release opts)
"-SNAPSHOT"))))
(def base-opts
{:lib lib
:class-dir "target/classes"})
(def basis (b/create-basis {:project "deps.edn"}))
(defn clean [_]
(b/delete {:path "target"})
(b/delete {:path "cljs-test-runner-out"}))
(defn jar
"Build a JAR."
[opts]
(let [version (make-version opts)
opts' (-> base-opts
(merge opts)
(assoc :version version))]
(bb/jar opts')))
(defn deploy
"Build and deploy the JAR to Clojars. Defaults to a snapshot,
specify :release true for a final release."
[opts]
(-> opts
jar
bb/deploy))