rebar_deps: use xconf for deps_dir

This commit is contained in:
Tuncer Ayaz 2012-07-23 20:53:43 +02:00
parent f6cfc74dc0
commit 70d27c5720

View file

@ -52,8 +52,7 @@ preprocess(Config, _) ->
%% Side effect to set deps_dir globally for all dependencies from %% Side effect to set deps_dir globally for all dependencies from
%% top level down. Means the root deps_dir is honoured or the default %% top level down. Means the root deps_dir is honoured or the default
%% used globally since it will be set on the first time through here %% used globally since it will be set on the first time through here
DepsDir = rebar_config:get_global(Config, deps_dir, []), Config1 = set_shared_deps_dir(Config, get_shared_deps_dir(Config, [])),
Config1 = set_global_deps_dir(Config, DepsDir),
%% Get the list of deps for the current working directory and identify those %% Get the list of deps for the current working directory and identify those
%% deps that are available/present. %% deps that are available/present.
@ -184,18 +183,21 @@ setup_env(Config) ->
%% Added because of trans deps, %% Added because of trans deps,
%% need all deps in same dir and should be the one set by the root rebar.config %% need all deps in same dir and should be the one set by the root rebar.config
%% Sets a default if root config has no deps_dir set %% Sets a default if root config has no deps_dir set
set_global_deps_dir(Config, []) -> set_shared_deps_dir(Config, []) ->
rebar_config:set_global(Config, deps_dir, rebar_config:set_xconf(Config, deps_dir,
rebar_config:get_local(Config, deps_dir, "deps")); rebar_config:get_local(Config, deps_dir, "deps"));
set_global_deps_dir(Config, _DepsDir) -> set_shared_deps_dir(Config, _DepsDir) ->
Config. Config.
get_shared_deps_dir(Config, Default) ->
rebar_config:get_xconf(Config, deps_dir, Default).
get_deps_dir(Config) -> get_deps_dir(Config) ->
get_deps_dir(Config, ""). get_deps_dir(Config, "").
get_deps_dir(Config, App) -> get_deps_dir(Config, App) ->
BaseDir = rebar_config:get_xconf(Config, base_dir, []), BaseDir = rebar_config:get_xconf(Config, base_dir, []),
DepsDir = rebar_config:get_global(Config, deps_dir, "deps"), DepsDir = get_shared_deps_dir(Config, "deps"),
{true, filename:join([BaseDir, DepsDir, App])}. {true, filename:join([BaseDir, DepsDir, App])}.
dep_dirs(Deps) -> dep_dirs(Deps) ->