Forecastle.Appup.Dep (forecastle v1.0.0)

Copy Markdown View Source

Manages appup sources supplied for dependencies.

Sources live at rel/appups/<app>-<from>-<to>.exs, relative to the project file. Forecastle validates them before assembly and writes the merged appup to lib/<app>-<vsn>/ebin/<app>.appup. It never modifies deps/.

Filenames are matched against the applications and target versions in the release, so versions may contain dashes. The build rejects stale or ambiguous names, owned applications, malformed appups, missing entries, invalid regex keys, and competing project entries for the same version. Dotfiles are ignored; other non-.exs files are errors.

After assembly, Forecastle verifies that the target ebin directory exists and that no overlay replaced the appup destination. Retry these late failures with mix release --overwrite.

Sources for one application are merged in filename order. Project entries precede entries shipped by the dependency, allowing a project to replace a matching transition while preserving the dependency's other entries.

Summary

Types

An application's merged appup, encoded and ready to write into the release.

Functions

Returns the project's rel/appups directory.

Extracts the from-version from a dependency appup filename.

Writes staged dependency appups into an assembled release.

Reads and validates dependency appup sources before release assembly.

Types

placement()

@type placement() :: %{
  app: atom(),
  vsn: binary(),
  bytes: binary(),
  sources: [binary()],
  staged: binary() | nil,
  notes: [binary()]
}

An application's merged appup, encoded and ready to write into the release.

Functions

dir()

@spec dir() :: binary()

Returns the project's rel/appups directory.

from_version(path, app, vsn)

@spec from_version(Path.t(), atom(), binary()) :: binary() | nil

Extracts the from-version from a dependency appup filename.

The application and target version are anchored at each end, allowing dashes inside version strings.

place!(release, placements)

@spec place!(Mix.Release.t(), [placement()]) :: :ok

Writes staged dependency appups into an assembled release.

Refuses missing ebin directories and destinations changed by overlays.

stage!(release)

@spec stage!(Mix.Release.t()) :: [placement()]

Reads and validates dependency appup sources before release assembly.

Returns placements grouped by application, including entries shipped by the dependency.