Kaynağa Gözat

Built-in templates create the project directory

pull/6/head
Fred Hebert 10 yıl önce
ebeveyn
işleme
ad9ca0cc86
6 değiştirilmiş dosya ile 32 ekleme ve 30 silme
  1. +3
    -2
      doc/plugins.md
  2. +1
    -0
      doc/templates.md
  3. +6
    -6
      priv/templates/app.template
  4. +6
    -6
      priv/templates/lib.template
  5. +6
    -6
      priv/templates/plugin.template
  6. +10
    -10
      priv/templates/release.template

+ 3
- 2
doc/plugins.md Dosyayı Görüntüle

@ -61,10 +61,11 @@ In this tutorial, we'll show how to start from scratch, and get a basic plugin w
The first step is to create a new OTP Application that will contain the plugin:
→ git init
Initialized empty Git repository in /Users/ferd/code/self/rebar3-todo-plugin/.git/
→ rebar3 new plugin provider_todo desc="example rebar3 plugin"
...
→ cd provider_todo
→ git init
Initialized empty Git repository in /Users/ferd/code/self/provider_todo/.git/
Open up the `src/provider_todo.erl` file and make sure you have the following skeleton in place:

+ 1
- 0
doc/templates.md Dosyayı Görüntüle

@ -73,6 +73,7 @@ Alternatively, the `name` variable is special -- if the first argument to a temp
→ ./rebar3 new plugin demo author_name="Fred H."
...
Then go to the directory created for the project by rebar3.
## Custom Templates ##

+ 6
- 6
priv/templates/app.template Dosyayı Görüntüle

@ -3,9 +3,9 @@
{name, "mylib", "Name of the OTP application"},
{desc, "An OTP application", "Short description of the app"}
]}.
{template, "app.erl.dtl", "src/{{name}}_app.erl"}.
{template, "otp_app.app.src.dtl", "src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "rebar.config"}.
{template, "gitignore.dtl", ".gitignore"}.
{template, "LICENSE.dtl", "LICENSE"}.
{template, "README.md.dtl", "README.md"}.
{template, "app.erl.dtl", "{{name}}/src/{{name}}_app.erl"}.
{template, "otp_app.app.src.dtl", "{{name}}/src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "{{name}}/rebar.config"}.
{template, "gitignore.dtl", "{{name}}/.gitignore"}.
{template, "LICENSE.dtl", "{{name}}/LICENSE"}.
{template, "README.md.dtl", "{{name}}/README.md"}.

+ 6
- 6
priv/templates/lib.template Dosyayı Görüntüle

@ -3,9 +3,9 @@
{name, "mylib", "Name of the OTP library application"},
{desc, "An OTP library", "Short description of the app"}
]}.
{template, "mod.erl.dtl", "src/{{name}}.erl"}.
{template, "otp_lib.app.src.dtl", "src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "rebar.config"}.
{template, "gitignore.dtl", ".gitignore"}.
{template, "LICENSE.dtl", "LICENSE"}.
{template, "README.md.dtl", "README.md"}.
{template, "mod.erl.dtl", "{{name}}/src/{{name}}.erl"}.
{template, "otp_lib.app.src.dtl", "{{name}}/src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "{{name}}/rebar.config"}.
{template, "gitignore.dtl", "{{name}}/.gitignore"}.
{template, "LICENSE.dtl", "{{name}}/LICENSE"}.
{template, "README.md.dtl", "{{name}}/README.md"}.

+ 6
- 6
priv/templates/plugin.template Dosyayı Görüntüle

@ -3,9 +3,9 @@
{name, "myplugin", "Name of the plugin"},
{desc, "A rebar plugin", "Short description of the plugin's purpose"}
]}.
{template, "plugin.erl.dtl", "src/{{name}}.erl"}.
{template, "otp_lib.app.src.dtl", "src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "rebar.config"}.
{template, "gitignore.dtl", ".gitignore"}.
{template, "LICENSE.dtl", "LICENSE"}.
{template, "plugin_README.md.dtl", "README.md"}.
{template, "plugin.erl.dtl", "{{name}}/src/{{name}}.erl"}.
{template, "otp_lib.app.src.dtl", "{{name}}/src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "{{name}}/rebar.config"}.
{template, "gitignore.dtl", "{{name}}/.gitignore"}.
{template, "LICENSE.dtl", "{{name}}/LICENSE"}.
{template, "plugin_README.md.dtl", "{{name}}/README.md"}.

+ 10
- 10
priv/templates/release.template Dosyayı Görüntüle

@ -3,13 +3,13 @@
{name, "myapp", "Name of the OTP release. An app with this name will also be created."},
{desc, "An OTP application", "Short description of the release's main app's purpose"}
]}.
{template, "app.erl.dtl", "{{apps_dir}}/{{name}}/src/{{name}}_app.erl"}.
{template, "sup.erl.dtl", "{{apps_dir}}/{{name}}/src/{{name}}_sup.erl"}.
{template, "otp_app.app.src.dtl", "{{apps_dir}}/{{name}}/src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "rebar.config"}.
{template, "relx.config.dtl", "relx.config"}.
{template, "sys.config.dtl", "config/sys.config"}.
{template, "vm.args.dtl", "config/vm.args"}.
{template, "gitignore.dtl", ".gitignore"}.
{template, "LICENSE.dtl", "LICENSE"}.
{template, "README.md.dtl", "README.md"}.
{template, "app.erl.dtl", "{{name}}/{{apps_dir}}/{{name}}/src/{{name}}_app.erl"}.
{template, "sup.erl.dtl", "{{name}}/{{apps_dir}}/{{name}}/src/{{name}}_sup.erl"}.
{template, "otp_app.app.src.dtl", "{{name}}/{{apps_dir}}/{{name}}/src/{{name}}.app.src"}.
{template, "rebar.config.dtl", "{{name}}/rebar.config"}.
{template, "relx.config.dtl", "{{name}}/relx.config"}.
{template, "sys.config.dtl", "{{name}}/config/sys.config"}.
{template, "vm.args.dtl", "{{name}}/config/vm.args"}.
{template, "gitignore.dtl", "{{name}}/.gitignore"}.
{template, "LICENSE.dtl", "{{name}}/LICENSE"}.
{template, "README.md.dtl", "{{name}}/README.md"}.

Yükleniyor…
İptal
Kaydet