add possibility to start figwheel from nREPL

This commit is contained in:
Artur Girenko 2015-12-14 23:02:40 +01:00
parent 33ec28b143
commit dc7941f77c
3 changed files with 40 additions and 2 deletions

View File

@ -169,6 +169,9 @@ getBundleId = (name) ->
copyDevEnvironmentFiles = (projNameHyph, projName, devHost) ->
userNsPath = "env/dev/user.clj"
exec "cp #{resources}user.clj #{userNsPath}"
mainIosDevPath = "env/dev/env/ios/main.cljs"
mainAndroidDevPath = "env/dev/env/android/main.cljs"

View File

@ -15,7 +15,10 @@
["do" "clean"
["with-profile" "prod" "cljsbuild" "once" "ios"]
["with-profile" "prod" "cljsbuild" "once" "android"]]}
:profiles {:dev {:cljsbuild {:builds {:ios {:source-paths ["src" "env/dev"]
:profiles {:dev {:dependencies [[figwheel-sidecar "0.5.0-2"]
[com.cemerick/piggieback "0.2.1"]]
:source-paths ["src" "env/dev"]
:cljsbuild {:builds {:ios {:source-paths ["src" "env/dev"]
:figwheel true
:compiler {:output-to "target/ios/not-used.js"
:main "env.ios.main"
@ -27,7 +30,7 @@
:main "env.android.main"
:output-dir "target/android"
:optimizations :none}}}}
}
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}
:prod {:cljsbuild {:builds {:ios {:source-paths ["src" "env/prod"]
:compiler {:output-to "index.ios.js"
:main "env.ios.main"

32
resources/user.clj Normal file
View File

@ -0,0 +1,32 @@
(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}}})
(defn figwheel-ios
"Start figwheel for iOS build"
[]
(ra/start-figwheel!
{:build-ids ["ios"]
:all-builds builds})
(ra/cljs-repl))
(defn figwheel-android
"Start figwheel for Android build"
[]
(ra/start-figwheel!
{:build-ids ["android"]
:all-builds builds})
(ra/cljs-repl))