Reads application builds and compares their modules.
A build is the library directory from a compiled project or assembled release.
The module reads application versions, BEAM files, .app inventories,
behaviours and exports for mix castle.appup and mix castle.appup.gen.
Invalid library paths, incomplete application directories and broken entries are errors. An application absent from one valid build remains a meaningful add or remove result.
Module fingerprints combine :beam_lib.md5/1 with persisted attributes. This
ignores changes caused only by BEAM stripping or documentation while retaining
explicit @vsn and other persisted-attribute changes.
Summary
Types
A module's BEAM md5 and persisted attributes, which the md5 does not cover.
One application in one build.
A build's library directory, read once.
Functions
Reads an application's version and module inventory from its .app file.
Returns OTP behaviours declared in a module's persisted attributes.
Reads a build library directory.
Compiles and reads the current project's library directory.
Returns an application's ebin directory, or nil when it is absent.
Returns whether a module exports a function.
Returns sorted lists of changed, added and removed modules.
Resolves a baseline and reads its library directory at the requested level.
Reads one application side of a comparison.
Types
A module's BEAM md5 and persisted attributes, which the md5 does not cover.
@type side() :: %{ vsn: binary(), inventory: MapSet.t(module()), listed?: boolean(), modules: %{required(module()) => fingerprint()}, exports: %{required(module()) => MapSet.t({atom(), arity()})}, ebin: binary(), resource: binary() }
One application in one build.
vsn and inventory come from the .app resource; modules comes from the
BEAM files in ebin. The BEAM files show what changed, and the inventory is
what :systools can resolve.
A build's library directory, read once.
describe names the build in diagnostics and entries lists lib_dir. See
build/2.
Functions
Reads an application's version and module inventory from its .app file.
The boolean result records whether the inventory is a valid list of atoms. A
missing or malformed inventory becomes empty so coverage checks fail safely;
relup generation remains responsible for full .app validation.
Returns OTP behaviours declared in a module's persisted attributes.
Both behaviour and behavior attribute spellings are recognised. Missing
modules or attributes return an empty list.
Reads a build library directory.
Raises unless the path contains at least one application directory with an
ebin subdirectory. describe is used in diagnostics.
@spec current!() :: t()
Compiles and reads the current project's library directory.
Returns an application's ebin directory, or nil when it is absent.
The function supports Mix and release layouts, verifies the .app resource,
and rejects ambiguous or incomplete application entries.
Returns whether a module exports a function.
This supports draft warnings about missing callbacks; behaviour attributes, not exports, determine the drafted instruction.
@spec moved(%{required(module()) => fingerprint()}, %{ required(module()) => fingerprint() }) :: {[module()], [module()], [module()]}
Returns sorted lists of changed, added and removed modules.
@spec resolve!(binary(), Forecastle.Baseline.level()) :: t()
Resolves a baseline and reads its library directory at the requested level.
Reads one application side of a comparison.
The result includes the application version, .app module inventory, BEAM
fingerprints, exports, and source paths.