Since rebar3 refuses to add support for NIFs I've created this self contained escript to compile native code. This is based on rebar2 by removing everything unrelated to the port compiler.
- Clone this repository
- Run
make
in this directory - Copy
enc
to your project and commit it - Add these (or similar) hooks to your rebar.config:
{pre_hooks, [{"", compile, "./enc compile"}]}.
{post_hooks, [{"", clean, "./enc clean"}]}.
After that enc should read your old rebar.config port\_specs
and port\_env
settings as expected (it is rebar2's port compiler after all...).
Remember that you'll want to make sure and build enc
with the oldest Erlang VM you want to support.