diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-09-05 21:12:22 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-09-05 21:12:22 -0400 |
commit | a81357b60587ba42c7d40e94c1a3520169db8a7e (patch) | |
tree | 669a77bd966fbf4b07821e8160ff2b62c9258d6a /src/rebar_state.erl | |
parent | 7de9e6b0a85f11b92a7901c33d3198b09495856e (diff) | |
parent | 8c7bed454d7423cd4ba163bd9aea56d892257885 (diff) |
Merge pull request #777 from tsloughter/current_app
add current_app attribute for setting before calling hooks
Diffstat (limited to 'src/rebar_state.erl')
-rw-r--r-- | src/rebar_state.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl index 2a5aa01..176a80b 100644 --- a/src/rebar_state.erl +++ b/src/rebar_state.erl @@ -27,6 +27,7 @@ dir/1, dir/2, create_logic_providers/2, + current_app/1, current_app/2, project_apps/1, project_apps/2, deps_to_build/1, deps_to_build/2, all_plugin_deps/1, all_plugin_deps/2, update_all_plugin_deps/2, @@ -49,12 +50,13 @@ escript_path :: undefined | file:filename_all(), lock = [], - current_profiles = [default] :: [atom()], - namespace = default :: atom(), + current_profiles = [default] :: [atom()], + namespace = default :: atom(), command_args = [], command_parsed_args = {[], []}, + current_app :: rebar_app_info:t(), project_apps = [] :: [rebar_app_info:t()], deps_to_build = [] :: [rebar_app_info:t()], all_plugin_deps = [] :: [rebar_app_info:t()], @@ -302,6 +304,12 @@ deps_names(State) -> Deps = rebar_state:get(State, deps, []), deps_names(Deps). +current_app(#state_t{current_app=CurrentApp}) -> + CurrentApp. + +current_app(State=#state_t{}, CurrentApp) -> + State#state_t{current_app=CurrentApp}. + project_apps(#state_t{project_apps=Apps}) -> Apps. |