-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
136 lines (115 loc) · 3.57 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
; to make Cursive able to resolve symbols
(require '[boot.core :refer :all])
(set-env!
:project 'auth
:version "0.1.0-SNAPSHOT"
:dependencies
'[
; Common dependencies
[org.clojure/clojure "1.8.0"]
[hoplon/castra "3.0.0-alpha3"]
[philoskim/debux "0.2.0"]
; Backend dependencies
[com.novemberain/monger "3.0.2"]
[camel-snake-kebab "0.4.0"]
[org.clojure/data.json "0.2.6"]
[org.clojure/data.csv "0.1.3"]
[org.clojure/data.xml "0.0.8"]
[http-kit "2.1.18"]
[com.stuartsierra/component "0.3.1"]
[org.danielsz/system "0.3.0-SNAPSHOT"]
[environ "1.0.2"]
[danielsz/boot-environ "0.0.5"]
[ring "1.4.0"]
[ring/ring-defaults "0.2.0"]
[ring/ring-json "0.4.0"]
[ring.middleware.conditional "0.2.0"]
[jumblerg/ring.middleware.cors "1.0.1"]
[compojure "1.5.0"]
[buddy/buddy-auth "0.12.0"]
[buddy/buddy-sign "0.12.0"]
[midje "1.8.2" :scope "test"]
[zilti/boot-midje "0.2.1-SNAPSHOT" :scope "test"]
[ring/ring-mock "0.3.0" :scope "test"]
; Frontend dependencies
[org.clojure/clojurescript "1.8.40" :scope "test"]
[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[binaryage/devtools "0.6.1"]
[pandeiro/boot-http "0.7.3"]
[adzerk/boot-reload "0.4.7" :scope "test"]
[cljsjs/boot-cljsjs "0.5.1" :scope "test"]
[deraen/boot-less "0.5.0" :scope "test"]
[hoplon/boot-hoplon "0.1.13" :scope "test"]
[hoplon "6.0.0-alpha13"]
[cljsjs/auth0-lock "9.0.3-0"]
[org.slf4j/slf4j-nop "1.7.13" :scope "test"]]
:source-paths #{"src/be"}
:resource-paths #{"resources"})
; =============== Backend ===============
(require
'[system.repl :as repl :refer [system start stop go reset]]
'[danielsz.boot-environ :refer [environ]]
'[sys]
'[system.boot]
'[zilti.boot-midje])
(task-options!
speak {:theme "ordinance"}
; lein-generate gets the project name and version from here
pom {:project (get-env :project)
:version (get-env :version)})
;;; Copied from boot-test:
;;; This prevents a name collision WARNING between the test task and
;;; clojure.core/test, a function that nobody really uses or cares
;;; about.
(if ((loaded-libs) 'boot.user)
(ns-unmap 'boot.user 'test))
(alter-var-root #'midje.sweet/include-midje-checks (constantly false))
(deftask test []
(alter-var-root #'midje.sweet/include-midje-checks (constantly true))
(merge-env! :source-paths #{"test"})
(zilti.boot-midje/midje))
(deftask be "Back End" []
(comp
(environ :env {:http-port 9001})
(watch)
(system.boot/system
:sys #'sys/dev
:auto true
:files ["sys.clj"
"core.clj"
"node_mongo_store.clj"])
(repl :server true)))
; =============== Frontend ===============
(require
'[hoplon.boot-hoplon :refer [hoplon prerender html2cljs]]
'[adzerk.boot-reload :refer [reload]]
'[pandeiro.boot-http :refer [serve]]
'[adzerk.boot-cljs :refer [cljs]]
'[cljsjs.boot-cljsjs :refer [from-cljsjs]]
'[deraen.boot-less :refer [less]])
(task-options!
reload {:port 9003}
cljs {:compiler-options {:pseudo-names true
:parallel-build true}}
from-cljsjs {:profile :production}
cljs {:optimizations :advanced})
(deftask fe-build []
(set-env! :source-paths #{"src/fe/"})
(comp
(from-cljsjs)
(environ :env {:backend-url "http://localhost:9001"})
(less)
(hoplon :pretty-print true)
(reload)
(cljs)))
(deftask fe
[]
(task-options!
from-cljsjs {:profile :production}
cljs {:optimizations :none
:source-map true})
(comp
(watch)
(speak)
(fe-build)
(serve :port 9000)))