-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
91 lines (73 loc) · 2.68 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
(require '[clojure.edn :as edn])
(def project (-> "project.edn" slurp edn/read-string))
(def version "0.1.1")
(set-env! :dependencies '[[adzerk/boot-test "RELEASE" :scope "test"]
[boot-codox "0.10.3" :scope "test"]
[boot-fmt "0.1.6" :scope "test"]
[metosin/boot-alt-test "0.3.2" :scope "test"]
[seancorfield/boot-tools-deps "0.3.0" :scope "test"
:exclusions [ch.qos.logback/logback-classic
org.clojure/clojure]]
[zprint "0.4.2" :scope "test"
:exclusions [org.clojure/clojure]]])
(require '[boot-tools-deps.core :refer [deps load-deps]])
(task-options!
pom (constantly (assoc project :version version)))
(deftask build
"Build and install the project locally."
[]
(comp (deps) (pom) (javac) (jar) (install)))
;;; testing
(require '[adzerk.boot-test :as boot-test])
(deftask test
[]
(comp (deps :aliases [:test] :overwrite-boot-deps true)
(javac)
(boot-test/test)))
(require '[metosin.boot-alt-test :as boot-alt-test])
(deftask alt-test
[]
(comp (deps :aliases [:test]
:quick-merge true)
(watch)
(javac)
(boot-alt-test/alt-test)))
;;; code formating
(require '[boot-fmt.core :as fmt])
(task-options!
fmt/fmt {:options {:style :community
:extend {:flow? true
:indent 2
:nl-separator? true}
:fn-map {":import" :flow
":require" :flow
"and" :force-nl-body
"defprotocol" :arg1-body
"merge" :hang
"or" :force-nl-body
"try" :flow-body
"comment" :flow-body}
:list {:indent-arg 1}
:map {:justify? true}
:pair {:justify? true}
:set {:wrap? nil}
:vector {:wrap? nil}}
:files #{"src"}
:mode :diff})
(deftask fmt
"format"
[]
(comp (deps :aliases [:test :bench]) (fmt/fmt)))
;;; documentation
(require '[codox.boot :refer [codox]])
(task-options!
codox {:version version
:source-paths (get-env :resource-paths)
:name (name (:project project))
:output-path "codox"})
(deftask docs
"generate html documentation"
[]
(comp (deps :quick-merge true)
(codox)
(target)))