summaryrefslogtreecommitdiff
path: root/src/rebar_api.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_api.erl')
-rw-r--r--src/rebar_api.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/rebar_api.erl b/src/rebar_api.erl
index 3fc7f61..45083df 100644
--- a/src/rebar_api.erl
+++ b/src/rebar_api.erl
@@ -8,7 +8,10 @@
debug/2, info/2, warn/2, error/2,
expand_env_variable/3,
get_arch/0,
- wordsize/0]).
+ wordsize/0,
+ add_deps_to_path/1,
+ restore_code_path/1,
+ processing_base_dir/1]).
-export_type([rebar_dict/0, rebar_digraph/0]).
@@ -48,3 +51,15 @@ get_arch() ->
wordsize() ->
rebar_utils:wordsize().
+
+
+%% Add deps to the code path
+add_deps_to_path(State) ->
+ code:add_pathsa(rebar_state:code_paths(State, all_deps)).
+
+%% Revert to only having the beams necessary for running rebar3 and plugins in the path
+restore_code_path(State) ->
+ rebar_utils:cleanup_code_path(rebar_state:code_paths(State, default)).
+
+processing_base_dir(State) ->
+ rebar_dir:processing_base_dir(State).