BusyB: The Or Trigger


Main Page

News

Reference

Installation

Quick Start

Download

The <or> trigger does about what you would expect: it triggers a build if any of its sub triggers want to fire. This is probably easier to illustrate than explain, so here's an example:

<project>

    <or>
        <interval>1 hour</interval>
        <whenFilesChange>
            <dir>/usr/home/program1/src</dir>
        </whenFilesChange>

        <whenCmdOK>
            <cmd>test -f /tmp/foo</cmd>
         </whenCmdOK>
    </or>

    <build>
      ... build sub elements...
    </build>

</project>

The example above tells BusyB to check once per hour t hat /tmp/foo exists and for changes to /usr/home/program1/src. If either condition is true, a build gets fired. In other words the build will be triggered if any of the sub-triggers are “fireable”.

Note that the <or> trigger does a “short circuit” type of evaluation. The minute one of the sub triggers evaluates to true, the or trigger will quit checking and fire a build.