User Documentation¶
A task that is often considered as a necessary evil, but it's really needed to document how stuff works :-)
Creating the documentation for the wiki is in fact easier as it may seem, we extract it from the source!
This means that you just create the documentation in the same editor where you the write code, using the same comment tags as in C# (or mostly the same comment tags). All elements with a Reflector attribute will be extracted, and used for the documentation. The docGenerator program in the Tools folder takes care of this.
The following elements are used :
summary | This is the main explanation of the element, when on a class it will be displayed at the top of the page. This is the main explanation of the element. On a property it will be shown in the Configuration Elements table. |
title | Used inside the summary element of the class, if not specified the class name will be used. This gives a more friendly name for the page. |
version | Used to make clear from what version of CCNet the functionality is available. Can be used at class or property level. |
code | To provide a code or config example of how things must be used, this must be escaped XML. Meaning do not type 1<exec command="abc" /> but type it like so : inside the code element. Indention is not needed, this is automatically done through the wiki. If there are multiple configs, you can give each of them a separate title via the title attribute. |
para | Used to create paragraphs into the documentation. So use it as a child element of summary or remarks |
heading | creates a sub heading in section, like para or summary |
b | outputs the enclosed text as bold |
link | provides a link to another wiki page. For example you could provide links to similare topics like modification reader and modification writer |
showChildren | shows any childpages of the current page. This means that the class knows the wiki-layout, so use with caution. |
includePage | includes the contents of the involved page into this page/ Most used example are the integration properties on each task or publisher. |
Example
Below is the comment of the Executable Task
1 /// <summary>
2 /// <para>
3 /// The Executable Task lets you invoke any command line executable. It doesn't offer as much specific
4 /// integration as (for example) the <link>NAnt Task</link>, but does allow you to hook almost anything
5 /// up as a build process to CCNet. CCNet will examine the exit code when the executable ends and act
6 /// accordingly.
7 /// </para>
8 /// </summary>
9 /// <title>Executable Task</title>
10 /// <version>1.0</version>
11 /// <example>
12 /// <code title="Minimalist example">
13 /// &lt;exec executable="c:\projects\myproject\build.bat" /&gt;
14 /// </code>
15 /// <code title="Full example">
16 /// &lt;exec&gt;
17 /// &lt;executable&gt;make&lt;/executable&gt;
18 /// &lt;baseDirectory&gt;D:\dev\MyProject&lt;/baseDirectory&gt;
19 /// &lt;buildArgs&gt;all&lt;/buildArgs&gt;
20 /// &lt;buildTimeoutSeconds&gt;10&lt;/buildTimeoutSeconds&gt;
21 /// &lt;successExitCodes&gt;0,1,3,5&lt;/successExitCodes&gt;
22 /// &lt;environment&gt;
23 /// &lt;variable&gt;
24 /// &lt;name&gt;MyVar1&lt;/name&gt;
25 /// &lt;value&gt;Var1Value&lt;/value&gt;
26 /// &lt;/variable&gt;
27 /// &lt;variable name="MyVar2" value="Var2Value"/&gt;
28 /// &lt;/environment&gt;
29 /// &lt;/exec&gt;
30 /// </code>
31 /// </example>
32 /// <remarks>
33 /// <para type="note">
34 /// An exit code of -1 is always treated as the operation has timed out. This will fail the build.
35 /// </para>
36 /// <para type="warning">
37 /// Windows seems to change the case of environment variables occasionally. If your task target doesn't
38 /// find one of these properties, try using all upper case or all lower case versions of these properties.
39 /// </para>
40 /// <heading>Frequently Asked Questions</heading>
41 /// <para>
42 /// <b>Does the exec task pass the integration properties via the command line?</b>
43 /// </para>
44 /// <para>
45 /// No. The integration properties are only available as environment variables. As there is no way of
46 /// knowing the way in which the external program expects these properties to be formatted as command line
47 /// arguments, environment variables are a simple, common medium for making these values accessible. To
48 /// pass these environment variables into an external program, have the exec task call a batch file instead
49 /// that will pick up the environment variables, format them and pass them as command line arguments to the
50 /// external program.
51 /// </para>
52 /// <para>
53 /// <b>Using built in shell commands</b>
54 /// </para>
55 /// <para>
56 /// In Windows use cmd.exe as the executable, and pass the wanted command as an argument, preceded with /c.
57 /// This allows to execute del *.* and the like. For example :
58 /// </para>
59 /// <code>
60 /// &lt;exec&gt;
61 /// &lt;executable&gt;c:\Windows\System32\cmd.exe&lt;/executable&gt;
62 /// &lt;buildArgs&gt;/C NET STOP "Service name"&lt;/buildArgs&gt;
63 /// &lt;/exec&gt;
64 /// </code>
65 /// <para>
66 /// The following parameters are passed to the external program using environment variables, in addition to those you specify in
67 /// the &lt;environment&gt; element.:
68 /// </para>
69 /// <includePage>Integration_Properties</includePage>
70 /// </remarks>
71 [ReflectorType("exec")]
72 public class ExecutableTask
73