summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar.erl6
-rw-r--r--src/rebar_core.erl6
-rw-r--r--src/rebar_deps.erl1
-rw-r--r--src/rebar_erlydtl_compiler.erl5
-rw-r--r--src/rebar_escripter.erl1
-rw-r--r--src/rebar_provider.erl8
-rw-r--r--src/rebar_prv_app_builder.erl5
-rw-r--r--src/rebar_shell.erl2
8 files changed, 16 insertions, 18 deletions
diff --git a/src/rebar.erl b/src/rebar.erl
index 8b9758f..2284afe 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -166,15 +166,15 @@ run_aux(BaseConfig, Commands) ->
{error,{already_started,crypto}} -> ok
end,
- %% Convert command strings to atoms
- CommandAtoms = [list_to_atom(C) || C <- Commands],
+ [Command | Args] = Commands,
+ CommandAtom = list_to_atom(Command),
BaseConfig1 = init_config1(BaseConfig),
%% Process each command, resetting any state between each one
{ok, Providers} = application:get_env(rebar, providers),
BaseConfig2 = rebar_config:create_logic_providers(Providers, BaseConfig1),
- rebar_core:process_commands(CommandAtoms, BaseConfig2),
+ rebar_core:process_commands(CommandAtom, Args, BaseConfig2),
ok.
%%
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 55a96e9..66af875 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -26,7 +26,7 @@
%% -------------------------------------------------------------------
-module(rebar_core).
--export([process_commands/2, help/2]).
+-export([process_commands/3, help/2]).
-include("rebar.hrl").
@@ -53,14 +53,14 @@ help(ParentConfig, Commands) ->
end, Providers)
end, Commands).
-process_commands(Commands, ParentConfig) ->
+process_commands(Command, Args, ParentConfig) ->
true = rebar_utils:expand_code_path(),
LibDirs = rebar_config:get_local(ParentConfig, lib_dirs, ["apps", "libs", "."]),
DepsDir = rebar_deps:get_deps_dir(ParentConfig),
_UpdatedCodePaths = update_code_path([DepsDir | LibDirs]),
ParentConfig2 = rebar_app_discover:do(ParentConfig, LibDirs),
- TargetProviders = rebar_provider:get_target_providers(Commands, ParentConfig2),
+ TargetProviders = rebar_provider:get_target_providers(Command, ParentConfig2),
ParentConfig3 =
lists:foldl(fun(TargetProvider, Conf) ->
Provider = rebar_provider:get_provider(TargetProvider, rebar_config:providers(Conf)),
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
index d9d0399..02195a2 100644
--- a/src/rebar_deps.erl
+++ b/src/rebar_deps.erl
@@ -50,7 +50,6 @@
init(State) ->
State1 = rebar_config:add_provider(State, #provider{name = ?PROVIDER,
provider_impl = ?MODULE,
- provides = deps,
bare = false,
deps = ?DEPS,
example = "rebar deps",
diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl
index fac8493..5aa67db 100644
--- a/src/rebar_erlydtl_compiler.erl
+++ b/src/rebar_erlydtl_compiler.erl
@@ -104,8 +104,8 @@
-include("rebar.hrl").
--define(PROVIDER, erlydtl).
--define(DEPS, [app_builder]).
+-define(PROVIDER, compile).
+-define(DEPS, []).
%% ===================================================================
%% Public API
@@ -115,7 +115,6 @@
init(State) ->
State1 = rebar_config:add_provider(State, #provider{name = ?PROVIDER,
provider_impl = ?MODULE,
- provides = compile,
bare = false,
deps = ?DEPS,
example = "compile",
diff --git a/src/rebar_escripter.erl b/src/rebar_escripter.erl
index 395475f..21dbaf8 100644
--- a/src/rebar_escripter.erl
+++ b/src/rebar_escripter.erl
@@ -51,7 +51,6 @@
init(State) ->
State1 = rebar_config:add_provider(State, #provider{name = ?PROVIDER,
provider_impl = ?MODULE,
- provides = escriptize,
bare = false,
deps = ?DEPS,
example = "escriptize",
diff --git a/src/rebar_provider.erl b/src/rebar_provider.erl
index e8986f2..39ed911 100644
--- a/src/rebar_provider.erl
+++ b/src/rebar_provider.erl
@@ -81,10 +81,12 @@ impl(Provider) ->
format(#provider{provider_impl=Mod}) ->
erlang:atom_to_list(Mod).
-get_target_providers(Targets, State) ->
+get_target_providers(Target, State) ->
Providers = rebar_config:providers(State),
- TargetProviders = lists:filter(fun(#provider{provides=T}) ->
- lists:member(T, Targets)
+ TargetProviders = lists:filter(fun(#provider{name=T}) when T =:= Target->
+ true;
+ (#provider{name=T}) ->
+ false
end, Providers),
process_deps(TargetProviders, Providers).
diff --git a/src/rebar_prv_app_builder.erl b/src/rebar_prv_app_builder.erl
index 3b974a9..4e5e798 100644
--- a/src/rebar_prv_app_builder.erl
+++ b/src/rebar_prv_app_builder.erl
@@ -7,7 +7,7 @@
-include("rebar.hrl").
--define(PROVIDER, app_builder).
+-define(PROVIDER, compile).
-define(DEPS, [deps]).
%% ===================================================================
@@ -18,10 +18,9 @@
init(State) ->
State1 = rebar_config:add_provider(State, #provider{name = ?PROVIDER,
provider_impl = ?MODULE,
- provides = build,
bare = false,
deps = ?DEPS,
- example = "rebar build",
+ example = "rebar compile",
short_desc = "",
desc = "",
opts = []}),
diff --git a/src/rebar_shell.erl b/src/rebar_shell.erl
index b089631..6b4bb1f 100644
--- a/src/rebar_shell.erl
+++ b/src/rebar_shell.erl
@@ -36,7 +36,7 @@
-include("rebar.hrl").
-define(PROVIDER, shell).
--define(DEPS, [app_builder]).
+-define(DEPS, [compile]).
%% ===================================================================
%% Public API