mirror of
https://github.com/correl/rebar.git
synced 2024-11-14 19:19:30 +00:00
Adding check-deps and helper target for compilation
This commit is contained in:
parent
5f98b6b65a
commit
84f5108e17
1 changed files with 19 additions and 0 deletions
|
@ -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),
|
||||
|
||||
|
|
Loading…
Reference in a new issue