summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar.app.src1
-rw-r--r--src/rebar_state.erl19
2 files changed, 19 insertions, 1 deletions
diff --git a/src/rebar.app.src b/src/rebar.app.src
index 67973eb..58fee02 100644
--- a/src/rebar.app.src
+++ b/src/rebar.app.src
@@ -27,6 +27,7 @@
certifi,
cth_readable,
relx,
+ cf,
inets,
eunit_formatters]},
{env, [
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 176a80b..0c07b2a 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -370,7 +370,24 @@ providers(State, NewProviders) ->
-spec add_provider(t(), providers:t()) -> t().
add_provider(State=#state_t{providers=Providers}, Provider) ->
- State#state_t{providers=[Provider | Providers]}.
+ Name = providers:impl(Provider),
+ Namespace = providers:namespace(Provider),
+ Module = providers:module(Provider),
+ case lists:any(fun(P) ->
+ case {providers:impl(P), providers:namespace(P)} of
+ {Name, Namespace} ->
+ ?DEBUG("Not adding provider ~p ~p from module ~p because it already exists from module ~p",
+ [Namespace, Name, providers:module(P), Module]),
+ true;
+ _ ->
+ false
+ end
+ end, Providers) of
+ true ->
+ State;
+ false ->
+ State#state_t{providers=[Provider | Providers]}
+ end.
create_logic_providers(ProviderModules, State0) ->
try