Erlang reltool utility functionality application
ex2erl
is an escript that converts Elixir source code to Erlang source codewhich is useful when relying only on Erlang compilation with Erlang source codethat would like to include Elixir source code.
release
is an escript which provides the same basic functionality asrebar generate
, with additional error reporting coming from the reltool OTPsource code which rebar suppresses.
scope
is an escript which moves your Erlang application dependenciesinto their own "scope", so in Erlang, this means that it adds a prefix tothe application name and all the modules used by the application. The generalsequence of operations you would want to use with the scope script are:
- use the
-r
replace mode to modify internal source code, - modify the internal source code manually, if necessary,
- run the
scope
script normally before compilation, - if it is necessary to return the source back to the original state, use the
-u
undo mode to remove the scoped source code and replace it with the original source code. Thescope
script is meant to be part of a build process so the dependency modifications are automatic.
For the sequence above to work properly all dependencies must have aunique prefix in their file names (both erl and hrl files).If a file name is not unique (like log.hrl or protocol.hrl), unrelatedsource code may be modified to cause bugs.
Example arguments for normal operation are:-s cloudi_x_ -p cloudi -b _original -d directory1 -d directory2
.Dependencies that useinclude_lib
require that the dependency directory name ischanged to have the scope, but the script can still add/remove the scope to theapplication and module names normally.
Thereltool_util
source code provides a simple way to start an Erlangapplication manually, outside of a release (which is useful when regressiontesting requires that an application be started, especially if the tests arepart of a build process likerebar eunit
orrebar ct
).
Michael Truog (mjtruog at protonmail dot com)
- Hans Bolinder (ex2erl utf8 encoding)
MIT License