chore(build): Add README for lib-extra

This commit is contained in:
Zaiming Shi 2021-03-06 23:12:37 +01:00
parent 625755ea33
commit e495213618
2 changed files with 51 additions and 2 deletions

50
lib-extra/README.md Normal file
View File

@ -0,0 +1,50 @@
# EMQ X Extra plugin apps
This directory keeps a `plugins` file which defines all the approved
external plugins from open-source community.
The (maybe broken) symlinks are keept to help testing plugins
in this umbrella project.
## How to build `plugin_foo`
Add `plugin_foo` as a rebar3 dependency in `plugins` file.
e.g.
```
{erlang_plugins,
[ {plugin_foo, {git, "https://github.com/bar/plugin-foo.git", {tag, "0.1.0"}}}
]
}.
```
Exeucte command
```
export EMQX_EXTRA_PLUGINS='plugin_foo'
make
```
The plugin source code should downloaded to `_build/default/lib/plugin_foo`
NOTE: Shallow clone with depth=1 is used for git dependencies.
## How to test `plugin_foo`
If the source code in `_build` is already symlinked from `lib-extra/`,
you may directlly run tests with commands below.
```bash
./rebar3 eunit --dir lib-extra/plugin_foo
./rebar3 ct --dir lib-extra/plugin_foo
```
In case the plugin is being actively developed
it can be cloned to `lib-extra`, e.g. `lib-extra/plugin-bar-dev`
then it can be tested with commands below:
```bash
./rebar3 eunit --dir lib-extra/plugin-bar-dev
./rebar3 ct --dir lib-extra/plugin-bar-dev
```

View File

@ -1,5 +1,4 @@
{erlang_plugins, {erlang_plugins,
[ [ {emqx_plugin_template, {git, "https://github.com/emqx/emqx-plugin-template", {branch, "master"}}}
{emqx_plugin_template, {git, "https://github.com/emqx/emqx-plugin-template", {branch, "master"}}}
] ]
}. }.