[erlang-questions] "Automatic" recompile app from a console

Dmitry Klionsky dm.klionsky@REDACTED
Sat Feb 2 09:39:15 CET 2013


We use modified version of sync https://github.com/ten0s/sync that 
supports releases, detects new files, and monitors changes in include 
files (at least it should, don't use this feature often) as far as the 
next requirements are met:
1. Make sync somehow available to your release. Include it into your 
release or put it in the erlang libs.
2. Build the project with debug_info.
3. Remove {debug_info, strip} from reltool.config
4. Add {excl_archive_filters, [".*"]} to reltool.config
5. Start sync:start() before making any changes.
6. Disable any growl notifications (optional)

We also edit files in emacs with flymake mode enabled using custom 
erlang syntax checker for *.erl, *.hrl, *.config files 
https://github.com/ten0s/syntaxerl

In general our workflow is:
1. Build the project with rebar
$ make
2. Start it in the console mode
$ make console
3. Start sync
 > sync:start().
4. Now start edit files. Whenever flymake says that the file is OK 
pretty soon sync will reload it. This workflow works fine until you need 
to make big changes like adding a child to a supervisor or make a new 
application. In this case go to point 1 and start over.

Hope this helps.


On 02/01/2013 12:08 AM, John Kemp wrote:
> Hi,
>
> I have been writing an application using rebar to build the app. I run 
> the server and open a console. I then change the source code and 
> apparently I need to leave the console, 'make rel' and restart the app 
> and the console.
>
> I'm sure there's a better way to do what I'm doing.
>
> One project I found is https://github.com/rustyio/sync, but this did 
> not (yet) work for me according to the instructions.
>
> How can I have my rebar (or just Erlang) app automatically recompile 
> ('make rel') when one of the source files changes, or run a command 
> from within the console to do this?
>
> Cheers,
>
> JohnK
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions


-- 
Best regards,
Dmitry Klionsky




More information about the erlang-questions mailing list