mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
Improve custom figwheel script usability
Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
This commit is contained in:
parent
f90e1a4ed3
commit
fe315c619a
51
env/dev/figwheel_api.clj
vendored
51
env/dev/figwheel_api.clj
vendored
@ -45,28 +45,31 @@
|
|||||||
:id id))
|
:id id))
|
||||||
ids))
|
ids))
|
||||||
|
|
||||||
(defn start-cljs-repl []
|
(defn start
|
||||||
(hawk/watch! [{:paths ["resources"]
|
([]
|
||||||
:handler (fn [ctx e]
|
(start (if *command-line-args*
|
||||||
(let [path "src/status_im/utils/js_resources.cljs"
|
(map keyword *command-line-args*)
|
||||||
js-resourced (slurp path)]
|
[:android])))
|
||||||
(spit path (str js-resourced " ;;"))
|
([build-ids]
|
||||||
(spit path js-resourced))
|
(hawk/watch! [{:paths ["resources"]
|
||||||
ctx)}])
|
:handler (fn [ctx e]
|
||||||
(let [build-ids (if *command-line-args*
|
(let [path "src/status_im/utils/js_resources.cljs"
|
||||||
(map keyword *command-line-args*)
|
js-resourced (slurp path)]
|
||||||
[:android])
|
(spit path (str js-resourced " ;;"))
|
||||||
;; read project.clj to get build configs
|
(spit path js-resourced))
|
||||||
profiles (->> "project.clj"
|
ctx)}])
|
||||||
slurp
|
;; read project.clj to get build configs
|
||||||
read-string
|
(let [profiles (->> "project.clj"
|
||||||
(drop-while #(not= % :profiles))
|
slurp
|
||||||
(apply hash-map)
|
read-string
|
||||||
:profiles)
|
(drop-while #(not= % :profiles))
|
||||||
cljs-builds (get-in profiles [:dev :cljsbuild :builds])
|
(apply hash-map)
|
||||||
builds (get-builds build-ids cljs-builds)]
|
:profiles)
|
||||||
(start-figwheel build-ids builds)
|
cljs-builds (get-in profiles [:dev :cljsbuild :builds])
|
||||||
(rfs/-main))
|
builds (get-builds build-ids cljs-builds)]
|
||||||
(ra/cljs-repl))
|
(start-figwheel build-ids builds)
|
||||||
|
(rfs/-main))))
|
||||||
|
|
||||||
(start-cljs-repl)
|
(def stop ra/stop-figwheel!)
|
||||||
|
|
||||||
|
(def start-cljs-repl ra/cljs-repl)
|
||||||
|
5
env/dev/run.clj
vendored
Normal file
5
env/dev/run.clj
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(ns dev-run
|
||||||
|
(:use [figwheel-api]))
|
||||||
|
|
||||||
|
(start)
|
||||||
|
(start-cljs-repl)
|
@ -19,7 +19,7 @@
|
|||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
["with-profile" "prod" "cljsbuild" "once" "ios"]
|
||||||
["with-profile" "prod" "cljsbuild" "once" "android"]]
|
["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-cljs" ["with-profile" "test" "doo" "node" "test" "once"]
|
||||||
"test-protocol" ["with-profile" "test" "doo" "node" "protocol" "once"]}
|
"test-protocol" ["with-profile" "test" "doo" "node" "protocol" "once"]}
|
||||||
:figwheel {:nrepl-port 7888}
|
:figwheel {:nrepl-port 7888}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user