From 989a1bfe8d991846f81331a94eb65ffc10883cf5 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 20 Sep 2014 08:20:05 -0500 Subject: add plugin template --- priv/templates/plugin.erl.dtl | 29 +++++++++++++++++++++++++++++ priv/templates/plugin.template | 7 +++++++ priv/templates/plugin_README.md.dtl | 14 ++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 priv/templates/plugin.erl.dtl create mode 100644 priv/templates/plugin.template create mode 100644 priv/templates/plugin_README.md.dtl (limited to 'priv/templates') 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}} -- cgit v1.1 From 51f1cf4aae5a22fe8974edcdf10da4e8a7b05255 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 20 Sep 2014 09:01:03 -0500 Subject: install plugins to plugins/ --- priv/templates/plugin.erl.dtl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'priv/templates') diff --git a/priv/templates/plugin.erl.dtl b/priv/templates/plugin.erl.dtl index 3f8c9cd..80a03bb 100644 --- a/priv/templates/plugin.erl.dtl +++ b/priv/templates/plugin.erl.dtl @@ -14,14 +14,14 @@ -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, []}])), + 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()}. -- cgit v1.1 From 6f9ea13dd423d7ff0307265140496fb36c62d924 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 20 Sep 2014 09:08:24 -0500 Subject: move deps and plugins to _ prefixed --- priv/templates/gitignore.dtl | 1 + 1 file changed, 1 insertion(+) (limited to 'priv/templates') diff --git a/priv/templates/gitignore.dtl b/priv/templates/gitignore.dtl index 79ae0fb..0eb9ed8 100644 --- a/priv/templates/gitignore.dtl +++ b/priv/templates/gitignore.dtl @@ -1,3 +1,4 @@ +_* .eunit deps priv -- cgit v1.1 From b37a5ae611aaf6b84a046fbe716f40c2aa8c75d8 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 3 Oct 2014 06:33:33 -0500 Subject: move providers to separate app --- priv/templates/otp_lib.template | 7 +++++++ priv/templates/otp_lib.template.dtl | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 priv/templates/otp_lib.template delete mode 100644 priv/templates/otp_lib.template.dtl (limited to 'priv/templates') diff --git a/priv/templates/otp_lib.template b/priv/templates/otp_lib.template new file mode 100644 index 0000000..19d7593 --- /dev/null +++ b/priv/templates/otp_lib.template @@ -0,0 +1,7 @@ +{variables, []}. +{template, "mod.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, "README.md", "README.md"}. diff --git a/priv/templates/otp_lib.template.dtl b/priv/templates/otp_lib.template.dtl deleted file mode 100644 index 19d7593..0000000 --- a/priv/templates/otp_lib.template.dtl +++ /dev/null @@ -1,7 +0,0 @@ -{variables, []}. -{template, "mod.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, "README.md", "README.md"}. -- cgit v1.1 From fcf2c971568c67d91e822b1104bff697affd09df Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Fri, 3 Oct 2014 06:33:55 -0500 Subject: add otp_app template --- priv/templates/otp_app.template | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 priv/templates/otp_app.template (limited to 'priv/templates') 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"}. -- cgit v1.1 From f1a0249bcf12f08b7aae21aec373fec4cd583dbe Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Mon, 13 Oct 2014 16:23:50 -0500 Subject: preliminary _checkouts/ support --- priv/templates/gitignore.dtl | 1 - 1 file changed, 1 deletion(-) (limited to 'priv/templates') diff --git a/priv/templates/gitignore.dtl b/priv/templates/gitignore.dtl index 0eb9ed8..23123d4 100644 --- a/priv/templates/gitignore.dtl +++ b/priv/templates/gitignore.dtl @@ -1,7 +1,6 @@ _* .eunit deps -priv *.o *.beam *.plt -- cgit v1.1