If you want to build logical complexity into your BuildGraph scripts, you need to work with conditionals. The following section introduces you to how BuildGraph conditions are written, including a list of conditional operators.
Conditions
BuildGraph script conditions consist of atoms and operators that evaluate to true
or false
.
Atoms
Atoms can be numbers, strings, or identifiers that are coerced to their appropriate type for the operator using them. Atoms may be quoted with single (') or double (") quotes. They can also be an unquoted sequence of letters, digits, and underscore characters. All atoms are considered the same type, regardless of how they are declared. Additionally, atoms are considered case-insensitive for comparisons. This means that the strings "True" and 'true' are identical to the identifier true
(despite the presence of quotes and differences in case).
Operators
A list of operators is specified below:
Operator |
Description |
Precedence |
---|---|---|
|
Subexpression used for grouping. |
1 |
|
Evaluates to |
1 |
|
Evaluates to |
1 |
|
Evaluates to |
1 |
|
Evaluates to |
2 |
|
Evaluates to |
2 |
|
Evaluates to |
2 |
|
Evaluates to |
2 |
|
Evaluates to |
2 |
|
Evaluates to |
2 |
|
Evaluates to |
3 |
|
Evaluates to |
4 |
The '<'
and '>'
characters must be escaped as "<"
and ">"
in XML.