Module clean_diameter

Rebar3 plugin for cleaning compiled diameter files.

Introduced in: 1.0.0

Authors: Carlos Eduardo de Paula.

Description

Rebar3 plugin for cleaning compiled diameter files.

This module provides cleanup functionality for files generated by the diameter compiler plugin. It removes generated .erl and .hrl files, but preserves the original .dia source files.

The cleaner automatically discovers which files were generated based on the .dia files present in the project and removes only those files that would be regenerated by compilation.

Usage

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

Function Index

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

Function Details

do/1

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

State: The current rebar3 state

returns: {ok, State} after cleanup is complete

Execute the diameter cleanup process.

This function performs the cleanup work by:
  1. Discovering all .dia files in the project
  2. Determining which .erl and .hrl files they generated
  3. Removing those generated 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 clean provider.

Sets up the rebar3 provider for cleaning diameter-generated files. This provider removes .erl and .hrl files that were generated from .dia sources during compilation.


Generated by EDoc