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