View Source Harness.Pkg behaviour (Harness v0.8.3)

A behaviour for defining harness package modules.

Harness packages should add a pkg.exs to their root directory which describes a single module which implements this behaviour.

Summary

Types

t()

A package module's struct

Callbacks

A function to transform incoming opts (in keyword format) into a package's struct (t/0).

A list of links to create from the .harness directory to project root.

Types

@type t() :: struct()

A package module's struct

Callbacks

@callback cast(opts :: Keyword.t()) :: t()

A function to transform incoming opts (in keyword format) into a package's struct (t/0).

The simplest cast/1 is like so:

def cast(opts), do: struct(__MODULE__, opts)
@callback links(t()) :: [Path.t() | {Path.t(), :sym | :hard}]

A list of links to create from the .harness directory to project root.

The link can be a string path which will be created as a symlink or the link can be a tuple with the path and an atom declaring the type of link as :sym or :hard.

Functions