diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-01-31 16:48:55 -0500 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2016-01-31 16:48:55 -0500 |
commit | fceda519992728f3f6b3264adfee59af61b7104d (patch) | |
tree | 5f1688123b54ed784801dacd17f296c3d35e8abd /src | |
parent | 3522c929f9cda647e7fe0b1c8fb10765fabe7d1b (diff) | |
parent | c4aaff7a06f55b555f9278ff20e8225a724d9faa (diff) |
Merge pull request #1045 from tsloughter/master
don't lose overrides in an app when installing plugins it uses
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_plugins.erl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl index b4cc3ec..3c33498 100644 --- a/src/rebar_plugins.erl +++ b/src/rebar_plugins.erl @@ -42,10 +42,20 @@ project_apps_install(State) -> -spec install(rebar_state:t(), rebar_app_info:t()) -> rebar_state:t(). install(State, AppInfo) -> Profiles = rebar_state:current_profiles(State), - lists:foldl(fun(Profile, StateAcc) -> - Plugins = rebar_app_info:get(AppInfo, {plugins, Profile}, []), - handle_plugins(Profile, Plugins, StateAcc) - end, State, Profiles). + + %% don't lose the overrides of the dep we are processing plugins for + Overrides = rebar_app_info:get(AppInfo, overrides, []), + StateOverrides = rebar_state:get(State, overrides, []), + AllOverrides = Overrides ++ StateOverrides, + State1 = rebar_state:set(State, overrides, AllOverrides), + + State2 = lists:foldl(fun(Profile, StateAcc) -> + Plugins = rebar_app_info:get(AppInfo, {plugins, Profile}, []), + handle_plugins(Profile, Plugins, StateAcc) + end, State1, Profiles), + + %% Reset the overrides after processing the dep + rebar_state:set(State2, overrides, StateOverrides). handle_plugins(Profile, Plugins, State) -> handle_plugins(Profile, Plugins, State, false). |