-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
56 lines (48 loc) · 1.6 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
(ns build
(:refer-clojure :exclude [compile])
(:require [clojure.tools.build.api :as b]))
(set! *warn-on-reflection* true)
(def lib 'com.s-exp/eddy)
(def version (format "1.0.0-alpha%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def jar-file (format "target/%s-%s.jar" (name lib) version))
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
(def copy-srcs ["src" "resources"])
(defn prep [_]
(b/write-pom {:class-dir class-dir
:lib lib
:version version
;; :scm {:tag (str "v" version)}
:basis basis
:src-dirs ["src"]})
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir}))
(defn clean
[_]
(b/delete {:path "target"}))
(defn clean "Remove the target folder." [_]
(println "\nCleaning target...")
(b/delete {:path "target"}))
(defn jar "Build the library JAR file." [_]
(println "\nWriting pom.xml...")
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:scm {:tag (str "v" version)}
:basis basis
:src-dirs ["src"]})
(println "Copying src...")
(b/copy-dir {:src-dirs ["src"]
:target-dir class-dir})
(println (str "Building jar " jar-file "..."))
(b/jar {:class-dir class-dir
:jar-file jar-file}))
(defn compile
[_]
(b/compile-clj {:basis basis
:src-dirs ["src"]
:class-dir class-dir}))
;; clj -T:build clean
;; clj -T:build prep
;; clj -T:build uber