# `EHLS.Build`
[🔗](https://github.com/elixir-hls/elixir-hls/blob/v0.1.0/lib/ehls/build.ex#L1)

A build that knows what changed: a target's steps (`c:EHLS.Target.steps/1`) run in order, each only when its inputs
changed since it last ran, or an output is missing.

A step's inputs are files (globs, relative to the application's directory or absolute) and values (options it is
built with); their hash is kept in `build/.ehls/<step>.sha256` once the step succeeds. A later step's inputs are
often an earlier one's outputs, so a change runs only what it reaches: a change of the CPU's code remakes the
circuits' files the same as before, and the SoC after them does not run again.

# `step`

```elixir
@type step() :: %{
  :name =&gt; atom(),
  :run =&gt; (-&gt; any()),
  optional(:doc) =&gt; String.t(),
  optional(:inputs) =&gt; [String.t()],
  optional(:exclude) =&gt; [Regex.t()],
  optional(:values) =&gt; term(),
  optional(:outputs) =&gt; [Path.t()],
  optional(:needs) =&gt; [atom()]
}
```

A step: its name, what it does (for the messages), its inputs (`inputs:` globs, `exclude:` regexes on their
paths, `values:` any term), the files it makes (`outputs:`), the machine's settings it needs (`needs:`, checked
before it runs) and the function that runs it.

# `cmd!`

Runs a command for a step, its output shown as it comes; raises when it fails. Options: `cd:`, `env:`
(a list of `{name, value}`).

# `hash`

The hash of a step's inputs (files and values).

# `reason`

Why a step has to run, or nil when it is up to date.

# `run`

Runs the steps that need it. Options: `only:` (step names: those alone), `force:` (run them whatever changed),
`dry_run:` (say what would run, run nothing). Returns the names of the steps run (or that would run).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
