mirror of
https://github.com/status-im/re-natal.git
synced 2025-01-13 22:25:15 +00:00
Parameterized :clean-target in project.clj
This commit is contained in:
parent
a10bc8906b
commit
b305152b0a
@ -27,6 +27,7 @@ interfaceDepsRx = /\$INTERFACE_DEPS\$/g
|
|||||||
devProfilesRx = /\$DEV_PROFILES\$/g
|
devProfilesRx = /\$DEV_PROFILES\$/g
|
||||||
prodProfilesRx = /\$PROD_PROFILES\$/g
|
prodProfilesRx = /\$PROD_PROFILES\$/g
|
||||||
platformRx = /\$PLATFORM\$/g
|
platformRx = /\$PLATFORM\$/g
|
||||||
|
platformCleanRx = /\$PLATFORM_CLEAN\$/g
|
||||||
devHostRx = /\$DEV_HOST\$/g
|
devHostRx = /\$DEV_HOST\$/g
|
||||||
ipAddressRx = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/i
|
ipAddressRx = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/i
|
||||||
figwheelUrlRx = /ws:\/\/[0-9a-zA-Z\.]*:/g
|
figwheelUrlRx = /ws:\/\/[0-9a-zA-Z\.]*:/g
|
||||||
@ -377,7 +378,8 @@ copyProjectClj = (interfaceName, projNameHyph) ->
|
|||||||
|
|
||||||
fs.copySync("#{resources}/project.clj", "project.clj")
|
fs.copySync("#{resources}/project.clj", "project.clj")
|
||||||
deps = interfaceConf[interfaceName].deps.join("\n")
|
deps = interfaceConf[interfaceName].deps.join("\n")
|
||||||
edit 'project.clj', [[projNameHyphRx, projNameHyph], [interfaceDepsRx, deps], [devProfilesRx, devProfiles.join("\n")], [prodProfilesRx, prodProfiles.join("\n")]]
|
cleans = platforms.map (platform) -> "\"index.#{platform}.js\""
|
||||||
|
edit 'project.clj', [[projNameHyphRx, projNameHyph], [interfaceDepsRx, deps], [platformCleanRx, cleans.join(' ')], [devProfilesRx, devProfiles.join("\n")], [prodProfilesRx, prodProfiles.join("\n")]]
|
||||||
|
|
||||||
init = (interfaceName, projName) ->
|
init = (interfaceName, projName) ->
|
||||||
if projName.toLowerCase() is 'react' or !projName.match validNameRx
|
if projName.toLowerCase() is 'react' or !projName.match validNameRx
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
$INTERFACE_DEPS$]
|
$INTERFACE_DEPS$]
|
||||||
:plugins [[lein-cljsbuild "1.1.4"]
|
:plugins [[lein-cljsbuild "1.1.4"]
|
||||||
[lein-figwheel "0.5.8"]]
|
[lein-figwheel "0.5.8"]]
|
||||||
:clean-targets ["target/" "index.ios.js" "index.android.js"]
|
:clean-targets ["target/" $PLATFORM_CLEAN$]
|
||||||
:aliases {"prod-build" ^{:doc "Recompile code with prod profile."}
|
:aliases {"prod-build" ^{:doc "Recompile code with prod profile."}
|
||||||
["do" "clean"
|
["do" "clean"
|
||||||
["with-profile" "prod" "cljsbuild" "once"]]}
|
["with-profile" "prod" "cljsbuild" "once"]]}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user