diff options
Diffstat (limited to 'src/rebar_state.erl')
-rw-r--r-- | src/rebar_state.erl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl index f922977..705f723 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -3,6 +3,8 @@ -export([new/0, new/1, new/2, new/3, get/2, get/3, set/3, + code_paths/2, code_paths/3, + opts/1, opts/2, default/1, default/2, @@ -40,6 +42,7 @@ -record(state_t, {dir :: file:name(), opts = dict:new() :: rebar_dict(), + code_paths = dict:new() :: rebar_dict(), default = dict:new() :: rebar_dict(), escript_path :: undefined | file:filename_all(), @@ -132,6 +135,17 @@ default(#state_t{default=Opts}) -> default(State, Opts) -> State#state_t{default=Opts}. +code_paths(#state_t{code_paths=CodePaths}, Key) -> + case dict:find(Key, CodePaths) of + {ok, CodePath} -> + CodePath; + _ -> + [] + end. + +code_paths(State=#state_t{code_paths=CodePaths}, Key, CodePath) -> + State#state_t{code_paths=dict:store(Key, CodePath, CodePaths)}. + opts(#state_t{opts=Opts}) -> Opts. |