Git Product home page Git Product logo

rebar3_emqx_plugin's Introduction

Rebar3 EMQ X Plugin Template

How to use templates

To make the template available, you need to clone the repo to your ~/.config/rebar3/templates directory:

mkdir -p ~/.config/rebar3/templates
git clone https://github.com/emqx/rebar3_emqx_plugin ~/.config/rebar3/templates

Creating Erlang/OTP service layout

If you want to create a new directory layout for your new service you can do the following:

rebar3 new emqx-plugin <plugin-name>

For example:

rebar3 new emqx-plugin emqx_auth_mysql

Note: You need rebar3 installed in your system.

This will generate the initial framework of an EMQ X plugin.

Requirements: erlang, git,rebar3

rebar3_emqx_plugin's People

Contributors

gilbertwong96 avatar hjianbo avatar wwhai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rebar3_emqx_plugin's Issues

Generated plugin fails to compile

After generating a plugin and initializing a master branch (a git repo and master branch are required) I tried to compile by running rebar3 compile (there are no instructions on usage which would be appreciated but that seems like a logical step). The compilation fails: (update: most of the other plugins exhibit this same failure, not unique to the rebar3 plugin.

===> Compiling _build/default/lib/esockd/src/esockd_transport.erl failed _build/default/lib/esockd/src/esockd_transport.erl:20: can't find include lib "ssl/src/ssl_api.hrl"

Plugin template references non-existent branc

The generated plugin project fails to compile.

===> Verifying dependencies...
===> Fetching emqx (from {git,"https://github.com/emqx/emqx",{branch,"develop"}})
===> Failed to fetch and copy dep: {git,"https://github.com/emqx/emqx",
{branch,"develop"}}

Indeed there is no "develop" branch.

Update: users must initialize a git repo (e.g., git init) and initiate a commit to get a master branch created. The template code runs git to capture the branch name (in the folder generated by the rebar template). Since there is no branch until you commit (even after git init . there is no branch) the template fails to see "master" and falls back to "develop".

Side note: those new to emq (and Erlang development) would welcome some complete end-to-end steps to generating and deploying the plugin to emq. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.