From 2e5496f5f5f3c39bd1e23b4601d1e89d4d2c9767 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Tue, 28 Apr 2015 19:50:55 -0500 Subject: remove use of erlydtl in rebar --- priv/templates/plugin.erl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 priv/templates/plugin.erl (limited to 'priv/templates/plugin.erl') diff --git a/priv/templates/plugin.erl b/priv/templates/plugin.erl new file mode 100644 index 0000000..abf4648 --- /dev/null +++ b/priv/templates/plugin.erl @@ -0,0 +1,33 @@ +-module({{name}}). +-behaviour(provider). + +-export([init/1, do/1, format_error/1]). + +-define(PROVIDER, {{name}}). +-define(DEPS, [app_discovery]). + +%% =================================================================== +%% Public API +%% =================================================================== +-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 + {example, "rebar3 {{name}}"}, % How to use the plugin + {opts, []}, % list of options understood by the plugin + {short_desc, "{{desc}}"}, + {desc, "{{desc}}"} + ]), + {ok, rebar_state:add_provider(State, Provider)}. + + +-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. +do(State) -> + {ok, State}. + +-spec format_error(any()) -> iolist(). +format_error(Reason) -> + io_lib:format("~p", [Reason]). -- cgit v1.1