This page last changed on Mar 14, 2009 by dcameron.

Task Blocks are the action elements of CruiseControl.Net. They're the elements that do things, like executing a program, running tests, or send email results.

Task blocks must appear in the <prebuild> section, the <tasks> section or the <publishers> section. The <tasks> section is always run before the <publishers> section, regardless of the order in which they appear. However, within each of these sections, the tasks are run in the order they appear.

The types of Task Block are:

The <prebuild> section is intended for tasks which need to be run before the build starts, including the sourcecontrol operation.

The <tasks> section is intended for build tasks, such as a NAnt Task or MsBuild Task. If any of these build tasks fail, no further tasks in this section will be executed. Instead, CruiseControl.Net will skip to the <publishers> section. Thus the task that publish the results of the build should usually be placed in the <publishers> section.

The <publishers> section is run after the build completes (whether it passes or fails). This is where you aggregate and publish the build results. The <publishers> section typically starts with a <merge> task to collect any output from other tools, so that the results can be shown on the dashboard. Next, the Xml Log Publisher task is required to include the CruiseControl.Net XML output. Finally you might have one or more Email Publisher tasks. Note that you can still use any of the other tasks here. For example, you might run a NAnt Task that preprocesses the output files before merging them into CruiseControl's output stream.

Historical Note
Publishers and Tasks were different objects in earlier version of ccnet. Now they are interchangeable, and can appear either in the <prebuild> section, the <tasks> section, or the <publishers> section of the ccnet.config file depending on whether they should be run before, during or after the build.
Document generated by Confluence on Mar 14, 2009 02:55