-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
135 lines (122 loc) · 5 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
(set-env!
; Test path can be included here as source-files are not included in JAR
; Just be careful to not AOT them
:source-paths #{"src/cljs" "src/scss" "test/clj" "test/cljs"}
:resource-paths #{"src/clj" "src/cljc"}
:dependencies '[[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.946" :scope "test"]
[devcards "0.2.4"]
[vvvvalvalval/scope-capture "0.1.0"]
[onetom/boot-lein-generate "0.1.3" :scope "test"]
[adzerk/boot-cljs "2.1.3" :scope "test"]
[crisptrutski/boot-cljs-test "0.3.4" :scope "test"]
[doo "0.1.7" :scope "test"]
[adzerk/boot-cljs-repl "0.3.3" :scope "test"]
[com.cemerick/piggieback "0.2.2" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/tools.nrepl "0.2.13" :scope "test"]
[adzerk/boot-reload "0.5.2" :scope "test"]
[metosin/boot-alt-test "0.3.2" :scope "test"]
[metosin/boot-deps-size "0.1.0" :scope "test"]
;; For boot-less
[org.slf4j/slf4j-nop "1.7.25" :scope "test"]
[deraen/boot-sass "0.3.1" :scope "test"]
; Backend
[http-kit "2.2.0"]
[org.clojure/tools.namespace "0.3.0-alpha4"]
[reloaded.repl "0.2.3"]
[com.stuartsierra/component "0.3.2"]
[metosin/ring-http-response "0.9.0"]
[ring/ring-core "1.6.2"]
[ring/ring-defaults "0.3.1"]
[javax.servlet/servlet-api "2.5"] ;; Required by ring multipart middleware
[compojure "1.6.0"]
[hiccup "1.0.5"]
[org.clojure/math.combinatorics "0.1.4"]
; Frontend
[reagent "0.8.0-alpha2"]
[binaryage/devtools "0.9.4" :scope "test"]
[cljsjs/babel-standalone "6.18.1-3" :scope "test"]
; LESS
[org.webjars/bootstrap "3.3.7-1"]
; SASS
[org.webjars.bower/bootstrap "4.0.0-alpha.6" :exclusions [org.webjars.bower/jquery]]])
(require
'boot.lein
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl repl-env]]
'[adzerk.boot-reload :refer [reload]]
'[metosin.boot-alt-test :refer [alt-test]]
'[metosin.boot-deps-size :refer [deps-size]]
'[deraen.boot-sass :refer [sass]]
'[crisptrutski.boot-cljs-test :refer [test-cljs]]
'[backend.boot :refer [start-app]]
'[reloaded.repl :refer [go reset start stop system]])
(boot.lein/generate)
(task-options!
pom {:project 'saapas
:version "0.1.0-SNAPSHOT"
:description "Application template for Cljs/Om with live reloading, using Boot."
:license {"The MIT License (MIT)" "http://opensource.org/licenses/mit-license.php"}}
aot {:namespace #{'backend.main}}
jar {:main 'backend.main}
sass {:source-map true})
(deftask dev
"Start the dev env..."
[s speak bool "Notify when build is done"
p port PORT int "Port for web server"
t test-cljs bool "Compile and run cljs tests"]
(comp
(watch)
(reload :ids #{"js/main"})
(sass)
; This starts a repl server with piggieback middleware
(cljs-repl :ids #{"js/main"})
(cljs :ids #{"js/main"})
;; Remove cljs output from classpath but keep with in fileset with output role
(sift :to-asset #{#"^js/.*"})
;; Write the resources to filesystem for dev server
(target :dir #{"dev-output"})
(start-app :port port)
(if speak (boot.task.built-in/speak) identity)))
(deftask devcards
"Start the dev env..."
[s speak bool "Notify when build is done"
p port PORT int "Port for web server"
t test-cljs bool "Compile and run cljs tests"]
(comp
(watch)
(reload :ids #{"js/devcards"})
(sass)
; This starts a repl server with piggieback middleware
(cljs-repl :ids #{"js/devcards"})
(cljs :ids #{"js/devcards"})
;; Remove cljs output from classpath but keep with in fileset with output role
(sift :to-asset #{#"^js/.*"})
;; Write the resources to filesystem for dev server
(target :dir #{"dev-output"})
(start-app :port port)
(if speak (boot.task.built-in/speak) identity)))
(ns-unmap *ns* 'test)
(deftask test
[]
(comp
(alt-test)
;; FIXME: This is not a good place to define which namespaces to test
(test-cljs :namespaces #{"frontend.core-test"})))
(deftask autotest []
(comp
(watch)
(test)))
(deftask package
"Build the package"
[]
(comp
(cljs :optimizations :advanced
:compiler-options {:preloads nil})
(aot)
(pom)
(uber)
(jar :file "saapas.jar")
(sift :include #{#".*\.jar"})
(target)))