Target

The target block describes requirements for running a target. A target has a unique name in the scope of this file (see identifier).

The special syntax ^<target> denotes targets for all dependencies whereas <target> denotes a target for current project only.

Example below for project A with dependencies on projects B and C.

flowchart LR
  classDef default fill:moccasin,stroke:black
  classDef project fill:gainsboro,stroke:black,rx:10,ry:10
  classDef build fill:palegreen,stroke:black,rx:20,ry:20
  classDef publish fill:skyblue,stroke:black,rx:20,ry:20
  classDef target fill:white,stroke-width:2px,stroke-dasharray: 5 2

  subgraph A["Project A"]
    subgraph targetBuildA["target build"]
      direction LR
    end

    subgraph targetPublishA["target publish"]
      direction LR
    end

    class targetBuildA build
    class targetPublishA build
  end

  subgraph B["Project B"]
    subgraph targetBuildB["target build"]
      direction LR
    end

    class targetBuildB build
  end

  subgraph C["Project C"]
    subgraph targetBuildC["target build"]
      direction LR
    end

    class targetBuildC build
  end

  targetBuildA -- ^build --> targetBuildB
  targetBuildA -- ^build --> targetBuildC
  targetPublishA -- build --> targetBuildA
  
  class A,B,C project

Example Usage

target build {
    depends_on = [ ^build init ]
    rebuild = false
}

Argument Reference

The following arguments are supported:

  • identifier - (Mandatory) Identifier of the target.
  • depends_on - (Optional) List of required targets this target depends on. Note the special syntax for ancestor: ^build force completion of build target for all dependencies before proceeding. Default is no dependencies.
  • rebuild - (Optional) Force rebuild if true. Default is false.
graph BT
start -- build --> A["Project A"] -- build --> B["Project B"]
                   A["Project A"] -- build --> C["Project C"]
Last updated on