summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_common_test.erl1
-rw-r--r--src/rebar_prv_install_deps.erl4
-rw-r--r--src/rebar_state.erl15
3 files changed, 15 insertions, 5 deletions
diff --git a/src/rebar_prv_common_test.erl b/src/rebar_prv_common_test.erl
index a848401..9038759 100644
--- a/src/rebar_prv_common_test.erl
+++ b/src/rebar_prv_common_test.erl
@@ -38,7 +38,6 @@ init(State) ->
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(State) ->
?INFO("Running Common Test suites...", []),
-
code:add_pathsa(rebar_state:code_paths(State, all_deps)),
%% Run ct provider prehooks
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 3b2c9ab..0fa843f 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -151,9 +151,9 @@ handle_deps(Profile, State0, Deps, Upgrade, Locks) ->
,lists:ukeysort(2, SrcApps)
,lists:ukeysort(2, Solved)),
- State3 = rebar_state:all_deps(State2, AllDeps),
+ State3 = rebar_state:update_all_deps(State2, AllDeps),
CodePaths = [rebar_app_info:ebin_dir(A) || A <- AllDeps],
- State4 = rebar_state:code_paths(State3, all_deps, CodePaths),
+ State4 = rebar_state:update_code_paths(State3, all_deps, CodePaths),
{ok, AllDeps, State4}.
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 705f723..3909a39 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -3,7 +3,7 @@
-export([new/0, new/1, new/2, new/3,
get/2, get/3, set/3,
- code_paths/2, code_paths/3,
+ code_paths/2, code_paths/3, update_code_paths/3,
opts/1, opts/2,
default/1, default/2,
@@ -24,7 +24,7 @@
project_apps/1, project_apps/2,
deps_to_build/1, deps_to_build/2,
- all_deps/1, all_deps/2,
+ all_deps/1, all_deps/2, update_all_deps/2,
namespace/1, namespace/2,
deps_names/1,
@@ -146,6 +146,14 @@ code_paths(#state_t{code_paths=CodePaths}, Key) ->
code_paths(State=#state_t{code_paths=CodePaths}, Key, CodePath) ->
State#state_t{code_paths=dict:store(Key, CodePath, CodePaths)}.
+update_code_paths(State=#state_t{code_paths=CodePaths}, Key, CodePath) ->
+ case dict:is_key(Key, CodePaths) of
+ true ->
+ State#state_t{code_paths=dict:append_list(Key, CodePath, CodePaths)};
+ false ->
+ State#state_t{code_paths=dict:store(Key, CodePath, CodePaths)}
+ end.
+
opts(#state_t{opts=Opts}) ->
Opts.
@@ -312,6 +320,9 @@ all_deps(#state_t{all_deps=Apps}) ->
all_deps(State=#state_t{}, NewApps) ->
State#state_t{all_deps=NewApps}.
+update_all_deps(State=#state_t{all_deps=Apps}, NewApps) ->
+ State#state_t{all_deps=Apps++NewApps}.
+
namespace(#state_t{namespace=Namespace}) ->
Namespace.