From e1b1152b219cf65c7f8cd3b77db5cf2156fcbab7 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 20 Sep 2014 22:36:54 -0500 Subject: slowly widdling away at dialyzer errors --- src/rebar_prv_tar.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rebar_prv_tar.erl') diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl index 7f5ab4f..6ef773c 100644 --- a/src/rebar_prv_tar.erl +++ b/src/rebar_prv_tar.erl @@ -29,7 +29,7 @@ init(State) -> opts = []}), {ok, State1}. --spec do(rebar_state:t()) -> {ok, rebar_state:t()} | relx:error(). -do(Config) -> +-spec do(rebar_state:t()) -> {ok, rebar_state:t()}. +do(State) -> relx:main("release tar"), - {ok, Config}. + {ok, State}. -- cgit v1.1 From 6356112cbbb32b09dd2f94ea856c3cbd32b1c085 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sun, 21 Sep 2014 09:19:38 -0500 Subject: more dialyzer fun. no likey opaque types --- src/rebar_prv_tar.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rebar_prv_tar.erl') diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl index 6ef773c..c40c8df 100644 --- a/src/rebar_prv_tar.erl +++ b/src/rebar_prv_tar.erl @@ -31,5 +31,5 @@ init(State) -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()}. do(State) -> - relx:main("release tar"), + relx:main(["release tar"]), {ok, State}. -- cgit v1.1 From e9a3396e56679a11ac1caa3b47f1f196f0307d72 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 27 Sep 2014 14:12:11 -0500 Subject: return error messages from providers --- src/rebar_prv_tar.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rebar_prv_tar.erl') diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl index c40c8df..8e7fb69 100644 --- a/src/rebar_prv_tar.erl +++ b/src/rebar_prv_tar.erl @@ -29,7 +29,7 @@ init(State) -> opts = []}), {ok, State1}. --spec do(rebar_state:t()) -> {ok, rebar_state:t()}. +-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> relx:main(["release tar"]), {ok, State}. -- cgit v1.1 From b37a5ae611aaf6b84a046fbe716f40c2aa8c75d8 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 3 Oct 2014 06:33:33 -0500 Subject: move providers to separate app --- src/rebar_prv_tar.erl | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/rebar_prv_tar.erl') diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl index 8e7fb69..06a4014 100644 --- a/src/rebar_prv_tar.erl +++ b/src/rebar_prv_tar.erl @@ -3,7 +3,7 @@ -module(rebar_prv_tar). --behaviour(rebar_provider). +-behaviour(provider). -export([init/1, do/1]). @@ -19,17 +19,22 @@ -spec init(rebar_state:t()) -> {ok, rebar_state:t()}. init(State) -> - State1 = rebar_state:add_provider(State, #provider{name = ?PROVIDER, - provider_impl = ?MODULE, - bare = false, - deps = ?DEPS, - example = "rebar tar", - short_desc = "Tar archive of release built of project.", - desc = "", - opts = []}), + State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER}, + {module, ?MODULE}, + {bare, false}, + {deps, ?DEPS}, + {example, "rebar tar"}, + {short_desc, "Tar archive of release built of project."}, + {desc, ""}, + {opts, []}])), {ok, State1}. -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> - relx:main(["release tar"]), + case rebar_state:get(State, relx, []) of + [] -> + relx:main(["release tar"]); + Config -> + relx:main([{config, Config}], ["release tar"]) + end, {ok, State}. -- cgit v1.1 From 1dce2d36cc75263db279abd7f282772ce0f0f3e6 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Wed, 22 Oct 2014 12:03:49 -0500 Subject: add format_error/2 provider callback to providers --- src/rebar_prv_tar.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/rebar_prv_tar.erl') diff --git a/src/rebar_prv_tar.erl b/src/rebar_prv_tar.erl index 06a4014..04a1b33 100644 --- a/src/rebar_prv_tar.erl +++ b/src/rebar_prv_tar.erl @@ -6,7 +6,8 @@ -behaviour(provider). -export([init/1, - do/1]). + do/1, + format_error/2]). -include("rebar.hrl"). @@ -38,3 +39,7 @@ do(State) -> relx:main([{config, Config}], ["release tar"]) end, {ok, State}. + +-spec format_error(any(), rebar_state:t()) -> {iolist(), rebar_state:t()}. +format_error(Reason, State) -> + {io_lib:format("~p", [Reason]), State}. -- cgit v1.1