Project Dependencies
This scenario covers the situation where Project A is dependent on code from Project B.
Simple build dependency
You will need to add a buildstatus element to the modificationset element inside Project A referencing Project B's log directory.
<project name="Project A">
...
<modificationset>
...
<buildstatus logdir="logs/Project B" />
</modificationset>
...
</project>
This will only trigger a build on Project A if there has been a successful build of Project B.
Adding change dependency
In order to NOT build Project A if Project B has some modifications, you need to use the veto element.
<project name="Project A">
...
<modificationset>
...
<buildstatus logdir="logs/Project B" />
<veto>
<triggers>
<cvs module="Project_A" ... />
</triggers>
<buildstatus logdir="logs/Project B" />
</veto>
</modificationset>
...
</project>
<project name="Project B">
...
<modificationset>
<cvs module="Project_B" ... />
</modificationset>
...
</project>
Multi-threaded server additions
Finally, if you also are running multiple threads, you don't want to have both ProjectA and ProjectB running at the same time. Here you use the lockfilebootstrapper and lockfilelistener to complete the full configuration.
<project name="Project A">
...
<modificationset>
...
<buildstatus logdir="logs/Project B" />
<veto>
<triggers>
<cvs module="Project_B" ... />
</triggers>
<buildstatus logdir="logs/Project B" />
</veto>
</modificationset>
<listeners>
<lockfilelistener projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
</listeners>
<bootstrappers>
<lockfilebootstrapper projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
</bootstrappers>
...
</project>
<project name="Project B">
...
<modificationset>
<cvs module="Project_B" ... />
</modificationset>
<listeners>
<lockfilelistener projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
</listeners>
<bootstrappers>
<lockfilebootstrapper projectname="${project.name}" lockfile="${lockfile.dir}/ProjectA_ProjectB.lock" />
</bootstrappers>
...
...
</project>