-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.boot
130 lines (114 loc) · 4.55 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
(set-env!
:source-paths #{"sass" "src/cljs"}
:dependencies '[[adzerk/boot-cljs "2.1.5" :scope "test"]
[adzerk/boot-cljs-repl "0.4.0" :scope "test"]
[adzerk/boot-reload "0.6.0" :scope "test"]
[pandeiro/boot-http "0.8.3" :scope "test"]
[cider/piggieback "0.4.1" :scope "test"]
[com.cemerick/url "0.1.1"]
[nrepl "0.4.5" :scope "test"]
[org.clojure/test.check "0.9.0" :exclude [org.clojure/clojure] :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/clojurescript "1.10.520"]
[binaryage/dirac "RELEASE" :scope "test"]
[crisptrutski/boot-cljs-test "0.3.4" :scope "test"]
[org.omcljs/om "1.0.0-beta4"]
[deraen/boot-sass "0.3.1" :scope "test"]
[prismatic/plumbing "0.5.5"]
[funcool/cuerdas "2.2.0"]
[secretary "1.2.3"]
[binaryage/dirac "1.2.15" :scope "test"]
[powerlaces/boot-cljs-devtools "0.2.0" :scope "test"]
[org.slf4j/slf4j-nop "1.7.25" :scope "test"]])
(require
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[adzerk.boot-reload :refer [reload]]
'[pandeiro.boot-http :refer [serve]]
'[crisptrutski.boot-cljs-test :refer [test-cljs]]
'[deraen.boot-sass :refer [sass]]
'[powerlaces.boot-cljs-devtools :refer [cljs-devtools]])
(task-options! repl {:eval '(do (require 'dirac.agent)
(dirac.agent/boot!))})
(deftask build []
(comp (speak)
(cljs)
(sass)))
(deftask run []
(comp (serve)
(watch)
(cljs-repl :nrepl-opts {:port 8230
:middleware '[dirac.nrepl/middleware]}
:port 9009)
(reload)
(build)))
(deftask production []
(task-options!
cljs {:optimizations :simple
:compiler-options {:parallel-build true
:compiler-stats true
:pretty-print false}}
sass {:output-style :compressed})
identity)
(deftask player-development []
(set-env! :resource-paths #(into % #{"dev-resources" "player-resources"}))
(task-options! reload {:on-jsload 'saga.player/init}
cljs {:optimizations :none
:compiler-options
{:asset-path "js/player.out"
:source-map true
:source-map-timestamp true
:preloads '[dirac.runtime.preload]
:parallel-build true
:cache-analysis true}})
identity)
(deftask ide-development []
(set-env! :resource-paths #(into % #{"dev-resources" "ide-resources"}))
(task-options! cljs {:optimizations :none
:compiler-options
{:source-map true
:source-map-timestamp true
:asset-path "js/ide.out"
:preloads '[dirac.runtime.preload]
:parallel-build true
:cache-analysis true}}
reload {:on-jsload 'saga.ide/init})
identity)
(deftask package [t build-target VAL str "The target to build. Can be 'ide' or 'player'"]
(set-env! :resource-paths #(conj % (str build-target "-resources")))
(comp
(production)
(cljs :ids #{(str "js/" build-target)})
(sass)
(sift :include #{#"cache\.manifest"
#"css\/fonts\.css"
#"css\/material\.css"
#"js\/material\.js"
#"index.html"
(re-pattern (str "css/" build-target "\\.css"))
(re-pattern (str "js/" build-target "\\.js"))})
(target :dir #{(str "target-" build-target)})))
(deftask player-dev
"Simple alias to run application in development mode"
[]
(comp (player-development)
(run)))
(deftask ide-dev
[]
(comp (ide-development)
(run)))
(deftask testing []
(set-env! :source-paths #(conj % "test/cljs"))
identity)
;;; This prevents a name collision WARNING between the test task and
;;; clojure.core/test, a function that nobody really uses or cares
;;; about.
(ns-unmap 'boot.user 'test)
(deftask test []
(comp (testing)
(test-cljs :js-env :phantom
:exit? true)))
(deftask auto-test []
(comp (testing)
(watch)
(test-cljs :js-env :phantom)))