-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.clj
31 lines (26 loc) · 967 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
(ns build
(:require [clojure.tools.build.api :as b]))
(def build-folder "target")
(def jar-content (str build-folder "/classes"))
(def basis (b/create-basis {:project "deps.edn"}))
(def app-name "dativebase")
(def uber-file-name (format "%s/%s-standalone.jar" build-folder app-name))
(defn clean [_]
(b/delete {:path "target"})
(println (format "Build folder \"%s\" removed" build-folder)))
(defn uber [_]
(clean nil)
;; copy resources
(b/copy-dir {:src-dirs ["resources"]
:target-dir jar-content})
;; compile the Clojure code
(b/compile-clj {:basis basis
:src-dirs ["src"]
:class-dir jar-content})
;; create the uber file
(b/uber {:class-dir jar-content
:uber-file uber-file-name
:basis basis
;; here we specify the entry point for uberjar:
:main 'dvb.server.core})
(println (format "Uber file created: \"%s\"" uber-file-name)))