-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.boot
118 lines (107 loc) · 3.79 KB
/
build.boot
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
(set-env!
:resource-paths #{"src"}
:dependencies
'[;; Clojure
[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.9.908"]
;; Boot commands
[boot-codox "0.10.3" :scope "test"]
[pandeiro/boot-http "0.8.3" :scope "test"]
[adzerk/boot-reload "0.5.2" :scope "test"]
[adzerk/boot-cljs "2.1.4" :scope "test"]
[adzerk/bootlaces "0.1.13" :scope "test"]
[adzerk/boot-cljs-repl "0.3.3" :scope "test"]
;; boot-cljs-repl deps
[com.cemerick/piggieback "0.2.2" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/tools.nrepl "0.2.13" :scope "test"]
;; Production Dependencies
[reagent "0.7.0"]]
:site-dependencies
'[[devcards "0.2.1-7" :exclusions [cljsjs/react cljsjs/react-dom]]
[data-frisk-reagent "0.2.5"]
[fipp "0.6.6"]])
(require '[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[adzerk.boot-reload :refer [reload]]
'[adzerk.bootlaces :refer [bootlaces!]]
'[pandeiro.boot-http :refer [serve]]
'[codox.boot :refer [codox]])
(import java.io.File)
(defn site-env! []
(merge-env! :dependencies (get-env :site-dependencies)
:resource-paths #{"resources"}))
(def +target-dir+ "target")
(def +public-dir+ "public")
(def +codox-dir+ "codox")
(def +version+ "0.6.1")
(bootlaces! +version+)
(task-options!
target {:dir #{+target-dir+}}
serve {:port 3550
:dir +target-dir+}
push {:repo "clojars"
;;:ensure-clean false
}
pom {:project 'reanimated
:version +version+
:description "Reanimated is an animation library for Reagent (ClojureScript)."
:url "http://github.com/timothypratley/reanimated"
:scm {:name "git" :url "https://github.com/timothypratley/reanimated"}
:license {"Eclipse Public License" "http://www.eclipse.org/legal/epl-v10.html"}}
jar {:main 'reanimated.core}
codox {:name "reanimated"
:language :clojurescript
:output-path +codox-dir+
:source-paths #{"src/reanimated"}})
(deftask docs
"Generates codox docs"
[w write bool "Write the docs to the public dir?"]
(comp (sift :include [#"reanimated"])
(codox)
(target :dir #{+public-dir+}
:no-clean true)))
(deftask dev
"Start hot reload dev server."
[p port VAL int "Port to serve files on"]
(when port
(task-options! serve {:port port}))
(site-env!)
(comp (serve)
(watch)
(reload :on-jsload 'examples.core/on-jsload)
(cljs-repl)
(cljs :optimizations :none
:compiler-options {:devcards true})
(target)))
(deftask site
"Build clojurescript needed for site in production, using advanced compilation."
[]
(site-env!)
(comp (cljs :optimizations :advanced
:compiler-options {:devcards true})
(sift :invert true :include #{#"main\.out"})
(target :dir #{+public-dir+})
(docs)))
(deftask lib
"Package library code into a jar, ignoring dev & site code."
[]
(comp
(sift :include [#"reanimated"])
(pom)
(jar)
(target)))
(configure-repositories!
(fn [m]
(merge m (some (fn [[regex cred]] (if (re-find regex (:url m)) cred))
(gpg-decrypt
(clojure.java.io/file
(System/getProperty "user.home") ".lein/credentials.clj.gpg")
:as :edn)))))
(deftask release []
;; Push keys need to be handled somehow
;; https://github.com/boot-clj/boot/wiki/Repository-Credentials-and-Deploying
(set-env! :repositories [["clojars" {:url "https://clojars.org/repo/"
:username (System/getenv "CLOJARS_USER")
:password (System/getenv "CLOJARS_PASS")}]])
(push))