Nerves (nerves v2.0.0-pre.2)

Copy Markdown View Source

Nerves tooling for building embedded Elixir

Please see the getting started guides for using Nerves.

Summary

Functions

Get the current Nerves build plan

Return the ERTS path for the release

Inject Nerves release steps

Returns the Nerves version as a binary

Functions

build_plan()

@spec build_plan() :: Nerves.BuildPlan.t()

Get the current Nerves build plan

If you're writing a custom Nerves.BuildAction, use the build_plan that's passed to the callbacks. This is handy for situations where the plan isn't easily accessible and for debug.

erts()

@spec erts() :: Path.t() | true

Return the ERTS path for the release

On target builds, returns the path to the cross-compiled ERTS from the Nerves system artifact. On host, returns true to use the host ERTS.

This call belongs in your project's mix.exs's release/0 function:

def release do
  [
    ...
    include_erts: &Nerves.erts/0,
    ...
  ]
end

init_release(release)

@spec init_release(Mix.Release.t()) :: Mix.Release.t()

Inject Nerves release steps

This makes sure that the Nerves tooling is available to affect the Mix release process.

This call belongs in your project's mix.exs's release/0 function:

def release do
  [
    ...
    steps: [&Nerves.init_release/1, :assemble],
    ...
  ]
end

version()

@spec version() :: String.t()

Returns the Nerves version as a binary