From 48769e75c224ccd8e04df250b86b50540270ce9a Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Wed, 17 Sep 2014 08:52:49 -0500 Subject: wip: move to erlydtl for rebar templates --- priv/templates/LICENSE | 29 ----------------------------- priv/templates/LICENSE.dtl | 29 +++++++++++++++++++++++++++++ priv/templates/README.md | 9 --------- priv/templates/README.md.dtl | 9 +++++++++ priv/templates/app.erl | 27 --------------------------- priv/templates/app.erl.dtl | 27 +++++++++++++++++++++++++++ priv/templates/gitignore | 13 ------------- priv/templates/gitignore.dtl | 13 +++++++++++++ priv/templates/mod.erl | 13 ------------- priv/templates/mod.erl.dtl | 13 +++++++++++++ priv/templates/otp_app.app.src | 12 ------------ priv/templates/otp_app.app.src.dtl | 12 ++++++++++++ priv/templates/otp_lib.app.src | 11 ----------- priv/templates/otp_lib.app.src.dtl | 11 +++++++++++ priv/templates/otp_lib.template | 7 ------- priv/templates/otp_lib.template.dtl | 7 +++++++ priv/templates/rebar.config | 2 -- priv/templates/rebar.config.dtl | 2 ++ priv/templates/relx.config | 12 ------------ priv/templates/relx.config.dtl | 12 ++++++++++++ priv/templates/sup.erl | 35 ----------------------------------- priv/templates/sup.erl.dtl | 35 +++++++++++++++++++++++++++++++++++ priv/templates/sys.config | 3 --- priv/templates/sys.config.dtl | 3 +++ priv/templates/vm.args | 6 ------ priv/templates/vm.args.dtl | 6 ++++++ 26 files changed, 179 insertions(+), 179 deletions(-) delete mode 100644 priv/templates/LICENSE create mode 100644 priv/templates/LICENSE.dtl delete mode 100644 priv/templates/README.md create mode 100644 priv/templates/README.md.dtl delete mode 100644 priv/templates/app.erl create mode 100644 priv/templates/app.erl.dtl delete mode 100644 priv/templates/gitignore create mode 100644 priv/templates/gitignore.dtl delete mode 100644 priv/templates/mod.erl create mode 100644 priv/templates/mod.erl.dtl delete mode 100644 priv/templates/otp_app.app.src create mode 100644 priv/templates/otp_app.app.src.dtl delete mode 100644 priv/templates/otp_lib.app.src create mode 100644 priv/templates/otp_lib.app.src.dtl delete mode 100644 priv/templates/otp_lib.template create mode 100644 priv/templates/otp_lib.template.dtl delete mode 100644 priv/templates/rebar.config create mode 100644 priv/templates/rebar.config.dtl delete mode 100644 priv/templates/relx.config create mode 100644 priv/templates/relx.config.dtl delete mode 100644 priv/templates/sup.erl create mode 100644 priv/templates/sup.erl.dtl delete mode 100644 priv/templates/sys.config create mode 100644 priv/templates/sys.config.dtl delete mode 100644 priv/templates/vm.args create mode 100644 priv/templates/vm.args.dtl (limited to 'priv') diff --git a/priv/templates/LICENSE b/priv/templates/LICENSE deleted file mode 100644 index 5ce77ce..0000000 --- a/priv/templates/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) {{copyright_year}}, {{copyright_holder}} <{{author_email}}>. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/priv/templates/LICENSE.dtl b/priv/templates/LICENSE.dtl new file mode 100644 index 0000000..5ce77ce --- /dev/null +++ b/priv/templates/LICENSE.dtl @@ -0,0 +1,29 @@ +Copyright (c) {{copyright_year}}, {{copyright_holder}} <{{author_email}}>. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/priv/templates/README.md b/priv/templates/README.md deleted file mode 100644 index ce2898e..0000000 --- a/priv/templates/README.md +++ /dev/null @@ -1,9 +0,0 @@ -{{appid}} -===== - -An Erlang {{appid}} library. - -Build ------ - - $ rebar compile diff --git a/priv/templates/README.md.dtl b/priv/templates/README.md.dtl new file mode 100644 index 0000000..ce2898e --- /dev/null +++ b/priv/templates/README.md.dtl @@ -0,0 +1,9 @@ +{{appid}} +===== + +An Erlang {{appid}} library. + +Build +----- + + $ rebar compile diff --git a/priv/templates/app.erl b/priv/templates/app.erl deleted file mode 100644 index 1c3e8f2..0000000 --- a/priv/templates/app.erl +++ /dev/null @@ -1,27 +0,0 @@ -%%%------------------------------------------------------------------- -%% @doc {{appid}} public API -%% @end -%%%------------------------------------------------------------------- - --module({{appid}}_app). - --behaviour(application). - -%% Application callbacks --export([start/2 - ,stop/1]). - -%%==================================================================== -%% API -%%==================================================================== - -start(_StartType, _StartArgs) -> - {{appid}}_sup:start_link(). - -%%-------------------------------------------------------------------- -stop(_State) -> - ok. - -%%==================================================================== -%% Internal functions -%%==================================================================== diff --git a/priv/templates/app.erl.dtl b/priv/templates/app.erl.dtl new file mode 100644 index 0000000..1c3e8f2 --- /dev/null +++ b/priv/templates/app.erl.dtl @@ -0,0 +1,27 @@ +%%%------------------------------------------------------------------- +%% @doc {{appid}} public API +%% @end +%%%------------------------------------------------------------------- + +-module({{appid}}_app). + +-behaviour(application). + +%% Application callbacks +-export([start/2 + ,stop/1]). + +%%==================================================================== +%% API +%%==================================================================== + +start(_StartType, _StartArgs) -> + {{appid}}_sup:start_link(). + +%%-------------------------------------------------------------------- +stop(_State) -> + ok. + +%%==================================================================== +%% Internal functions +%%==================================================================== diff --git a/priv/templates/gitignore b/priv/templates/gitignore deleted file mode 100644 index 79ae0fb..0000000 --- a/priv/templates/gitignore +++ /dev/null @@ -1,13 +0,0 @@ -.eunit -deps -priv -*.o -*.beam -*.plt -.erlang.cookie -ebin -log -erl_crash.dump -.rebar -_rel -logs diff --git a/priv/templates/gitignore.dtl b/priv/templates/gitignore.dtl new file mode 100644 index 0000000..79ae0fb --- /dev/null +++ b/priv/templates/gitignore.dtl @@ -0,0 +1,13 @@ +.eunit +deps +priv +*.o +*.beam +*.plt +.erlang.cookie +ebin +log +erl_crash.dump +.rebar +_rel +logs diff --git a/priv/templates/mod.erl b/priv/templates/mod.erl deleted file mode 100644 index 1be8186..0000000 --- a/priv/templates/mod.erl +++ /dev/null @@ -1,13 +0,0 @@ --module({{appid}}). - -%% Application callbacks --export([]). - -%%==================================================================== -%% API -%%==================================================================== - - -%%==================================================================== -%% Internal functions -%%==================================================================== diff --git a/priv/templates/mod.erl.dtl b/priv/templates/mod.erl.dtl new file mode 100644 index 0000000..1be8186 --- /dev/null +++ b/priv/templates/mod.erl.dtl @@ -0,0 +1,13 @@ +-module({{appid}}). + +%% Application callbacks +-export([]). + +%%==================================================================== +%% API +%%==================================================================== + + +%%==================================================================== +%% Internal functions +%%==================================================================== diff --git a/priv/templates/otp_app.app.src b/priv/templates/otp_app.app.src deleted file mode 100644 index 1a4e4e8..0000000 --- a/priv/templates/otp_app.app.src +++ /dev/null @@ -1,12 +0,0 @@ -{application, {{appid}}, - [ - {description, "{{appid}}"} - ,{vsn, "0.1.0"} - ,{registered, []} - ,{mod, {'{{appid}}_app', []}} - ,{applications, - [kernel - ,stdlib - ]} - ,{env,[]} - ]}. diff --git a/priv/templates/otp_app.app.src.dtl b/priv/templates/otp_app.app.src.dtl new file mode 100644 index 0000000..1a4e4e8 --- /dev/null +++ b/priv/templates/otp_app.app.src.dtl @@ -0,0 +1,12 @@ +{application, {{appid}}, + [ + {description, "{{appid}}"} + ,{vsn, "0.1.0"} + ,{registered, []} + ,{mod, {'{{appid}}_app', []}} + ,{applications, + [kernel + ,stdlib + ]} + ,{env,[]} + ]}. diff --git a/priv/templates/otp_lib.app.src b/priv/templates/otp_lib.app.src deleted file mode 100644 index 5009c3d..0000000 --- a/priv/templates/otp_lib.app.src +++ /dev/null @@ -1,11 +0,0 @@ -{application, {{appid}}, - [ - {description, "{{appid}}"} - ,{vsn, "0.1.0"} - ,{registered, []} - ,{applications, - [kernel - ,stdlib - ]} - ,{env,[]} - ]}. diff --git a/priv/templates/otp_lib.app.src.dtl b/priv/templates/otp_lib.app.src.dtl new file mode 100644 index 0000000..5009c3d --- /dev/null +++ b/priv/templates/otp_lib.app.src.dtl @@ -0,0 +1,11 @@ +{application, {{appid}}, + [ + {description, "{{appid}}"} + ,{vsn, "0.1.0"} + ,{registered, []} + ,{applications, + [kernel + ,stdlib + ]} + ,{env,[]} + ]}. diff --git a/priv/templates/otp_lib.template b/priv/templates/otp_lib.template deleted file mode 100644 index 19d7593..0000000 --- a/priv/templates/otp_lib.template +++ /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"}. diff --git a/priv/templates/otp_lib.template.dtl b/priv/templates/otp_lib.template.dtl new file mode 100644 index 0000000..19d7593 --- /dev/null +++ b/priv/templates/otp_lib.template.dtl @@ -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/rebar.config b/priv/templates/rebar.config deleted file mode 100644 index f618f3e..0000000 --- a/priv/templates/rebar.config +++ /dev/null @@ -1,2 +0,0 @@ -{erl_opts, [debug_info]}. -{deps, []}. \ No newline at end of file diff --git a/priv/templates/rebar.config.dtl b/priv/templates/rebar.config.dtl new file mode 100644 index 0000000..f618f3e --- /dev/null +++ b/priv/templates/rebar.config.dtl @@ -0,0 +1,2 @@ +{erl_opts, [debug_info]}. +{deps, []}. \ No newline at end of file diff --git a/priv/templates/relx.config b/priv/templates/relx.config deleted file mode 100644 index 7cb3a8a..0000000 --- a/priv/templates/relx.config +++ /dev/null @@ -1,12 +0,0 @@ -%% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- -{release, {'{{appid}}', "0.1.0"}, - [{{appid}}, - sasl]}. - -{sys_config, "./config/sys.config"}. -{vm_args, "./config/vm.args"}. - -{dev_mode, true}. -{include_erts, false}. - -{extended_start_script, true}. diff --git a/priv/templates/relx.config.dtl b/priv/templates/relx.config.dtl new file mode 100644 index 0000000..7cb3a8a --- /dev/null +++ b/priv/templates/relx.config.dtl @@ -0,0 +1,12 @@ +%% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- +{release, {'{{appid}}', "0.1.0"}, + [{{appid}}, + sasl]}. + +{sys_config, "./config/sys.config"}. +{vm_args, "./config/vm.args"}. + +{dev_mode, true}. +{include_erts, false}. + +{extended_start_script, true}. diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl deleted file mode 100644 index 3dd5b12..0000000 --- a/priv/templates/sup.erl +++ /dev/null @@ -1,35 +0,0 @@ -%%%------------------------------------------------------------------- -%% @doc {{appid}} top level supervisor. -%% @end -%%%------------------------------------------------------------------- - --module({{appid}}_sup). - --behaviour(supervisor). - -%% API --export([start_link/0]). - -%% Supervisor callbacks --export([init/1]). - --define(SERVER, ?MODULE). - -%%==================================================================== -%% API functions -%%==================================================================== - -start_link() -> - supervisor:start_link({local, ?SERVER}, ?MODULE, []). - -%%==================================================================== -%% Supervisor callbacks -%%==================================================================== - -%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} -init([]) -> - {ok, { {one_for_all, 0, 1}, []} }. - -%%==================================================================== -%% Internal functions -%%==================================================================== diff --git a/priv/templates/sup.erl.dtl b/priv/templates/sup.erl.dtl new file mode 100644 index 0000000..3dd5b12 --- /dev/null +++ b/priv/templates/sup.erl.dtl @@ -0,0 +1,35 @@ +%%%------------------------------------------------------------------- +%% @doc {{appid}} top level supervisor. +%% @end +%%%------------------------------------------------------------------- + +-module({{appid}}_sup). + +-behaviour(supervisor). + +%% API +-export([start_link/0]). + +%% Supervisor callbacks +-export([init/1]). + +-define(SERVER, ?MODULE). + +%%==================================================================== +%% API functions +%%==================================================================== + +start_link() -> + supervisor:start_link({local, ?SERVER}, ?MODULE, []). + +%%==================================================================== +%% Supervisor callbacks +%%==================================================================== + +%% Child :: {Id,StartFunc,Restart,Shutdown,Type,Modules} +init([]) -> + {ok, { {one_for_all, 0, 1}, []} }. + +%%==================================================================== +%% Internal functions +%%==================================================================== diff --git a/priv/templates/sys.config b/priv/templates/sys.config deleted file mode 100644 index e678cf7..0000000 --- a/priv/templates/sys.config +++ /dev/null @@ -1,3 +0,0 @@ -[ - {'{{appid}}', []} -]. diff --git a/priv/templates/sys.config.dtl b/priv/templates/sys.config.dtl new file mode 100644 index 0000000..e678cf7 --- /dev/null +++ b/priv/templates/sys.config.dtl @@ -0,0 +1,3 @@ +[ + {'{{appid}}', []} +]. diff --git a/priv/templates/vm.args b/priv/templates/vm.args deleted file mode 100644 index 27028ac..0000000 --- a/priv/templates/vm.args +++ /dev/null @@ -1,6 +0,0 @@ --name {{appid}} - --setcookie {{appid}}_cookie - -+K true -+A30 diff --git a/priv/templates/vm.args.dtl b/priv/templates/vm.args.dtl new file mode 100644 index 0000000..27028ac --- /dev/null +++ b/priv/templates/vm.args.dtl @@ -0,0 +1,6 @@ +-name {{appid}} + +-setcookie {{appid}}_cookie + ++K true ++A30 -- cgit v1.1