@@ -74,14 +74,13 @@ The plugin skeleton created by the `rebar3 new emqx-plugin` represents a single
7474
7575```
7676.
77- ├── LICENSE
7877├── Makefile
79- ├── priv
80- │ ├── ...
8178├── README.md
8279├── rebar.config
8380├── scripts
8481│ ├── ...
82+ ├── priv
83+ │ ├── ...
8584└── src
8685 ├── my_emqx_plugin_app.erl
8786 ├── my_emqx_plugin.app.src
@@ -90,13 +89,12 @@ The plugin skeleton created by the `rebar3 new emqx-plugin` represents a single
9089 └── my_emqx_plugin_sup.erl
9190```
9291
93- * ` src ` - The code of the plugin's OTP application.
94- * ` priv ` - The directory for the plugin's configuration files and configuration schema. It contains some example files.
95- * ` rebar.config ` - The rebar3 configuration file used to build the application and pack it into a release.
9692* ` Makefile ` - The entry point for building the plugin.
97- * ` scripts ` - Helper scripts for the ` Makefile ` .
9893* ` README.md ` - Documentation placeholder.
99- * ` LICENSE ` - The plugin's sample license file.
94+ * ` rebar.config ` - The rebar3 configuration file used to build the application and pack it into a release.
95+ * ` scripts ` - Helper scripts for the ` Makefile ` .
96+ * ` priv ` - The directory for the plugin's configuration files and configuration schema. It contains some example files.
97+ * ` src ` - The code of the plugin's OTP application.
10098
10199#### ` rebar.config `
102100
@@ -112,21 +110,21 @@ In the `deps` section, you can add dependencies to other OTP applications that y
112110``` erlang
113111{deps ,
114112 [
115- ...
116- % % this is my plugin's dependency
117- {map_sets , " 1.1.0" }
113+ {emqx_plugin_helper , {git , " https://github.com/emqx/emqx-plugin-helper.git" , {tag , " v5.9.0" }}}
114+ % % more dependencies
118115 ]}.
119116```
120117
121- The skeleton adds a single extra dependency to the plugin: ` map_sets ` . It may be removed if not needed. See
122- [ ` rebar3 ` dependency documentation] ( https://www.rebar3.org/docs/configuration/dependencies/ ) for more details.
118+ The skeleton adds an extra dependency to the plugin: ` emqx_plugin_helper ` .
119+ It is usually needed for plugin code to make use of the record definitions and macros provided in the header files.
120+ See [ ` rebar3 ` dependency documentation] ( https://www.rebar3.org/docs/configuration/dependencies/ ) for more details.
123121
124122In the ` relx ` section, you specify the release name and version, and the list of applications to be included in the release.
125123
126124``` erlang
127125{relx , [ {release , {my_emqx_plugin , " 1.0.0" },
128126 [ my_emqx_plugin
129- , map_sets
127+ , emqx_plugin_helper
130128 ]}
131129 ...
132130 ]}.
@@ -241,7 +239,7 @@ When a plugin is built into a release, the package structure is as follows:
241239
242240```
243241└── my_emqx_plugin-1.1.0.tar.gz
244- ├── map_sets-1.1 .0
242+ ├── emqx_plugin_helper_vsn-5.9 .0
245243 ├── my_emqx_plugin-0.1.0
246244 ├── README.md
247245 └── release.json
@@ -272,7 +270,7 @@ I.e. the tarball contains the compiled applications (listed in the `relx` sectio
272270 "metadata_vsn" : " 0.2.0" ,
273271 "rel_apps" : [
274272 " my_emqx_plugin-0.1.0" ,
275- " map_sets-1.1 .0"
273+ " emqx_plugin_helper-5.9 .0"
276274 ],
277275 "rel_vsn" : " 1.1.0" ,
278276 "with_config_schema" : true
0 commit comments