-
Notifications
You must be signed in to change notification settings - Fork 83
/
build.boot
80 lines (65 loc) · 2.12 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
(set-env!
:resource-paths #{"src"}
:dependencies
'[[org.clojure/clojure "1.7.0"]
[com.google.auto.value/auto-value "1.2-rc1"]
[com.google.auto.service/auto-service "1.0-rc2"]
[javax.annotation/jsr250-api "1.0"]
[stencil "0.3.5"]
[com.google.android/android "4.1.1.4" :scope "test"]
[com.google.testing.compile/compile-testing "0.7" :scope "test"]
[adzerk/boot-test "1.0.7" :scope "test"]
[adzerk/bootlaces "0.1.13" :scope "test"]
])
(require
'[adzerk.boot-test :as test])
(ns-unmap 'boot.user 'test)
(deftask testing []
(set-env! :resource-paths #(conj % "test"))
identity)
(deftask test []
(comp (testing)
(test/test)))
(deftask autotest []
(comp (testing)
(watch)
(test/test)))
;; Deploy
(require
'[adzerk.bootlaces :refer :all]
'[clojure.java.shell :as shell]
'[clojure.string :as str])
(def +version+
(let [{:keys [exit out]} (shell/sh "git" "describe" "--tags")
tag (second (re-find #"v(.*)\n" out))]
(if (zero? exit)
(if (.contains tag "-")
(str tag "-SNAPSHOT")
tag)
"0.1.0-SNAPSHOT")))
(task-options!
pom {:project 'frankiesardo/auto-parcel
:version +version+
:description "AutoValue extensions that supports Parcelable generation"
:url "https://github.com/frankiesardo/auto-parcel"
:scm {:url "https://github.com/frankiesardo/auto-parcel"}
:license {"Eclipse Public License" "http://www.eclipse.org/legal/epl-v10.html"}})
(deftask build []
(comp (aot :all true) (javac) (pom) (jar) (install)))
(deftask clojars []
(comp (build)
(if (.endsWith +version+ "-SNAPSHOT")
(push-snapshot)
(push-release))))
(deftask init []
(with-pre-wrap fileset
(let [dotfiles (System/getenv "DOTFILES")
home (System/getenv "HOME")]
(println (:out (shell/sh "git" "clone" dotfiles (str home "/dotfiles"))))
(println (:out (shell/sh (str home "/dotfiles/init.sh")))))
fileset))
(deftask deploy []
(comp (init) (clojars)))
(bootlaces! +version+)
(task-options! push {:ensure-clean false
:tag false})