84 lines
4.0 KiB
HTML
Executable File
84 lines
4.0 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<title>CruiseControl.NET : Custom Builder Plug-in</title>
|
|
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
|
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
</head>
|
|
|
|
<body>
|
|
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
|
<tr>
|
|
<td valign="top" class="pagebody">
|
|
<div class="pageheader">
|
|
<span class="pagetitle">
|
|
CruiseControl.NET : Custom Builder Plug-in
|
|
</span>
|
|
</div>
|
|
<div class="pagesubheading">
|
|
This page last changed on Mar 12, 2009 by <font color="#0050B2">csut017</font>.
|
|
</div>
|
|
|
|
<h3><a name="CustomBuilderPlug-in-Steps%3A"></a>Steps:</h3>
|
|
|
|
<ol>
|
|
<li>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: '<em>ccnet.*.plugin.dll</em>' (where the star represents the name you choose).</li>
|
|
<li>Add your new custom builder class.</li>
|
|
<li>The class must implement the <em>ThoughtWorks.CruiseControl.Core.ITask</em> interface (found in the ccnet.core assembly).</li>
|
|
<li>Mark your class with the <a href="NetReflector.html" title="NetReflector">NetReflector</a> <em>ReflectorType</em> attribute. The <em>name</em> argument supplied to the attribute is the name of the element/attribute that will appear in the configuration file.</li>
|
|
<li>Add any configuration properties that you need, marking them with the <a href="NetReflector.html" title="NetReflector">NetReflector</a> <em>ReflectorProperty</em> attributes accordingly. Note that the attribute names are case sensitive and must match exactly in the configuration.</li>
|
|
<li>Implement the <em>Run</em> method. The supplied <em>IntegrationResult</em> should provide you with everything that you need to know about the current build.</li>
|
|
<li>Compile the assembly.</li>
|
|
<li>Copy the assembly into the folder containing the CruiseControl.NET assemblies (or the current directory that you are running the ccnet server from).</li>
|
|
<li>Modify your <em>ccnet.config</em> file in accordance with the sample config file below.</li>
|
|
</ol>
|
|
|
|
|
|
<h3><a name="CustomBuilderPlug-in-SampleBuilderClass"></a>Sample Builder Class</h3>
|
|
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
<pre class="code-java">using <span class="code-object">System</span>;
|
|
using Exortech.NetReflector;
|
|
using ThoughtWorks.CruiseControl.Core;
|
|
|
|
namespace ThoughtWorks.CruiseControl.Sample.Builder
|
|
{
|
|
[ReflectorType(<span class="code-quote">"mybuilder"</span>)]
|
|
<span class="code-keyword">public</span> class NAntBuilder : ITask
|
|
{
|
|
<span class="code-keyword">public</span> void Run(IntegrationResult result)
|
|
{
|
|
Console.WriteLine(<span class="code-quote">"Hello World!"</span>);
|
|
}
|
|
}
|
|
}</pre>
|
|
</div></div>
|
|
|
|
<h3><a name="CustomBuilderPlug-in-SampleConfigFile"></a>Sample Config File</h3>
|
|
|
|
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
|
|
<pre class="code-java"><cruisecontrol>
|
|
<project name=<span class="code-quote">"myproject"</span>>
|
|
<tasks>
|
|
<mybuilder>
|
|
<!-- include custom builder properties here -->
|
|
</mybuilder>
|
|
</tasks>
|
|
</project>
|
|
</cruisecontrol></pre>
|
|
</div></div>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr>
|
|
<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center"><font color="grey">Document generated by Confluence on Mar 14, 2009 02:55</font></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html> |