summaryrefslogtreecommitdiff
path: root/src/rebar_plugins.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-02-19 10:30:35 -0500
committerFred Hebert <mononcqc@ferd.ca>2015-02-19 10:30:35 -0500
commitf93a70905f4eebbcb9dbb0ac62464581a245c6e5 (patch)
tree3d13bca6e5209786728859469e43f1b142433853 /src/rebar_plugins.erl
parentc3cdecf1252fe51caa7b9aeb0e1f77bd735c0131 (diff)
parent62ff6718fd3671dac98278d57f97a6fb089c374f (diff)
Merge pull request #165 from tsloughter/project_app_info
update project app list with new appinfo records after build
Diffstat (limited to 'src/rebar_plugins.erl')
-rw-r--r--src/rebar_plugins.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl
index 45cb5c9..333d8a1 100644
--- a/src/rebar_plugins.erl
+++ b/src/rebar_plugins.erl
@@ -32,14 +32,7 @@ handle_plugin(Plugin, State) ->
Apps = rebar_state:all_deps(State1),
ToBuild = lists:dropwhile(fun rebar_app_info:valid/1, Apps),
- lists:foreach(fun(AppInfo) ->
- AppDir = rebar_app_info:dir(AppInfo),
- C = rebar_config:consult(AppDir),
- S = rebar_state:new(rebar_state:new(), C, AppDir),
- rebar_prv_compile:build(S, AppInfo),
- true = code:add_patha(filename:join(AppDir, "ebin"))
- end, ToBuild),
-
+ [build_plugin(AppInfo) || AppInfo <- ToBuild],
plugin_providers(Plugin)
catch
C:T ->
@@ -48,6 +41,13 @@ handle_plugin(Plugin, State) ->
false
end.
+build_plugin(AppInfo) ->
+ AppDir = rebar_app_info:dir(AppInfo),
+ C = rebar_config:consult(AppDir),
+ S = rebar_state:new(rebar_state:new(), C, AppDir),
+ rebar_prv_compile:compile(S, AppInfo),
+ true = code:add_patha(filename:join(AppDir, "ebin")).
+
plugin_providers({Plugin, _, _}) when is_atom(Plugin) ->
validate_plugin(Plugin);
plugin_providers({Plugin, _}) when is_atom(Plugin) ->