-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.clj
31 lines (23 loc) · 1.04 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
(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"
:aliases [:native]}))
(def app-name "chat-sdlc")
(def uber-file-name (format "%s/%s-standalone.jar" build-folder app-name)) ; path for result uber file
(defn clean [_]
(b/delete {:path "target"})
(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 'docker.main}) ; here we specify the entry point for uberjar
(println (format "Uber file created: \"%s\"" uber-file-name)))