diff options
| author | Fred Hebert <mononcqc@ferd.ca> | 2018-10-15 11:56:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-15 11:56:57 -0400 |
| commit | 7bfc8110d1736d2cbf61e19d2fc16dc8e854b460 (patch) | |
| tree | 91f6606ad1083eea8e57fcc46821454180b50c94 /src/rebar_api.erl | |
| parent | 86519cf743204eab1d922ca8133fbf00c66f9ee8 (diff) | |
| parent | fb6de6e0e5dc0da1c4e64c166bcb69327420cb60 (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.erl | 17 |
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) -> |
