|
This page last changed on Sep 25, 2006 by gfeldman.
Steps:
- Create a Class Library project to build the assembly that will contain your custom builder plug-in. The assembly that it produces should be named: 'ccnet.*.plugin.dll' (where the star represents the name you choose).
- Add your new custom builder class.
- The class must implement the ThoughtWorks.CruiseControl.Core.ITask interface (found in the ccnet.core assembly).
- Mark your class with the NetReflector ReflectorType attribute. The name argument supplied to the attribute is the name of the element/attribute that will appear in the configuration file.
- Add any configuration properties that you need, marking them with the NetReflector ReflectorProperty attributes accordingly. Note that the attribute names are case sensitive and must match exactly in the configuration.
- Implement the Run method. The supplied IntegrationResult should provide you with everything that you need to know about the current build.
- Compile the assembly.
- Copy the assembly into the folder containing the CruiseControl.NET assemblies (or the current directory that you are running the ccnet server from).
- Modify your ccnet.config file in accordance with the sample config file below.
For more information, please take a look at the sample code contained in the folder /docs/developer/samples.
Sample Builder Class
using System;
using Exortech.NetReflector;
using ThoughtWorks.CruiseControl.Core;
namespace ThoughtWorks.CruiseControl.Sample.Builder
{
[ReflectorType("mybuilder")]
public class NAntBuilder : ITask
{
public void Run(IntegrationResult result)
{
Console.WriteLine("Hello World!");
}
}
}
Sample Config File
<cruisecontrol>
<project name="myproject">
<tasks>
<mybuilder>
<!-- include custom builder properties here -->
</mybuilder>
</tasks>
</project>
</cruisecontrol>
|