summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-10-17 14:02:51 -0500
committerTristan Sloughter <t@crashfast.com>2014-10-17 14:02:51 -0500
commitda8c6760187ef91fad921e9c0915e7bb7db79a42 (patch)
tree5e9167f7575da444029c9dc7d77319e03379cc95 /src
parentfa74056d2ac7add49397615cde8b5591f3c36bf6 (diff)
run compile as post hook for test_deps
Diffstat (limited to 'src')
-rw-r--r--src/rebar.app.src4
-rw-r--r--src/rebar_prv_test_deps.erl17
2 files changed, 12 insertions, 9 deletions
diff --git a/src/rebar.app.src b/src/rebar.app.src
index e7cbcd1..28c683c 100644
--- a/src/rebar.app.src
+++ b/src/rebar.app.src
@@ -25,7 +25,6 @@
rebar_prv_deps,
rebar_prv_do,
rebar_prv_lock,
- rebar_prv_test_deps,
rebar_prv_install_deps,
rebar_prv_packages,
rebar_erlydtl_compiler,
@@ -38,6 +37,7 @@
rebar_prv_upgrade,
rebar_prv_release,
rebar_prv_version,
- rebar_prv_help]}
+ rebar_prv_help,
+ rebar_prv_test_deps]}
]}
]}.
diff --git a/src/rebar_prv_test_deps.erl b/src/rebar_prv_test_deps.erl
index 7dea0ab..b4c7250 100644
--- a/src/rebar_prv_test_deps.erl
+++ b/src/rebar_prv_test_deps.erl
@@ -16,10 +16,13 @@
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
+ Providers = rebar_state:providers(State),
+ CompileProvider = providers:get_provider(compile, Providers),
State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER},
{module, ?MODULE},
{bare, true},
{deps, ?DEPS},
+ {hooks, {[], [CompileProvider]}},
{example, undefined},
{short_desc, "Install dependencies needed only for testing."},
{desc, ""},
@@ -38,13 +41,13 @@ do(State) ->
case rebar_topo:sort_apps(ProjectApps1++AllDeps) of
{ok, Sort} ->
- ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Sort),
- lists:foreach(fun(AppInfo) ->
- AppDir = rebar_app_info:dir(AppInfo),
- C = rebar_config:consult(AppDir),
- S = rebar_state:new(State1, C, AppDir),
- rebar_prv_compile:build(S, AppInfo)
- end, ToBuild),
+ _ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Sort),
+ %% lists:foreach(fun(AppInfo) ->
+ %% AppDir = rebar_app_info:dir(AppInfo),
+ %% C = rebar_config:consult(AppDir),
+ %% S = rebar_state:new(State1, C, AppDir),
+ %% rebar_prv_compile:build(S, AppInfo)
+ %% end, ToBuild),
{ok, State1};
{error, Error} ->
{error, Error}