Permalink
Browse files

Use sync to hot-reload code

  • Loading branch information...
1 parent 060bacd commit 0a54214442dfe61876fd63276ff0573dbefe753b @mitchellh committed May 4, 2012
Showing with 10 additions and 3 deletions.
  1. +8 −3 Makefile
  2. +1 −0 rebar.config
  3. +1 −0 rel/reltool.config
View
11 Makefile
@@ -1,3 +1,5 @@
+APP = lifeguard
+
all: deps compile
compile:
@@ -11,13 +13,16 @@ deps:
cd deps/erlv8 && make
devrel: rel
- rm -rf rel/lifeguard/lib/lifeguard-*/priv
- ln -sf $(abspath ./apps/lifeguard/priv) rel/lifeguard/lib/lifeguard-*
+ rm -rf rel/$(APP)/lib/$(APP)-*/ebin
+ ln -sf $(abspath ./apps/$(APP)/ebin) rel/$(APP)/lib/$(APP)-*
+ rm -rf rel/$(APP)/lib/$(APP)-*/priv
+ ln -sf $(abspath ./apps/$(APP)/priv) rel/$(APP)/lib/$(APP)-*
+ echo -s sync | tee -a rel/$(APP)/releases/*/vm.args
rel: compile
./rebar generate -f
test: compile
- ./rebar eunit apps=lifeguard
+ ./rebar eunit apps=$(APP)
.PHONY: all compile clean deps
View
1 rebar.config
@@ -8,6 +8,7 @@
{erlv8, ".*", {git, "git://github.com/beamjs/erlv8.git", {branch, "master"}}},
{erlydtl, ".*", {git, "git://github.com/evanmiller/erlydtl.git", {branch, "master"}}},
{lager, ".*", {git, "git://github.com/basho/lager", {branch, "master"}}},
+ {sync, ".*", {git, "git://github.com/rustyio/sync.git", {branch, "master"}}},
{webmachine, ".*", {git, "git://github.com/basho/webmachine", {branch, "master"}}}
]}.
View
1 rel/reltool.config
@@ -35,6 +35,7 @@
{app, mochiweb, [{incl_cond, include}]},
{app, sasl, [{incl_cond, include}]},
{app, stdlib, [{incl_cond, include}]},
+ {app, sync, [{incl_cond, include}]},
{app, syntax_tools, [{incl_cond, include}]},
{app, webmachine, [{incl_cond, include}]},
{app, xmerl, [{incl_cond, include}]}

0 comments on commit 0a54214

Please sign in to comment.