summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rw-r--r--priv/templates/gitignore.dtl2
-rw-r--r--priv/templates/otp_app.template7
-rw-r--r--priv/templates/otp_lib.template (renamed from priv/templates/otp_lib.template.dtl)0
-rw-r--r--priv/templates/plugin.erl.dtl29
-rw-r--r--priv/templates/plugin.template7
-rw-r--r--priv/templates/plugin_README.md.dtl14
6 files changed, 58 insertions, 1 deletions
diff --git a/priv/templates/gitignore.dtl b/priv/templates/gitignore.dtl
index 79ae0fb..23123d4 100644
--- a/priv/templates/gitignore.dtl
+++ b/priv/templates/gitignore.dtl
@@ -1,6 +1,6 @@
+_*
.eunit
deps
-priv
*.o
*.beam
*.plt
diff --git a/priv/templates/otp_app.template b/priv/templates/otp_app.template
new file mode 100644
index 0000000..db31b31
--- /dev/null
+++ b/priv/templates/otp_app.template
@@ -0,0 +1,7 @@
+{variables, []}.
+{template, "app.erl", "src/{{appid}}_app.erl"}.
+{template, "otp_app.app.src", "src/{{appid}}.app.src"}.
+{template, "rebar.config", "rebar.config"}.
+{template, "gitignore", ".gitignore"}.
+{template, "LICENSE", "LICENSE"}.
+{template, "README.md", "README.md"}.
diff --git a/priv/templates/otp_lib.template.dtl b/priv/templates/otp_lib.template
index 19d7593..19d7593 100644
--- a/priv/templates/otp_lib.template.dtl
+++ b/priv/templates/otp_lib.template
diff --git a/priv/templates/plugin.erl.dtl b/priv/templates/plugin.erl.dtl
new file mode 100644
index 0000000..80a03bb
--- /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:add_provider(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}}