BUCKYVERSE

Status

Accepted

Context

The Codexis build system currently passes build/session configuration as loose maps, with OutputPaths and other settings scattered across the build context. This leads to inconsistencies, path confusion, and bugs, especially as the system grows and more formats and features are added.

Problem

Decision

Consequences

Migration Strategy

BuildConfig Struct Documentation

Overview

The Codexis.BuildConfig struct is the central configuration object for all Codexis build sessions. It encapsulates all necessary context and settings for a build, ensuring consistency and type safety across pipelines, builders, and stages.

Fields

Example Usage

alias Codexis.Core.OutputPaths
alias Codexis.BuildManager.BuildOrchestrator
alias Codexis.BuildConfig

# Assume orchestrator is already created
output_paths = OutputPaths.new(orchestrator, "my_book", ".", output_root: "test_output")
build_config = BuildConfig.new(
  output_paths,
  orchestrator,
  "my_book",
  options: [use_mathjax: true],
  environment: %{env: "test"}
)

Access Patterns

Validation

Use BuildConfig.validate/1 to check for required fields and types:

case BuildConfig.validate(build_config) do
  {:ok, config} -> ...
  {:error, reason} -> ...
end

Migration Notes

See Also