<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adventures in Development &#187; nant</title>
	<atom:link href="http://bitsoftconsulting.com/wordpress/tag/nant/feed/" rel="self" type="application/rss+xml" />
	<link>http://bitsoftconsulting.com/wordpress</link>
	<description>Babak&#039;s experiences in software development</description>
	<lastBuildDate>Tue, 31 Aug 2010 23:00:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Continuous Integration with Cruise Control .NET + NAnt</title>
		<link>http://bitsoftconsulting.com/wordpress/2009/12/continuous-integration-with-cruise-control-net-nant/</link>
		<comments>http://bitsoftconsulting.com/wordpress/2009/12/continuous-integration-with-cruise-control-net-nant/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 18:35:21 +0000</pubDate>
		<dc:creator>Babak Naffas</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[continuous integration]]></category>
		<category><![CDATA[ccnet]]></category>
		<category><![CDATA[cruise control]]></category>
		<category><![CDATA[nant]]></category>

		<guid isPermaLink="false">http://bitsoftconsulting.com/wordpress/?p=36</guid>
		<description><![CDATA[UPDATE CruiseControl.NET 1.5 RC1 has been release and is available here. My Cruise Control .NET implementation consists of numerous development projects each with multiple different CCNET projects associated with it (one per environment per branch). In order to make the projects more maintainable, I have created a separate configuration file for each development project. Defining [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE </strong>CruiseControl.NET 1.5 RC1 has been release and is available <a title="CruiseControl.NET on SourceForge" href="http://sourceforge.net/projects/ccnet/files/CruiseControl.NET%20Releases/" target="_blank">here</a>.</p>
<p>My Cruise Control .NET implementation consists of numerous development projects each with multiple different CCNET projects associated with it (one per environment per branch). In order to make the projects more maintainable, I have created a separate configuration file for each development project.</p>
<p>Defining variables and separating ccnet.config configuration file into smaller files allows for easier maintenance as the number of projects as time went on.</p>
<h2>Defining and using variables</h2>
<p>Variables can be defined using the following format</p>
<p><strong>&lt;cb:define KEY="VALUE" /&gt;</strong></p>
<p>To reference that variable later in the configuration file, simply use <strong>$(KEY)</strong></p>
<p>Check out the <a title="CC.NET Preprocessor" href="http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/Configuration%20Preprocessor.html" target="_blank">Cruise Control .NET website </a>for complete explanation of variables using the pre-processor.</p>
<h2>Separating the configuration files</h2>
<p class="code">&lt;!DOCTYPE cruisecontrol [<br />
&lt;!ENTITY <strong>PROJECT_NAME</strong> SYSTEM "file:<strong>project.xml</strong>"&gt;<br />
]&gt;<br />
&lt;cruisecontrol xmlns:cb="urn:ccnet.config.builder"&gt;<br />
<strong>&amp;PROJECT_NAME;</strong><br />
&lt;/cruisecontrol&gt;</p>
<p>project.xml would, then, contain the regular xml configuration for a Cruise Control .NET project:</p>
<p class="code">
 &lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
 &lt;project name="My Project" category="A Category"&gt;<br />
  &lt;workingDirectory&gt;MyProject&lt;/workingDirectory&gt;<br />
  &lt;artifactDirectory&gt;MyProject&lt;/artifactDirectory&gt;<br />
  &lt;webURL&gt;&lt;/webURL&gt;<br />
  &lt;triggers&gt;<br />
   &lt;intervalTrigger seconds="900" buildCondition="IfModificationExists" /&gt;<br />
   &lt;scheduleTrigger time="04:00" buildCondition="ForceBuild" /&gt;<br />
  &lt;/triggers&gt;<br />
  &lt;labeller type="svnRevisionLabeller"&gt;<br />
   &lt;pattern&gt;Version {major}.{minor}.{build}.{revision}&lt;/pattern&gt;<br />
   &lt;major&gt;1&lt;/major&gt;<br />
   &lt;minor&gt;0&lt;/minor&gt;<br />
   &lt;url&gt;$(SvnBaseUrl)&lt;/url&gt;<br />
  &lt;/labeller&gt;<br />
&lt;sourcecontrol type="svn"&gt;<br />
   &lt;trunkUrl&gt;$(SvnBaseUrl)&lt;/trunkUrl&gt;<br />
   &lt;workingDirectory&gt;$(BaseDirectory)&lt;/workingDirectory&gt;<br />
   &lt;cb:SvnOptions /&gt;<br />
  &lt;/sourcecontrol&gt;<br />
&lt;tasks&gt;<br />
   &lt;nant&gt;<br />
    &lt;executable&gt;$(NAntExecutablePath)&lt;/executable&gt;<br />
    &lt;baseDirectory&gt;$(BaseDirectory)&lt;/baseDirectory&gt;<br />
    &lt;targetList&gt;<br />
     &lt;target&gt;dist.deploy&lt;/target&gt;<br />
    &lt;/targetList&gt;<br />
   &lt;/nant&gt;<br />
  &lt;/tasks&gt;<br />
 &lt;publishers&gt;<br />
   &lt;xmllogger /&gt;<br />
   &lt;cb:include href="EmailConfig.xml"/&gt;<br />
  &lt;/publishers&gt;<br />
&lt;/project&gt;</p>
<p>On caveat with this idea is that changes to the separate configuration files are not recognized until the cruise control is restarted by either restarting the service or modifying the ccnet.config file.</p>
<h2>Building and Deploying ASP.NET Web Applications</h2>
<p>The NAnt target below is a full parameterized call to MsBuild.exe to compile any solution. ThoughtWorks.CruiseControl.MsBuild.dll provides an MSBuild logger that allows Cruise Control .NET to report the bulid output.</p>
<div class="code">
<div>&lt;<span style="color: #0000ff;">target </span>name="build"&gt;</div>
<div id="_mcePaste" style="padding-left: 30px;">&lt;exec program="${MSBuildPath}"&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;arg line='"${SolutionFile}"' /&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;arg line="/property:Configuration=${SolutionConfiguration}" /&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;arg value="/target:Rebuild" /&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;arg value="/verbosity:normal" /&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;arg value="/nologo" /&gt;</div>
<div id="_mcePaste" style="padding-left: 60px;">&lt;arg line='/logger:"C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"'/&gt;</div>
<div id="_mcePaste" style="padding-left: 30px;">&lt;/exec&gt;</div>
<div id="_mcePaste">&lt;/<span style="color: #0000ff;">target</span>&gt;</div>
</div>
<p><strong>Parameters</strong></p>
<p><span style="font-size: small;"><strong>MSBuildPath </strong>- The path to the MsBuild executable. </span></p>
<p><span style="font-size: small;">For .NET Framework versions 2.0 and 3.5  on a 32-bit Windows OS, use C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MsBuild.exe<br />
For .NET Framework version 4.0, use C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe</span></p>
<p><span style="font-size: small;"><strong>SolutionFile </strong>- The relative path from the build file to the solution file. Fully qualified paths are also allowed.</span></p>
<p><span style="font-size: small;"><strong>SolutionConfiguration</strong> - "Release" or "Debug".</span></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fbitsoftconsulting.com%2Fwordpress%2F2009%2F12%2Fcontinuous-integration-with-cruise-control-net-nant%2F&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:80px"></iframe>]]></content:encoded>
			<wfw:commentRss>http://bitsoftconsulting.com/wordpress/2009/12/continuous-integration-with-cruise-control-net-nant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
