Improve custom figwheel script usability
Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
This commit is contained in:
parent
f90e1a4ed3
commit
fe315c619a
|
@ -45,7 +45,12 @@
|
|||
:id id))
|
||||
ids))
|
||||
|
||||
(defn start-cljs-repl []
|
||||
(defn start
|
||||
([]
|
||||
(start (if *command-line-args*
|
||||
(map keyword *command-line-args*)
|
||||
[:android])))
|
||||
([build-ids]
|
||||
(hawk/watch! [{:paths ["resources"]
|
||||
:handler (fn [ctx e]
|
||||
(let [path "src/status_im/utils/js_resources.cljs"
|
||||
|
@ -53,11 +58,8 @@
|
|||
(spit path (str js-resourced " ;;"))
|
||||
(spit path js-resourced))
|
||||
ctx)}])
|
||||
(let [build-ids (if *command-line-args*
|
||||
(map keyword *command-line-args*)
|
||||
[:android])
|
||||
;; read project.clj to get build configs
|
||||
profiles (->> "project.clj"
|
||||
(let [profiles (->> "project.clj"
|
||||
slurp
|
||||
read-string
|
||||
(drop-while #(not= % :profiles))
|
||||
|
@ -66,7 +68,8 @@
|
|||
cljs-builds (get-in profiles [:dev :cljsbuild :builds])
|
||||
builds (get-builds build-ids cljs-builds)]
|
||||
(start-figwheel build-ids builds)
|
||||
(rfs/-main))
|
||||
(ra/cljs-repl))
|
||||
(rfs/-main))))
|
||||
|
||||
(start-cljs-repl)
|
||||
(def stop ra/stop-figwheel!)
|
||||
|
||||
(def start-cljs-repl ra/cljs-repl)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
(ns dev-run
|
||||
(:use [figwheel-api]))
|
||||
|
||||
(start)
|
||||
(start-cljs-repl)
|
|
@ -19,7 +19,7 @@
|
|||
["do" "clean"
|
||||
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
||||
["with-profile" "prod" "cljsbuild" "once" "android"]]
|
||||
"figwheel-repl" ["run" "-m" "clojure.main" "env/dev/figwheel_api.clj"]
|
||||
"figwheel-repl" ["run" "-m" "clojure.main" "env/dev/run.clj"]
|
||||
"test-cljs" ["with-profile" "test" "doo" "node" "test" "once"]
|
||||
"test-protocol" ["with-profile" "test" "doo" "node" "protocol" "once"]}
|
||||
:figwheel {:nrepl-port 7888}
|
||||
|
|
Loading…
Reference in New Issue