summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/plugins.md2
-rw-r--r--priv/templates/gitignore.dtl1
-rw-r--r--priv/templates/plugin.erl.dtl16
-rw-r--r--src/rebar.hrl (renamed from include/rebar.hrl)0
4 files changed, 8 insertions, 11 deletions
diff --git a/doc/plugins.md b/doc/plugins.md
index 5ba8e65..ae43355 100644
--- a/doc/plugins.md
+++ b/doc/plugins.md
@@ -75,8 +75,6 @@ Open up the `src/provider_todo.erl` file and make sure you have the following sk
-export([init/1, do/1, format_error/1]).
--include_lib("rebar3/include/rebar.hrl").
-
-define(PROVIDER, todo).
-define(DEPS, [app_discovery]).
diff --git a/priv/templates/gitignore.dtl b/priv/templates/gitignore.dtl
index 9e09bf1..40a1d4f 100644
--- a/priv/templates/gitignore.dtl
+++ b/priv/templates/gitignore.dtl
@@ -1,3 +1,4 @@
+.rebar3
_*
.eunit
*.o
diff --git a/priv/templates/plugin.erl.dtl b/priv/templates/plugin.erl.dtl
index e525ab3..d3528c0 100644
--- a/priv/templates/plugin.erl.dtl
+++ b/priv/templates/plugin.erl.dtl
@@ -1,11 +1,9 @@
-module({{name}}).
-behaviour(provider).
--export([init/1, do/1, format_error/2]).
+-export([init/1, do/1, format_error/1]).
--include_lib("rebar3/include/rebar.hrl").
-
--define(PROVIDER, todo).
+-define(PROVIDER, {{name}}).
-define(DEPS, [app_discovery]).
%% ===================================================================
@@ -14,10 +12,10 @@
-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
init(State) ->
Provider = providers:create([
- {name, ?PROVIDER}, % The 'user friendly' name of the task
- {module, ?MODULE}, % The module implementation of the task
- {bare, true}, % The task can be run by the user, always true
- {deps, ?DEPS}, % The list of dependencies
+ {name, ?PROVIDER}, % The 'user friendly' name of the task
+ {module, ?MODULE}, % The module implementation of the task
+ {bare, true}, % The task can be run by the user, always true
+ {deps, ?DEPS}, % The list of dependencies
{example, "rebar {{name}}"}, % How to use the plugin
{opts, []}, % list of options understood by the plugin
{short_desc, "{{desc}}"},
@@ -31,5 +29,5 @@ do(State) ->
{ok, State}.
-spec format_error(any()) -> iolist().
-format_error(Reason, State) ->
+format_error(Reason) ->
io_lib:format("~p", [Reason]).
diff --git a/include/rebar.hrl b/src/rebar.hrl
index 794d738..794d738 100644
--- a/include/rebar.hrl
+++ b/src/rebar.hrl