Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
#ASN.1 compiler plugin for Rebar3
# ASN.1 compiler plugin for Rebar3

Plugin for compiling ASN.1 modules with Rebar3.

##Installation
## Installation

Add plugin to your project `rebar.config` file.

{plugins, [
{ rebar3_asn1_compiler, "1.0.0"}
]}.
```erlang
{plugins, [
{ rebar3_asn1_compiler, "1.0.0"}
]}.
```

##Usage
## Usage

Define ASN.1 compiler options in `rebar.config` and add output directory to Erlang source directories.
Supported options are listed at [ASN.1 compiler documentation](http://www.erlang.org/doc/man/asn1ct.html).
In addition, `{asndir, "asn1"}` can be used for defining the directory containing
the ASN.1 modules. The default options are `[{asndir, "asn1"}, {outdir, "asn1_gen"}, noobj]`.

{asn1_opts, [{outdir, "asn1_gen"}, uper]}.
{src_dirs, ["src", "asn1_gen"]}.
```erlang
{asn1_opts, [{outdir, "asn1_gen"}, uper]}.
{src_dirs, ["src", "asn1_gen"]}.
```

Additionally, plugin can be hooked into standard `compile` and `clean` commands.

{provider_hooks, [
{pre,
[{clean, {asn1, clean}},
{compile, {asn1, compile}}]}
]}.
```erlang
{provider_hooks, [
{pre,
[{clean, {asn1, clean}},
{compile, {asn1, compile}}]}
]}.
```

Stand-alone `compile` and `clean` commands are defined in `asn1` namespace

rebar3 asn1 compile
rebar3 asn1 clean

##Contributing
## Contributing

Feel free to send pull requests, feature requests or issue reports.

##License
## License

MIT.