Custom Compiler Modules
This is a new feature in Rebar3 3.7.0, to write custom compilers to be used with it. It is useful whenever you have files of a different language that you want to build alongside Erlang resources. Starting with Rebar3 3.14.0, the interface was enhanced to allow better tracking of files in a directed acyclic graph (DAG), which lets you annotate build artifacts and allows Rebar3 to track dependencies across applications.
This interface is currently used internally for .xrl
, .yrl
, and .mib
files. Few plugins have tried it.
🚧
This is an unstable interface
Since we have not had many plugin authors try this interface yet, it is marked as unstable and is subject to change.
We are looking for help from contributors to further stabilize it before marking it as stable. You should use this if you are willing to contact us, and help iterate on the features available in Custom Compiler Plugins.
It is possible that your custom compiler requires something more complex. For example, the facilities provided by this interface are insufficient to build projects that run with
mix
as a build tool, and the plugin for that uses a custom compiler plugin.
Current Interface
The following callbacks are defined:
Initializing a Compiler Module as a Plugin
Register the compiler module in the same place where you would register a custom compiler plugin: