Perforce Configuration Examples
Example using defaults:
<sourcecontrol type="p4">
<view>//projects/myproject/...</view>
</sourcecontrol>
Full example:
<sourcecontrol type="p4">
<view>//projects/ccnet/...,//tools/nant/...</view>
<executable>c:\perforce\p4.exe</executable>
<client>ccnet-buildhost</client>
<user>public</user>
<password>mypassword</password>
<port>perforce01.thoughtworks.net:1666</port>
<timeZoneOffset>-5</port>
<applyLabel>true</applyLabel>
<autoGetSource>true</autoGetSource>
<forceSync>true</forceSync>
<p4WebURLFormat>http://perforceWebServer:8080/@md=d&cd=//&c=3IB@/{0}?ac=10</p4WebURLFormat>
<timeout units="minutes">10</timeout>
</sourcecontrol>
Configuration Elements:
| Node |
Description |
Type |
Required |
Default |
| view |
The perforce 'view' to check for changes. For 'multi-line' views, use a comma-separated list. 'Exclusionary' view lines starting with - cannot be used. Use a Filtered Source Control Block to achieve this behaviour. Note that this view is not used for syncing (see below.) |
string |
true |
n.a. |
| executable |
The location of the Perforce command line client executable |
string |
false |
p4.exe in path |
| client |
The perforce 'client' to use |
string |
false |
Perforce environment setting |
| user |
The perforce user to use |
string |
false |
Perforce environment setting |
| password |
The perforce password to use |
string |
false |
Perforce environment setting |
| port |
The perforce hostname and port to use |
string |
false |
Perforce environment setting |
| timeZoneOffset |
How many hours ahead your Perforce Server is from your build server. E.g. if your build server is in London, and your Perforce server is in New York, this value would be '-5'. |
double |
false |
0 |
| applyLabel |
Whether to apply a label on a successful build, defaults to false |
bool |
false |
false |
| autoGetSource |
Whether to automatically 'sync' the latest changes from source control before performing the build. The sync target is the entire view exposed by the specified client - the view has no effect on sycning. |
bool |
false |
true |
| forceSync |
If autoGetSource is set to true, then whether to use the -f option to sync. See here for more details |
boolean |
no |
false |
| p4WebURLFormat |
Creates a link to the P4Web change list page for each detected modification. The specified value is transformed using String.Format where the first argument ({0}) will be the substituted change list number |
false |
n.a. |
| timeout |
Sets the timeout period for the source control operation. See Timeout Configuration for details. |
Timeout |
no |
10 minutes |
Client / User / Password / Port usage
You may specify any of the Perforce client, user, password and port (ie 'host:port' in Perforce standards) settings to use. If you don't specify them, then Cruise Control .NET will use the defaults in your registry (use 'p4 set' to view and edit these.)
Note that the client specification is only used for syncing and applying labels, it is not used when checking for changes. This is significant since it means that the view in the specified client does not effect the plugin's behaviour when checking for changes.
Perforce Issues
Perforce cannot apply purely numeric labels, which is what CCNet uses by default. Therefore, if you have 'applyLabel' set to true, you must also setup a custom Labeller in your project, e.g. by using the Default Labeller.