-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.boot
executable file
·78 lines (70 loc) · 2.89 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
(set-env!
:source-paths #{"src" "support"}
:resource-paths #{"resources"}
:exclusions ['cljsjs/react]
:dependencies '[[mattsum/boot-react-native "0.2-SNAPSHOT" :scope "test"]
[adzerk/boot-cljs "1.7.228-1" :scope "test"]
[adzerk/boot-cljs-repl "0.3.0" :scope "test"]
[adzerk/boot-reload "0.4.8" :scope "test"]
[pandeiro/boot-http "0.7.3" :scope "test"]
[crisptrutski/boot-cljs-test "0.2.1-SNAPSHOT" :scope "test"]
[com.cemerick/piggieback "0.2.1" :scope "test"]
[weasel "0.7.0" :scope "test"]
[org.clojure/tools.nrepl "0.2.12" :scope "test"]
;; project deps
[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[reagent "0.5.1"]
;; [react-native-externs "0.0.1-SNAPSHOT"]
[rum "0.9.0" :exclusions [cljsjs/react cljsjs/react-dom sablono]]
[griebenschmalz "0.5.0-SNAPSHOT"]
[funcool/beicon "1.4.0"]])
(require
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
'[adzerk.boot-reload :refer [reload]]
'[crisptrutski.boot-cljs-test :as test :refer [test-cljs]]
'[pandeiro.boot-http :refer [serve]]
'[boot.core :as b]
'[boot.util :as u]
'[clojure.string :as s]
'[mattsum.boot-react-native :as rn])
(deftask build
[p platform PLATFORM kw "The platform to target (ios or android)"]
[]
(assert (or (nil? platform) (#{:ios :android} platform)))
(comp
(if (= :ios platform) (rn/run-in-simulator) identity)
(reload :on-jsload 'postal-messenger.app.core/on-js-reload
:port 8079
:ws-host "localhost"
)
(rn/before-cljsbuild)
(cljs-repl :ws-host "localhost"
:port 9001
:ip "0.0.0.0")
(cljs :ids #{"main"})
(rn/after-cljsbuild :server-url "localhost:8081")
(if (= :ios platform) (rn/print-ios-log :grep "PostalMessenger") identity)
(if (= :android platform) (rn/print-android-log) identity)
(speak)
(target :dir ["app/build"])))
(deftask dev
"Build app and watch for changes"
[p platform PLATFORM kw "The platform to target (ios or android)"]
[]
(comp (watch)
(if platform (build :platform platform) (build))))
(deftask packager
[]
(watch)
(rn/start-rn-packager))
(defn ^:private file-by-path [path fileset]
(b/tmp-file (get (:tree fileset) path)))
(deftask dist
"Build a distributable bundle of the app"
[]
(comp
(cljs :ids #{"dist"})
(rn/bundle :files {"dist.js" "main.jsbundle"})
(target :dir ["app/dist"])))