summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2010-03-25 13:34:19 -0600
committerDave Smith <dizzyd@dizzyd.com>2010-03-25 13:34:19 -0600
commit84f5108e178d62be5a3c12ab6f4e9d26f027d6f6 (patch)
treeb9b7ad5c3c3f37190b843ad2fa72fc3c89c918dd /src
parent5f98b6b65af7374d4cb6097b756b7a600ecc06ac (diff)
Adding check-deps and helper target for compilation
Diffstat (limited to 'src')
-rw-r--r--src/rebar_deps.erl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
index 3a8571c..daa788e 100644
--- a/src/rebar_deps.erl
+++ b/src/rebar_deps.erl
@@ -29,6 +29,8 @@
-include("rebar.hrl").
-export([preprocess/2,
+ compile/2,
+ 'check-deps'/2,
'get-deps'/2,
'delete-deps'/2]).
@@ -53,6 +55,23 @@ preprocess(Config, _) ->
?ABORT("Error while processing dependencies: ~p\n", [Reason])
end.
+compile(Config, AppFile) ->
+ 'check-deps'(Config, AppFile).
+
+'check-deps'(Config, _) ->
+ %% Get a list of deps that need to be downloaded and display them only
+ DepsDir = get_deps_dir(Config),
+ case catch(check_deps(rebar_config:get_local(Config, deps, []), [], DepsDir)) of
+ [] ->
+ ok;
+ Deps when is_list(Deps) ->
+ [?CONSOLE("Dependency not available: ~p-~p (~p)\n", [App, VsnRegex, Source]) ||
+ {_Dir, App, VsnRegex, Source} <- Deps],
+ ?FAIL;
+ {'EXIT', Reason} ->
+ ?ABORT("Error while processing dependencies: ~p\n", [Reason])
+ end.
+
'get-deps'(Config, _) ->
DepsDir = get_deps_dir(Config),