Skip to content

Commit

Permalink
Run with rebar3 only
Browse files Browse the repository at this point in the history
  • Loading branch information
markusn committed Dec 23, 2018
1 parent ef9050e commit 489226b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ otp_release:
- 19.0
- 18.0
script:
./rebar3 do eunit,edoc
- ./rebar3 do eunit,edoc
- ./rebar3 as test coveralls send
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ When using with travis-ci.com coveralls repo token also has to be added as `{cov

These changes will add `coveralls-erl` as a dependency, tell `rebar3` where to find the plugin, make sure that the coverage data is produced and exported and configure `coveralls-erl` to use this data and the service `travis-ci`.

And you send the coverdata to coveralls by issuing: `rebar3 coveralls send`
And you send the coverdata to coveralls by issuing: `rebar3 as test coveralls send`

**Note:**
If you have dependencies specific to the test profile, or if you only add the coveralls dependency or any of its' configuration variables to the test profile you need to run coveralls using: `rebar3 as test coveralls send`
Expand Down
12 changes: 5 additions & 7 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{plugin_dir , "src"}.
{erl_opts , [debug_info, {platform_define, "^(R14|R15|R16|17)", random_only}]}.
{cover_enabled , true}.
{cover_print_enabled , true}.
{cover_export_enabled , true}.
{coveralls_coverdata , ".eunit/cover.coverdata"}.
{coveralls_service_name , "travis-ci"}.
{plugins , [coveralls]}. % use hex package
{cover_enabled , true}.
{cover_export_enabled , true}.
{coveralls_coverdata , "_build/test/cover/eunit.coverdata"}. % or a string with wildcards or a list of files
{coveralls_service_name , "travis-ci"}.
11 changes: 3 additions & 8 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
case os:getenv("TRAVIS") of
"true" ->
JobId = os:getenv("TRAVIS_JOB_ID"),
CONFIG1 = lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId}),
code:is_loaded(rebar3) =:= false andalso code:load_file(rebar3),
case erlang:function_exported(rebar3, version, 0) of
false -> lists:keystore(plugins, 1, CONFIG1, {plugins, [rebar_coveralls]});
true -> CONFIG1
end;
_ ->
lists:keystore(coveralls_service_job_id, 1, CONFIG, {coveralls_service_job_id, JobId});
_ ->
CONFIG
end.
end.

0 comments on commit 489226b

Please sign in to comment.