After starting out with the basics of Erlang, through the Seven Languages In Seven Weeks, I wanted to explore more of what Erlang has to offer. The first part of that was looking at setting up an OTP application and structure. This led me to rebar
Rebar describes itself as follows:
Erlang build tool that makes it easy to compile and test Erlang applications, port drivers and releases.
That sums it up nicely. Below is how to get the template application running
mkdir poke
cd poke
rebar create-app appid=poke
% The application stub has now been created.
% *dir* the directory to see the files that have been created
rebar compile
% Should compile and create an *ebin* directory with the BEAM files
mkdir rel
{sub_dirs, ["rel"]}.
rebar create-node nodeid=poke
% -> This creates items in the current directory(rel) to handle a release
{sys, [
%...
{app, poke, [{mod_cond, app}, {incl_cond, include}]}
]}.
To:
{sys, [
%...
{app, poke, [{mod_cond, app}, {incl_cond, include}, {lib_dir, ".."}]}
]}.
rebar generate
% -> release has now been created and can be run. Look under rel/poke
.\rel\poke\bin\poke console
% This will spin up a new console and run your release