This page last changed on Mar 12, 2009 by csut017.

Steps:

  1. 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).
  2. Add your new custom builder class.
  3. The class must implement the ThoughtWorks.CruiseControl.Core.ITask interface (found in the ccnet.core assembly).
  4. 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.
  5. 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.
  6. Implement the Run method. The supplied IntegrationResult should provide you with everything that you need to know about the current build.
  7. Compile the assembly.
  8. Copy the assembly into the folder containing the CruiseControl.NET assemblies (or the current directory that you are running the ccnet server from).
  9. Modify your ccnet.config file in accordance with the sample config file below.

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>
Document generated by Confluence on Mar 14, 2009 02:55