Availability: Docs Title: BuildGraph Script Elements Crumbs: %ROOT%, Programming, Programming/Development, Programming/Development/BuildGraph, Programming/Development/BuildGraph/ScriptAnatomy Description:Learn about the elements of a BuildGraph. version: 4.13 parent:Programming/Development/BuildGraph type:Reference related: Programming/Development/BuildGraph/ScriptAnatomy tags:BuildGraph [VAR:TopicCompact] [OBJECT:TopicCompact] [PARAM:image] ![%Programming/Development/BuildGraph/ScriptAnatomy/Elements%](elements_topic.png) [/PARAM] [PARAM:icon] ![](%ROOT%/reference_icon.png)(convert:false) [/PARAM] [PARAM:title] %Programming/Development/BuildGraph/ScriptAnatomy/Elements:title% [/PARAM] [PARAM:description] %Programming/Development/BuildGraph/ScriptAnatomy/Elements:description% [/PARAM] [PARAM:path] [RELATIVE:Programming/Development/BuildGraph/ScriptAnatomy/Elements] [/PARAM] [/OBJECT] [/VAR] [TOC(start:1 end:3)] [EXCERPT:BuildGraphScriptElements] BuildGraph scripts have elements that are similar to the sort of elements that you'd expect to find in an XML document. As you read through this section, you'll learn how to define a graph along with the syntax that goes into manipulating properties. You'll also learn the syntax needed to control the flow of your logic and finally, we'll show you elements designed to help you with script diagnostics. ## Elements Elements describe the data that they contain, making them one of the basic building blocks of BuildGraph scripts. The following tables contain items that are provided as metadata, which are exported when running on the build system. Although they're not used directly by BuildGraph when executing tasks locally, they're tagged with `[META]`. ## Defining a Graph A BuildGraph script is typically defined with the following elements: * `` * `` * `` * `` ### Node `` is the smallest unit of execution in BuildGraph, having a set of inputs and outputs. Each `` consists of a sequence of tasks that are executed in order. | | | | | | ---------------- | ------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- | | Name | Name | Required | Name of the node. | | Requires | Target List | Optional | List of nodes, aggregates, or tagged file sets produced by other nodes that this node requires to execute, separated by semicolons. | | Produces | Tag List | Optional | Tagged file sets that this node makes available to other nodes, separated by semicolons. | | After | Target List | Optional | List of nodes that this node should run after, if they are part of the current target (ignored if they are not). Separated by semicolons. | | NotifyOnWarnings | Boolean | Optional | If false, this node will not produce notifications on warnings. Only used by build systems. Defaults to `true`. `[META]` | | If | Condition | Optional | Condition to be evaluated. The element is ignored unless the condition evaluates to `true`. | ### Aggregate `` declares a named aggregate that can be used as a synonym for a set of other nodes (or produced tag sets). | | | | | | ---------------- | ------------ | ------------ | -------------------------------------------------------------------------------------------- | | Name | Name | Required | Name of the aggregate. | | Requires | Target List | Required | List of dependencies for this aggregate. May be nodes, tagged file sets, or agent groups. | | If | Condition | Optional | Condition to be evaluated. The element is ignored unless the condition evaluates to `true`. | ### Agent `` defines requirements for an agent on nodes that will be executed in sequence (without cleaning intermediate directories). `` requirements are ignored when building locally, but must be specified. | | | | | | ---------------- | --------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | Name | Name | Required | Name of the group. | | Type | Identifier List | Optional | Type of agent to run on. The meaning of this string is inferred by the host build system; it does not have any intrinsic meaning. `[META]` | | If | Condition | Optional | Condition to be evaluated. The element is ignored unless the condition evaluates to `true`. | ### Trigger `` serves as a container for portions of the graph that should only be executed with explicit user intervention. To execute nodes behind a trigger, pass `-Trigger=` to the command line. | | | | | | ---------------- | --------------- | ------------ | ------------------------------------------------------------------------------------------- | | Name | Name | Required | Name of the trigger. | | If | Condition | Optional | Condition to be evaluated. The element is ignored unless the condition evaluates to `true`. | ## Property Manipulation BuildGraph properties can be modified with the following elements: * `` * `