mirror of
https://github.com/correl/rebar.git
synced 2024-11-27 11:09:55 +00:00
First basic pass at deps
This commit is contained in:
parent
b1b29e0858
commit
1fe4d13e25
1 changed files with 25 additions and 1 deletions
|
@ -33,4 +33,28 @@
|
|||
%% ===================================================================
|
||||
|
||||
preprocess(Config, _) ->
|
||||
{ok, Config, []}.
|
||||
%% Get the directory where we will place downloaded deps
|
||||
DepsDir = rebar_config:get(Config, deps_dir, "deps"),
|
||||
|
||||
%% Process the list of deps from the configuration
|
||||
Dirs = process_deps(rebar_config:get(Config, deps, []), [], DepsDir),
|
||||
{ok, Config, Dirs}.
|
||||
|
||||
|
||||
%% ===================================================================
|
||||
%% Internal functions
|
||||
%% ===================================================================
|
||||
|
||||
process_deps([], Acc, _Dir) ->
|
||||
Acc;
|
||||
process_deps([App | Rest], Acc, Dir) when is_atom(App) ->
|
||||
case code:lib_dir(App) of
|
||||
{error, bad_name} ->
|
||||
%% The requested app is not available on the code path
|
||||
?ABORT("~s: Dependency ~s not available.\n",
|
||||
[rebar_utils:get_cwd(), App]);
|
||||
Path ->
|
||||
?INFO("Dependency ~s -> ~s\n", [App, Path])
|
||||
end,
|
||||
process_deps(Rest, Acc, Dir).
|
||||
|
||||
|
|
Loading…
Reference in a new issue