diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-04-03 15:00:35 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-04-03 15:00:35 -0400 |
commit | f51ac0ba8ec126750e46b01a3993b00e3776a36f (patch) | |
tree | 39be3153530a24964c5bc15531b91e97136202e8 | |
parent | 7df2ef4c8410c4b783d9bee1ad40e0cc03a131cf (diff) | |
parent | 9eca4b50c53e96127ae1978c2063e85dac1a17f5 (diff) |
Merge pull request #311 from tsloughter/plugins_init
main module of a plugin just has to export init/1
-rw-r--r-- | src/rebar_plugins.erl | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rebar_plugins.erl b/src/rebar_plugins.erl index 333d8a1..5a0ca3c 100644 --- a/src/rebar_plugins.erl +++ b/src/rebar_plugins.erl @@ -61,13 +61,10 @@ validate_plugin(Plugin) -> {ok, Providers} -> {true, Providers}; undefined -> - Exports = sets:from_list(Plugin:module_info(exports)), - Required = sets:from_list([{init,1}, - {do,1}, - {format_error,1}]), - case sets:is_subset(Required, Exports) of + Exports = Plugin:module_info(exports), + case lists:member({init,1}, Exports) of false -> - ?WARN("Plugin ~p is not a provider. It will not be used.~n", [Plugin]), + ?WARN("Plugin ~p does not export init/1. It will not be used.~n", [Plugin]), false; true -> {true, Plugin} |