View Source FennecPrecompile.Precompiler behaviour (fennec_precompile v0.2.0)

Link to this section Summary

Types

Command line arguments.

A tuple that indicates the target and the corresponding precompiled artefact detail info.

A map that contains detailed info of a precompiled artefact.

Target triplets

Callbacks

This callback should return a list of triplets for all supported targets.

This callback should return the target triplet for current node.

This callback should precompile the library to the given target(s).

Link to this section Types

@type cmd_args() :: [String.t()]

Command line arguments.

Link to this type

precompiled_artefact()

View Source
@type precompiled_artefact() :: {target(), precompiled_artefact_detail()}

A tuple that indicates the target and the corresponding precompiled artefact detail info.

{target, precompiled_artefact_detail}.

Link to this type

precompiled_artefact_detail()

View Source
@type precompiled_artefact_detail() :: %{
  path: String.t(),
  checksum: String.t(),
  checksum_algo: atom()
}

A map that contains detailed info of a precompiled artefact.

  • :path, path to the archived build artefact.
  • :checksum_algo, name of the checksum algorithm.
  • :checksum, the checksum of the archived build artefact using :checksum_algo.
@type target() :: String.t()

Target triplets

Link to this section Callbacks

@callback all_supported_targets() :: [target()]

This callback should return a list of triplets for all supported targets.

@callback current_target() :: {:ok, target()} | {:error, String.t()}

This callback should return the target triplet for current node.

Link to this callback

precompile(cmd_args, list)

View Source
@callback precompile(cmd_args(), [target()]) ::
  {:ok, [precompiled_artefact()]} | no_return()

This callback should precompile the library to the given target(s).

Returns a list of {target, acrhived_artefacts} if successfully compiled.