View Single Post
Old 04-08-2003, 09:46 AM
kinook kinook is online now
Join Date: 03-06-2001
Location: Colorado
Posts: 5,757
How can I conditionally build (or skip) project steps?

You can use conditional build rules to dynamically include or skip certain steps or blocks of steps in your project. You can use various criteria for the rule--prompting for a value from the user, checking for the existence or reading the contents of a file, reading a registry value (with the REG_READ macro), etc.

Create a step, and set its conditional build rule fields to match the criteria you need. For instance, to build a step only if the macro DEBUG has been defined, set to build if %DEBUG% is defined. To execute or skip multiple steps based on the condition, create one or more steps child to step containing the conditional rule.

To perform different steps in both cases ("if" and "else"), define two steps with opposite build rule conditions. You can use script expressions for more complex rule capabilities such as numeric comparisons, checking for the existence of a file, etc. (see the Advanced.bld sample for more details).
Reply With Quote