diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar3.erl | 4 | ||||
-rw-r--r-- | src/rebar_provider.erl | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl index dcd78f7..ec464fb 100644 --- a/src/rebar3.erl +++ b/src/rebar3.erl @@ -136,10 +136,12 @@ run_aux(State, Args) -> State1 = init_config1(State), + code:add_pathsa([filename:join(rebar_utils:get_cwd(), "plugins")]), %% Process each command, resetting any state between each one State2 = rebar_state:set(State1, base_dir, filename:absname(rebar_state:dir(State1))), {ok, Providers} = application:get_env(rebar, providers), - State3 = rebar_state:create_logic_providers(Providers, State2), + Plugins = rebar_state:get(State2, plugins, []), + State3 = rebar_state:create_logic_providers(Providers++Plugins, State2), Task = rebar_state:get(State3, task, "help"), rebar_core:process_command(rebar_state:command_args(State3, Args), list_to_atom(Task)), ok. diff --git a/src/rebar_provider.erl b/src/rebar_provider.erl index e5d7520..69ee22b 100644 --- a/src/rebar_provider.erl +++ b/src/rebar_provider.erl @@ -1,7 +1,8 @@ -module(rebar_provider). %% API --export([new/2, +-export([create/1, + new/2, do/2, impl/1, get_provider/2, @@ -59,6 +60,17 @@ new(ModuleName, State0) when is_atom(ModuleName) -> ModuleName:init(State0) end. +-spec create([{atom(), any()}]) -> t(). +create(Attrs) -> + #provider{name=proplists:get_value(name, Attrs, undefined) + ,provider_impl=proplists:get_value(provider_impl, Attrs, undefined) + ,bare=proplists:get_value(bare, Attrs, false) + ,deps=proplists:get_value(deps, Attrs, []) + ,desc=proplists:get_value(desc, Attrs, "") + ,short_desc=proplists:get_value(short_desc, Attrs, "") + ,example=proplists:get_value(example, Attrs, "") + ,opts=proplists:get_value(opts, Attrs, [])}. + %% @doc Manipulate the state of the system, that new state %% %% @param Provider the provider object @@ -109,7 +121,7 @@ get_target_providers(Target, State) -> Providers = rebar_state:providers(State), TargetProviders = lists:filter(fun(#provider{name=T}) when T =:= Target-> true; - (#provider{name=T}) -> + (_) -> false end, Providers), process_deps(TargetProviders, Providers). |