Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to rebar3 (updated) #119

Merged
merged 3 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@ otp_release:
- 19.3
- 19.2
- 19.1
- 19.0
- 18.3
- 18.2.1
- 18.2
- 18.1
- 18.0
after_failure: "echo 'logs/raw.log\n'; cat logs/raw.log; for f in `find logs/ct_run*/log*/ -type f`; do echo \"\n$f\n\" ; cat $f; done"
36 changes: 16 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
.PHONY: all clean clean_plt deps compile test doc dialyzer xref ci
REBAR3=$(shell which rebar3 || echo ./rebar3)

.PHONY: all clean clean_plt compile test doc dialyzer xref ci

EXOMETER_PLT=exometer_core.plt
DIALYZER_OPTS = # -Wunderspecs
DIALYZER_APPS = erts kernel stdlib compiler syntax_tools \
test_server common_test folsom \
parse_trans setup

all: deps compile xref test

ci: deps compile xref dialyzer test
all: compile xref test

deps:
rebar3 upgrade
ci: compile xref dialyzer test

compile:
rebar3 compile
$(REBAR3) compile

clean: clean_plt
rebar3 clean
$(REBAR3) clean

clean-all: clean
rm -rf deps

rm -rf _build
test:
ERL_LIBS=./examples rebar3 ct skip_deps=true
$(REBAR3) as test do eunit
$(REBAR3) as test do ct

xref:
ERL_LIBS=./deps rebar3 xref skip_deps=true

edown_deps:
rebar3 as docs upgrade
rebar3 as docs compile
$(REBAR3) xref

doc: edown_deps
rebar3 as docs edoc
doc:
$(REBAR3) as docs do edoc

$(EXOMETER_PLT): deps compile
$(EXOMETER_PLT):
$(REBAR3) compile
ERL_LIBS=deps dialyzer --build_plt --output_plt $(EXOMETER_PLT) \
--apps $(DIALYZER_APPS) | \
fgrep -v -f ./dialyzer.ignore-warnings

clean_plt:
rm -f $(EXOMETER_PLT)

dialyzer: deps compile $(EXOMETER_PLT)
dialyzer: compile $(EXOMETER_PLT)
dialyzer -r ebin --plt $(EXOMETER_PLT) $(DIALYZER_OPTS) | \
fgrep -v -f ./dialyzer.ignore-warnings
2 changes: 1 addition & 1 deletion doc/overview.edoc
Original file line number Diff line number Diff line change
Expand Up @@ -661,5 +661,5 @@ processing is complete.
[hex]: https://hex.pm/packages/exometer_core
[hex version badge]: https://img.shields.io/hexpm/v/exometer_core.svg?style=flat-square
[hex license badge]: https://img.shields.io/hexpm/l/exometer_core.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-18--20-blue.svg?style=flat-square
[erlang version badge]: https://img.shields.io/badge/erlang-19--20-blue.svg?style=flat-square
[build tool]: https://img.shields.io/badge/build%20tool-rebar3-orange.svg?style=flat-square
35 changes: 0 additions & 35 deletions priv/check_edown.script

This file was deleted.

18 changes: 0 additions & 18 deletions priv/remove_deps.script

This file was deleted.

4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

{profiles,
[
{test, [{deps, [{meck, "0.8.4"}]}]},
{docs, [{deps, [{edown, {git, "git://github.com/uwiger/edown.git", {branch, "master"}}}]}]}
{test, [{deps, [{meck, "0.8.9"}]}]},
{docs, [{deps, [{edown, "0.8.1"}]}]}
]}.

{erl_opts,
Expand Down
9 changes: 3 additions & 6 deletions rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ CFG1 = case os:getenv("REBAR_DEPS") of
lists:keystore(deps_dir, 1, CONFIG0, {deps_dir, Dir})
end.

Priv = filename:join(filename:dirname(SCRIPT), "priv").
CFG2 = Script(Priv, "check_edown.script", [{'CONFIG', CFG1}]).

case os:getenv("EXOMETER_CORE_CONFIG_POSTPROCESS") of
false -> CFG2;
[] -> CFG2;
false -> CFG1;
[] -> CFG1;
PoPScr -> Script(filename:dirname(PoPScr),
filename:basename(PoPScr),
[{'CONFIG', CFG2}])
[{'CONFIG', CFG1}])
end.
4 changes: 0 additions & 4 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{"1.1.0",
[{<<"bear">>,{pkg,<<"bear">>,<<"0.8.5">>},1},
{<<"edown">>,
{git,"git://github.com/esl/edown.git",
{ref,"4d18dc4bec89c20c0ba8cab6884ce690ca606f4a"}},
0},
{<<"folsom">>,{pkg,<<"folsom">>,<<"0.8.5">>},0},
{<<"hut">>,{pkg,<<"hut">>,<<"1.2.0">>},0},
{<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.2.0">>},0},
Expand Down
Binary file added rebar3
Binary file not shown.
7 changes: 4 additions & 3 deletions test/exometer_test_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ majority(N, F, Cfg) ->

majority(0, _, _, Hist) ->
Failed = length([1 || {caught,_,_} <- Hist]),
LogMsg = lists:flatten(io_lib:format("majority: Failed = ~p, Hist = ~p", [Failed, Hist])),
Succeeded = length(Hist) - Failed,
LogMsg = lists:flatten(io_lib:format("majority: Succeeded = ~p, Failed = ~p, Hist = ~p", [Succeeded, Failed, Hist])),
ct:pal(LogMsg),
case {Failed, length(Hist)} of
{Lf, L} when Lf >= L div 2 ->
case {Failed, Succeeded} of
{Lf, Ls} when Lf >= Ls ->
ct:fail({error, {too_many_failures, Hist}});
_ ->
{comment, LogMsg}
Expand Down