浏览代码

main module of a plugin just has to export init/1

pull/311/head
Tristan Sloughter 10 年前
父节点
当前提交
9eca4b50c5
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. +3
    -6
      src/rebar_plugins.erl

+ 3
- 6
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}

正在加载...
取消
保存