aboutsummaryrefslogtreecommitdiff
path: root/build.clj
blob: 5535bc756ff7c1cafc2f4ee941bd3e8210dee5c1 (plain)
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
(ns build
  (:require
   [shadow.cljs.devtools.api :as shadow]
   [clojure.tools.build.api :as b]))

(def lib 'tubo)
(def version (format "0.1.%s" (b/git-count-revs nil)))
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file (format "target/%s-%s.jar" (name lib) version))

(defn clean
  [_]
  (b/delete {:path "target"}))

(defn aot-compile
  [_]
  (println "Compiling AOT namespaces...")
  (b/compile-clj {:basis      basis
                  :src-dir    ["src"]
                  :class-dir  class-dir
                  :ns-compile ['tubo.downloader-impl]})
  (println "Compiled AOT namespaces"))

(defn uberjar
  [_]
  (clean nil)
  (aot-compile nil)
  (b/copy-dir {:src-dirs   ["src/clj" "resources"]
               :target-dir class-dir})
  (b/compile-clj {:basis     basis
                  :src-dir   ["src"]
                  :class-dir class-dir})
  (shadow/release :tubo)
  (b/uber {:class-dir class-dir
           :uber-file uber-file
           :basis     basis
           :main      'tubo.core})
  (println "Uberjar: " uber-file))