|
45 | 45 | :id id)) |
46 | 46 | ids)) |
47 | 47 |
|
48 | | -(defn start-cljs-repl [] |
49 | | - (hawk/watch! [{:paths ["resources"] |
50 | | - :handler (fn [ctx e] |
51 | | - (let [path "src/status_im/utils/js_resources.cljs" |
52 | | - js-resourced (slurp path)] |
53 | | - (spit path (str js-resourced " ;;")) |
54 | | - (spit path js-resourced)) |
55 | | - ctx)}]) |
56 | | - (let [build-ids (if *command-line-args* |
57 | | - (map keyword *command-line-args*) |
58 | | - [:android]) |
59 | | - ;; read project.clj to get build configs |
60 | | - profiles (->> "project.clj" |
61 | | - slurp |
62 | | - read-string |
63 | | - (drop-while #(not= % :profiles)) |
64 | | - (apply hash-map) |
65 | | - :profiles) |
66 | | - cljs-builds (get-in profiles [:dev :cljsbuild :builds]) |
67 | | - builds (get-builds build-ids cljs-builds)] |
68 | | - (start-figwheel build-ids builds) |
69 | | - (rfs/-main)) |
70 | | - (ra/cljs-repl)) |
| 48 | +(defn start |
| 49 | + ([] |
| 50 | + (start (if *command-line-args* |
| 51 | + (map keyword *command-line-args*) |
| 52 | + [:android]))) |
| 53 | + ([build-ids] |
| 54 | + (hawk/watch! [{:paths ["resources"] |
| 55 | + :handler (fn [ctx e] |
| 56 | + (let [path "src/status_im/utils/js_resources.cljs" |
| 57 | + js-resourced (slurp path)] |
| 58 | + (spit path (str js-resourced " ;;")) |
| 59 | + (spit path js-resourced)) |
| 60 | + ctx)}]) |
| 61 | + ;; read project.clj to get build configs |
| 62 | + (let [profiles (->> "project.clj" |
| 63 | + slurp |
| 64 | + read-string |
| 65 | + (drop-while #(not= % :profiles)) |
| 66 | + (apply hash-map) |
| 67 | + :profiles) |
| 68 | + cljs-builds (get-in profiles [:dev :cljsbuild :builds]) |
| 69 | + builds (get-builds build-ids cljs-builds)] |
| 70 | + (start-figwheel build-ids builds) |
| 71 | + (rfs/-main)))) |
71 | 72 |
|
72 | | -(start-cljs-repl) |
| 73 | +(def stop ra/stop-figwheel!) |
| 74 | + |
| 75 | +(def start-cljs-repl ra/cljs-repl) |
0 commit comments