forked from dmotz/natal
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
read project.clj to get build config
- Loading branch information
1 parent
dc7941f
commit aeff45f
Showing
1 changed file
with
15 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,29 @@ | ||
(ns user | ||
(:use [figwheel-sidecar.repl-api :as ra])) | ||
;; This namespace is loaded automatically by nRepl | ||
;; copy of dev builds in project.cjs | ||
(def builds {:ios {:source-paths ["src" "env/dev"] | ||
:figwheel true | ||
:compiler {:output-to "target/ios/not-used.js" | ||
:main "env.ios.main" | ||
:output-dir "target/ios" | ||
:optimizations :none}} | ||
:android {:source-paths ["src" "env/dev"] | ||
:figwheel true | ||
:compiler {:output-to "target/android/not-used.js" | ||
:main "env.android.main" | ||
:output-dir "target/android" | ||
:optimizations :none}}}) | ||
;; This namespace is loaded automatically by nREPL | ||
|
||
;; read project.clj to get build configs | ||
(def profiles (->> "project.clj" | ||
slurp | ||
read-string | ||
(drop-while #(not= % :profiles)) | ||
(apply hash-map) | ||
:profiles)) | ||
|
||
(def cljs-builds (get-in profiles [:dev :cljsbuild :builds])) | ||
|
||
(defn figwheel-ios | ||
"Start figwheel for iOS build" | ||
[] | ||
(ra/start-figwheel! | ||
{:build-ids ["ios"] | ||
:all-builds builds}) | ||
{:build-ids ["ios"] | ||
:all-builds cljs-builds}) | ||
(ra/cljs-repl)) | ||
|
||
(defn figwheel-android | ||
"Start figwheel for Android build" | ||
[] | ||
(ra/start-figwheel! | ||
{:build-ids ["android"] | ||
:all-builds builds}) | ||
{:build-ids ["android"] | ||
:all-builds cljs-builds}) | ||
(ra/cljs-repl)) |