Skip to content

Add Castle.customize/1 as the public release integration API #12

Description

@ausimian

Summary

Expose a single public API for making a normal Mix release Castle-capable, rather than requiring users to know about Forecastle release steps directly.

Motivation

Today Forecastle integration requires consumers to explicitly place Forecastle.pre_assemble/1 and Forecastle.post_assemble/1 around :assemble. That leaks the implementation package and makes future release integration changes part of the consumer API.

The desired user-facing shape is approximately:

defp releases do
  [
    my_app: fn ->
      [
        steps: [:assemble, :tar]
      ]
      |> Castle.customize()
    end
  ]
end

The lazy release function is useful because it ensures Castle/Forecastle dependencies have been compiled before the customization code is invoked.

Proposed behaviour

Castle.customize/1 should accept ordinary Mix release options and return ordinary Mix release options with Castle integration applied. Internally it may delegate to Forecastle.

At minimum it should:

  • install the Forecastle pre/post assembly steps around :assemble;
  • preserve any existing custom steps and their ordering;
  • remain the sole public integration point for consumers;
  • leave room for future Castle-specific release customization without changing user mix.exs files.

Forecastle should remain an implementation detail for most users.

Acceptance criteria

  • A consumer can opt into Castle release support with a single Castle.customize/1 call.
  • Existing custom release steps are preserved.
  • Forecastle-specific functions no longer need to appear in documented consumer release definitions.
  • Documentation shows the lazy release-definition form to avoid dependency-loading problems while evaluating mix.exs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions