Skip to content

Commit

Permalink
Merge pull request #46 from esl/compile-driver-using-pc
Browse files Browse the repository at this point in the history
Compile driver using pc plugin
  • Loading branch information
michalwski committed Nov 6, 2018
2 parents bbafe14 + a4ac0a4 commit 80a4ecf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 90 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ test: test-compile
./rebar3 eunit

coverage-report: _build/test/cover/eunit.coverdata
./rebar3 coveralls send
./rebar3 as test coveralls send

codecov: _build/test/cover/eunit.coverdata
./rebar3 codecov analyze
./rebar3 as test codecov analyze

rebar3:
wget https://github.com/erlang/rebar3/releases/download/3.6.1/rebar3 &&\
Expand Down
62 changes: 0 additions & 62 deletions c_src/Makefile

This file was deleted.

77 changes: 51 additions & 26 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
%% Stop rebar2 from building the shared objects
%% (empty lists on 3rd and 4th positions work this way - why? no idea)...
{port_specs, [{".*", "priv/exml_nif.so", [], []}]}.
%% ...but build the shared objects "manually" by calling make.
%% This also works with rebar3, which doesn't build .so libs by itself.
{pre_hooks,
[{"(linux|darwin|solaris)", compile, "make -C c_src"},
{"(freebsd)", compile, "gmake -C c_src"}]}.
{post_hooks,
[{"(linux|darwin|solaris)", clean, "make -C c_src clean"},
{"(freebsd)", clean, "gmake -C c_src clean"}]}.

{profiles,
[{test,
[{deps, [{proper, "1.3.0"}]}]
}]}.

{plugins , [coveralls,
{rebar3_codecov,
{git, "https://github.com/zofpolkowska/rebar3_codecov.git",
{ref, "3d0af19"}}}
]}.

{cover_enabled , true}.
{cover_export_enabled , true}.
{coveralls_coverdata , "_build/test/cover/eunit.coverdata"}.
{coveralls_service_name , "travis-ci"}.
[
{test,
[
{deps, [{proper, "1.3.0"}]},
{plugins,
[
pc,
coveralls,
{rebar3_codecov,
{git,
"https://github.com/zofpolkowska/rebar3_codecov.git",
{ref, "3d0af19"}}}
]}
]}
]}.

{plugins, [pc]}.

% Interrupt compilation, if the artifact is not found
{artifacts, ["priv/exml_nif.so"]}.

{port_specs,
[
{
% Any arch
".*",

% Create library
"priv/exml_nif.so",

% From files
["c_src/*.cpp"],

% Using options
[ {env, [{ "CXXFLAGS", "$CXXFLAGS -std=c++11" }]} ]
}
]}.

{provider_hooks,
[
{post,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}.

{cover_enabled, true}.
{cover_export_enabled, true}.
{coveralls_coverdata, "_build/test/cover/eunit.coverdata"}.
{coveralls_service_name, "travis-ci"}.

0 comments on commit 80a4ecf

Please sign in to comment.