diff options
author | Dave Smith <dizzyd@dizzyd.com> | 2009-12-29 22:05:32 -0700 |
---|---|---|
committer | Dave Smith <dizzyd@dizzyd.com> | 2009-12-29 22:05:32 -0700 |
commit | 1fe4d13e255818cfa092915e035520dee02db830 (patch) | |
tree | 1e0d417b33d8835cb2c86c31bf169c0d26681948 | |
parent | b1b29e0858e4e7c6a358e982abc483c8e9091986 (diff) |
First basic pass at deps
-rw-r--r-- | src/rebar_deps.erl | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index a999f3f..7335d58 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -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). + |