summaryrefslogtreecommitdiff
path: root/src/rebar_api.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2018-10-15 11:56:57 -0400
committerGitHub <noreply@github.com>2018-10-15 11:56:57 -0400
commit7bfc8110d1736d2cbf61e19d2fc16dc8e854b460 (patch)
tree91f6606ad1083eea8e57fcc46821454180b50c94 /src/rebar_api.erl
parent86519cf743204eab1d922ca8133fbf00c66f9ee8 (diff)
parentfb6de6e0e5dc0da1c4e64c166bcb69327420cb60 (diff)
Merge pull request #1907 from ferd/refactor-env-paths
Refactor env path handling and fix some bugs related to it
Diffstat (limited to 'src/rebar_api.erl')
-rw-r--r--src/rebar_api.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/rebar_api.erl b/src/rebar_api.erl
index 4dabe8a..00eb054 100644
--- a/src/rebar_api.erl
+++ b/src/rebar_api.erl
@@ -9,6 +9,8 @@
expand_env_variable/3,
get_arch/0,
wordsize/0,
+ set_paths/2,
+ unset_paths/2,
add_deps_to_path/1,
restore_code_path/1,
processing_base_dir/1,
@@ -67,6 +69,21 @@ get_arch() ->
wordsize() ->
rebar_utils:wordsize().
+%% @doc Set code paths. Takes arguments of the form
+%% `[plugins, deps]' or `[deps, plugins]' and ensures the
+%% project's app and dependencies are set in the right order
+%% for the next bit of execution
+-spec set_paths(rebar_paths:targets(), rebar_state:t()) -> ok.
+set_paths(List, State) ->
+ rebar_paths:set_paths(List, State).
+
+%% @doc Unsets code paths. Takes arguments of the form
+%% `[plugins, deps]' or `[deps, plugins]' and ensures the
+%% paths are no longer active.
+-spec unset_paths(rebar_paths:targets(), rebar_state:t()) -> ok.
+unset_paths(List, State) ->
+ rebar_paths:unset_paths(List, State).
+
%% @doc Add deps to the code path
-spec add_deps_to_path(rebar_state:t()) -> ok.
add_deps_to_path(State) ->