Module compile_diameter

Rebar3 plugin for compiling Diameter protocol dictionary files (.dia).

Introduced in: 1.0.0

Authors: Carlos Eduardo de Paula.

Description

Rebar3 plugin for compiling Diameter protocol dictionary files (.dia).

This module provides compilation support for Diameter protocol dictionary files in rebar3 projects. It automatically discovers .dia files in the dia/ directory, resolves dependencies based on @inherits directives, and generates corresponding .erl and .hrl files for use with Erlang's diameter application.

Configuration

The plugin supports the following rebar.config options:
  {dia_opts, [
      {outdir, "custom_src"},           % Output directory for .erl files (default: "src")
      {include, ["path/to/deps"]},      % Additional include paths
      {recursive, true}                 % Recursively search for .dia files (default: true)
  ]}.
 
  {dia_first_files, [
      "base_dictionary.dia"             % Files to compile first
  ]}.
 
  {dia_only_files, [
      "specific_dict"                   % Only compile these dictionaries
  ]}.

Usage

The plugin is typically invoked automatically via provider hooks:
  rebar3 diameter compile

Function Index

do/1Execute the diameter compilation process.
format_error/1Format error messages for user display.
init/1Initialize the diameter compile provider.

Function Details

do/1

do(State :: rebar_state:t()) -> {ok, rebar_state:t()}

State: The current rebar3 state

returns: {ok, State} on successful compilation

Execute the diameter compilation process.

This function performs the main compilation work:
  1. Discovers all .dia files in the project
  2. Resolves dependencies between dictionaries
  3. Compiles files in dependency order
  4. Generates .erl and .hrl files

format_error/1

format_error(Reason :: any()) -> iolist()

Reason: The error term to format

returns: Formatted error message as iolist

Format error messages for user display.

init/1

init(State :: rebar_state:t()) -> {ok, rebar_state:t()}

State: The current rebar3 state

returns: {ok, UpdatedState} with the provider registered

Initialize the diameter compile provider.

Sets up the rebar3 provider for compiling diameter files. This function registers the provider with the rebar3 system and defines its properties such as dependencies, description, and command-line options.


Generated by EDoc