summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-23 20:53:43 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-07-23 20:53:43 +0200
commit70d27c5720331076f52e4fd7bcd1dc8045c8c86a (patch)
treee76b259f8dfb66bd60f19dfd9a9241e5fae61121
parentf6cfc74dc0c82297c1ce857d976b0d871a445dfb (diff)
rebar_deps: use xconf for deps_dir
-rw-r--r--src/rebar_deps.erl16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
index 72c7769..da7ad48 100644
--- a/src/rebar_deps.erl
+++ b/src/rebar_deps.erl
@@ -52,8 +52,7 @@ preprocess(Config, _) ->
%% Side effect to set deps_dir globally for all dependencies from
%% 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
- DepsDir = rebar_config:get_global(Config, deps_dir, []),
- Config1 = set_global_deps_dir(Config, DepsDir),
+ Config1 = set_shared_deps_dir(Config, get_shared_deps_dir(Config, [])),
%% Get the list of deps for the current working directory and identify those
%% deps that are available/present.
@@ -184,18 +183,21 @@ setup_env(Config) ->
%% Added because of trans deps,
%% 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
-set_global_deps_dir(Config, []) ->
- rebar_config:set_global(Config, deps_dir,
- rebar_config:get_local(Config, deps_dir, "deps"));
-set_global_deps_dir(Config, _DepsDir) ->
+set_shared_deps_dir(Config, []) ->
+ rebar_config:set_xconf(Config, deps_dir,
+ rebar_config:get_local(Config, deps_dir, "deps"));
+set_shared_deps_dir(Config, _DepsDir) ->
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, App) ->
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])}.
dep_dirs(Deps) ->