This repository has been archived by the owner on Oct 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.boot
164 lines (148 loc) · 5.46 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
(set-env!
:dependencies '[[buddy "2.0.0"]
[ch.qos.logback/logback-classic "1.2.3"]
[clj-time "0.14.2"]
[compojure "1.6.0"]
[conman "0.7.4"]
[cprop "0.1.11"]
[day8.re-frame/http-fx "0.1.4"]
[luminus-http-kit "0.1.5"]
[luminus-migrations "0.4.3"]
[luminus-nrepl "0.1.4"]
[luminus/ring-ttl-session "0.3.2"]
[markdown-clj "1.0.1"]
[metosin/compojure-api "1.1.11"]
[metosin/muuntaja "0.4.1"]
[metosin/ring-http-response "0.9.0"]
[mount "0.1.11"]
[org.clojure/clojure "1.9.0"]
[org.clojure/tools.cli "0.3.5"]
[org.clojure/tools.logging "0.4.0"]
[org.clojure/tools.reader "1.1.1"]
[org.postgresql/postgresql "42.1.4"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.6.3"]
[ring/ring-defaults "0.3.1"]
[selmer "1.11.3"]
; Both client and server
[com.rpl/specter "1.0.3"]
[funcool/struct "1.1.0"]
; Client deps
[cljs-ajax "0.7.3"]
[cljs-react-material-ui "0.2.50"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[cljsjs/material-ui "0.19.2-0"]
[org.clojure/clojurescript "1.9.946" :scope "provided"]
[org.webjars.bower/tether "1.4.0"]
[org.webjars/bootstrap "4.0.0-beta.2"]
[org.webjars/font-awesome "4.7.0"]
[re-com "2.1.0"]
[re-frame "0.10.2"]
[re-frisk "0.5.3"]
[reagent "0.7.0"]
[reagent-utils "0.2.1"]
[secretary "1.2.3"]
; Boot deps
[crisptrutski/boot-cljs-test "0.3.4" :scope "test"]
[deraen/boot-sass "0.3.1" :scope "test"]
[adzerk/boot-cljs "2.1.4" :scope "test"]
[adzerk/boot-cljs-repl "0.3.3" :scope "test"]
[onetom/boot-lein-generate "0.1.3" :scope "test"]]
:source-paths #{"src/cljs" "src/cljc" "src/clj"}
:resource-paths #{"resources"})
(require '[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl]])
(require '[deraen.boot-sass :refer [sass]])
(deftask dev
"Enables configuration for a development setup."
[]
(set-env!
:source-paths #(conj % "env/dev/clj" "src/cljs" "src/cljc" "env/dev/cljs")
:resource-paths #(conj % "env/dev/resources")
:dependencies
#(concat % '[[prone "1.1.4"]
[ring/ring-mock "0.3.0"]
[ring/ring-devel "1.6.1"]
[pjstadig/humane-test-output "0.8.2"]
[binaryage/devtools "0.9.7"]
[com.cemerick/piggieback "0.2.2"]
[crisptrutski/boot-cljs-test "0.3.2-SNAPSHOT" :scope "test"]
[doo "0.1.8"]
[figwheel-sidecar "0.5.14"]
[org.clojure/clojurescript cljs-version :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
[pandeiro/boot-http "0.7.6" :scope "test"]
[powerlaces/boot-figreload "0.1.1-SNAPSHOT" :scope "test"]
[weasel "0.7.0" :scope "test"]]))
(System/setProperty "database-url"
"postgres://hermes@localhost:5432/hermes_dev")
(task-options!
repl {:init-ns 'user}
())
(require 'pjstadig.humane-test-output)
(let [pja (resolve 'pjstadig.humane-test-output/activate!)]
(pja))
identity)
(deftask testing
"Enables configuration for testing."
[]
(dev)
(set-env! :resource-paths #(conj % "env/test/resources"))
(merge-env! :source-paths ["src/cljc" "src/cljs" "test/cljs"])
identity)
(deftask prod
"Enables configuration for production building."
[]
(merge-env! :source-paths #{"env/prod/clj" "env/prod/cljs"}
:resource-paths #{"env/prod/resources"})
identity)
(deftask start-server
"Runs the project without building class files.
This does not pause execution. Combine with a wait task or use the \"run\"
task."
[]
(require 'hermes.core)
(let [start-app (resolve 'hermes.core/start-app)]
(with-pass-thru _
(start-app nil))))
(deftask run
"Starts the server and causes it to wait."
[]
(comp
(start-server)
(wait)))
(require '[clojure.java.io :as io])
(require '[crisptrutski.boot-cljs-test :refer [test-cljs]])
(deftask figwheel
"Runs figwheel and enables reloading."
[]
(dev)
(require '[powerlaces.boot-figreload :refer [reload]])
(let [reload (resolve 'powerlaces.boot-figreload/reload)]
(comp
(start-server)
(watch)
(cljs-repl :nrepl-opts {:port 7002})
(reload :client-opts {:debug true})
;(speak) ; This is REALLY annoying
(cljs))))
(deftask run-cljs-tests
"Runs the doo tests for ClojureScript."
[]
(comp
(testing)
(test-cljs :cljs-opts {:output-to "target/test.js", :main "hermes.doo-runner", :optimizations :whitespace, :pretty-print true})))
(deftask uberjar
"Builds an uberjar of this project that can be run with java -jar"
[]
(comp
(prod)
(aot :namespace #{'hermes.core})
(cljs :optimizations :advanced)
(uber)
(jar :file "hermes.jar" :main 'hermes.core)
(sift :include #{#"hermes.jar"})
(target)))
(require 'boot.lein)
(deftask generate-lein []
(boot.lein/generate))