summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2014-09-20 08:20:05 -0500
committerTristan Sloughter <t@crashfast.com>2014-09-20 08:20:05 -0500
commit989a1bfe8d991846f81331a94eb65ffc10883cf5 (patch)
tree5769cb49e761a4aad14a7215b5cfcd10f1517371 /priv
parentf4f96a356fcefaa2ad388eb5469c7da901846f21 (diff)
add plugin template
Diffstat (limited to 'priv')
-rw-r--r--priv/templates/plugin.erl.dtl29
-rw-r--r--priv/templates/plugin.template7
-rw-r--r--priv/templates/plugin_README.md.dtl14
3 files changed, 50 insertions, 0 deletions
diff --git a/priv/templates/plugin.erl.dtl b/priv/templates/plugin.erl.dtl
new file mode 100644
index 0000000..3f8c9cd
--- /dev/null
+++ b/priv/templates/plugin.erl.dtl
@@ -0,0 +1,29 @@
+-module({{appid}}).
+
+-behaviour(rebar_provider).
+
+-export([init/1,
+ do/1]).
+
+-define(PROVIDER, {{appid}}).
+-define(DEPS, []).
+
+%% ===================================================================
+%% Public API
+%% ===================================================================
+
+-spec init(rebar_state:t()) -> {ok, rebar_state:t()}.
+init(State) ->
+ State1 = rebar_state:(State, rebar_provider:create([{name, ?PROVIDER},
+ {provider_impl, ?MODULE},
+ {bare, false},
+ {deps, ?DEPS},
+ {example, "rebar {{appid}}"},
+ {short_desc, "{{appid}} plugin."},
+ {desc, ""},
+ {opts, []}])),
+ {ok, State1}.
+
+-spec do(rebar_state:t()) -> {ok, rebar_state:t()}.
+do(State) ->
+ {ok, State}.
diff --git a/priv/templates/plugin.template b/priv/templates/plugin.template
new file mode 100644
index 0000000..bc44863
--- /dev/null
+++ b/priv/templates/plugin.template
@@ -0,0 +1,7 @@
+{variables, []}.
+{template, "plugin.erl", "src/{{appid}}.erl"}.
+{template, "otp_lib.app.src", "src/{{appid}}.app.src"}.
+{template, "rebar.config", "rebar.config"}.
+{template, "gitignore", ".gitignore"}.
+{template, "LICENSE", "LICENSE"}.
+{template, "plugin_README.md", "README.md"}.
diff --git a/priv/templates/plugin_README.md.dtl b/priv/templates/plugin_README.md.dtl
new file mode 100644
index 0000000..19990f5
--- /dev/null
+++ b/priv/templates/plugin_README.md.dtl
@@ -0,0 +1,14 @@
+{{appid}}
+=====
+
+Rebar3 plugin
+
+Build
+-----
+
+ $ rebar3 compile
+
+Use
+---
+
+ $ rebar3 {{appid}}