-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.clj
41 lines (36 loc) · 1.3 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
(ns build
(:require [clojure.string :as string]
[clojure.tools.build.api :as b]))
(def lib 'io.github.kit/gif2html)
(def main-cls (string/join "." (filter some? [(namespace lib) (name lib) "core"])))
(def version (format "0.0.1-SNAPSHOT"))
(def target-dir "target")
(def class-dir (str target-dir "/" "classes"))
(def uber-file (format "%s/%s-standalone.jar" target-dir (name lib)))
(def basis (b/create-basis {:project "deps.edn"}))
(defn clean
"Delete the build target directory"
[_]
(println (str "Cleaning " target-dir))
(b/delete {:path target-dir}))
(defn prep [_]
(println "Writing Pom...")
(b/write-pom {:class-dir class-dir
:lib lib
:version version
:basis basis
:src-dirs ["src/clj"]})
(b/copy-dir {:src-dirs ["src/clj" "resources" "env/prod/resources" "env/prod/clj"]
:target-dir class-dir}))
(defn uber [_]
(println "Compiling Clojure...")
(b/compile-clj {:basis basis
:src-dirs ["src/clj" "resources" "env/prod/resources" "env/prod/clj"]
:class-dir class-dir})
(println "Making uberjar...")
(b/uber {:class-dir class-dir
:uber-file uber-file
:main main-cls
:basis basis}))
(defn all [_]
(do (clean nil) (prep nil) (uber nil)))