-
Notifications
You must be signed in to change notification settings - Fork 89
/
build.boot
155 lines (130 loc) · 6.2 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
(def +version+ "0.1.18")
;; -- since boot is no more, this file will go away
;; -- once deps.edn "learns" how to run all cljs tests
;; j8; boot test
;; j8; boot test-cljs
;; j8; boot test-cljs-advanced
;; j8; boot -v build-jar push-snapshot
;; j8; boot -v build-jar push-release
(set-env!
:source-paths #{"src"}
:resource-paths #{"resources"}
:dependencies '[;; mount brings _NO DEPENDENCIES_, everything here is for
;; mount dev, examples apps and tests
[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.7.228" :scope "provided" :classifier "aot"]
[datascript "0.15.0" :scope "provided"]
[compojure "1.5.0" :scope "provided"]
[ring/ring-jetty-adapter "1.1.0" :scope "provided"]
[cheshire "5.5.0" :scope "provided"]
[hiccups "0.3.0" :scope "provided" :exclusions [org.clojure/clojurescript]]
[com.andrewmcveigh/cljs-time "0.3.14" :scope "provided"]
[tolitius/yang "0.1.9" :scope "provided"]
[ch.qos.logback/logback-classic "1.1.3" :scope "provided"]
[org.clojure/tools.logging "0.3.1" :scope "provided"]
[robert/hooke "1.3.0" :scope "provided"]
[org.clojure/tools.namespace "0.2.11" :scope "provided"]
[org.clojure/tools.nrepl "0.2.12" :scope "provided"]
[com.datomic/datomic-free "0.9.5359" :scope "provided" :exclusions [joda-time]]
;; proto repl for fun and joy
[proto-repl "0.3.1" :scope "provided"]
[proto-repl-charts "0.3.2" :scope "provided"]
;; boot clj
[boot/core "2.7.1" :scope "provided"]
[adzerk/bootlaces "0.1.13" :scope "test"]
[adzerk/boot-logservice "1.2.0" :scope "test"]
[adzerk/boot-test "1.1.1" :scope "test"]
[tolitius/boot-check "0.1.2" :scope "test"]
;; boot cljs
[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[adzerk/boot-cljs-repl "0.4.0" :scope "test"]
[cider/piggieback "0.3.9" :scope "test" :exclusions [org.clojure/clojurescript]]
[weasel "0.7.0" :scope "test" :exclusions [org.clojure/clojurescript]]
[nrepl "0.4.5" :scope "test"]
[pandeiro/boot-http "0.7.1-SNAPSHOT" :scope "test"]
[tolitius/boot-stripper "0.1.0-SNAPSHOT" :scope "test"]
[adzerk/boot-reload "0.4.8" :scope "test"]
[crisptrutski/boot-cljs-test "0.2.1-SNAPSHOT" :scope "test"]])
(require '[adzerk.bootlaces :refer :all]
'[adzerk.boot-test :as bt]
'[adzerk.boot-logservice :as log-service]
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[adzerk.boot-reload :refer [reload]]
'[tolitius.boot-check :as check]
'[tolitius.boot-stripper :refer [strip-deps-attr]]
'[pandeiro.boot-http :refer :all]
'[crisptrutski.boot-cljs-test :as tcs]
'[clojure.tools.logging :as log]
'[clojure.tools.namespace.repl :refer [set-refresh-dirs]])
(bootlaces! +version+)
(def log4b
[:configuration
[:appender {:name "STDOUT" :class "ch.qos.logback.core.ConsoleAppender"}
[:encoder [:pattern "%-5level %logger{36} - %msg%n"]]]
[:root {:level "TRACE"}
[:appender-ref {:ref "STDOUT"}]]])
(deftask dev []
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))
(alter-var-root #'log/*logger-factory*
(constantly (log-service/make-factory log4b)))
(apply set-refresh-dirs (get-env :directories))
(load-data-readers!)
(require 'dev)
(in-ns 'dev))
(deftask test []
(set-env! :source-paths #(conj % "test/core" "test/clj")) ;; (!) :source-paths must not overlap.
(bt/test))
(deftask test-cljs []
(set-env! :source-paths #(conj % "test/core" "test/cljs"))
(set-env! :resource-paths #{"test/resources"})
(require '[mount.core])
(comp
(strip-deps-attr :attr :classifier :value "aot")
(tcs/test-cljs ;; :optimizations :advanced
:out-file "mount.js")))
(deftask test-cljs-advanced []
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))
(set-env! :resource-paths #{"dev/resources"})
(comp
(cljs :optimizations :advanced :ids #{"mount"})))
(deftask check-sources []
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs" "test/core" "test/clj" "test/cljs"))
;; (load-data-readers!)
(comp
(check/with-bikeshed)
(check/with-eastwood)
;; (check/with-yagni) ;; yagni does not yet support (throws on) "cljc"
(check/with-kibit)))
(deftask cljs-dev
"mount cljs dev example"
[]
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))
(set-env! :resource-paths #{"dev/resources"})
(comp
(serve :dir "dev/resources/public/")
(watch)
(reload)
(cljs-repl)
(cljs :optimizations :none :ids #{"mount"})))
(deftask cljs-example
"mount cljs example"
[]
(set-env! :source-paths #(conj % "dev/clj" "dev/cljs"))
(set-env! :resource-paths #{"dev/resources"})
(comp
(wait)
(serve :dir "dev/resources/public/")
(cljs-repl)
(cljs :optimizations :advanced :ids #{"mount"})))
(task-options!
tcs/test-cljs {:js-env :phantom}
push {; :ensure-clean nil
:ensure-branch nil}
pom {:project 'mount
:version +version+
:description "managing Clojure and ClojureScript app state since (reset)"
:url "https://github.com/tolitius/mount"
:scm {:url "https://github.com/tolitius/mount"}
:license {"Eclipse Public License"
"http://www.eclipse.org/legal/epl-v10.html"}})