PDA

View Full Version : How can I conditionally build (or skip) project steps?


kinook
04-08-2003, 08:46 AM
You can use conditional build rules (http://www.kinook.com/VisBuildPro/Manual/buildrules.htm) 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 <font face="Courier">%DEBUG%</font> 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 (http://www.kinook.com/VisBuildPro/Manual/scriptexpressions.htm) for more complex rule capabilities such as numeric comparisons, checking for the existence of a file, etc. (see the Advanced.bld (http://www.kinook.com/VisBuildPro/Manual/advancedsample.htm) sample for more details).