On NAnt Really Being a Neat Tool
I realize it’s not popular to champion anything XML these days, but I have to admit I’ve recently become a fan of NAnt. I understand the criticisms. I won’t argue that
<fileset id="assemblies"> <include name="**/*.dll" /> </fileset>
is better than
assemblies = FileList['*.dll']
I freely acknowledge that a DSL-based build system like Rake is far more expressive and extensible than an angle-bracket system like NAnt.
Writing blocks of C# in XML is strange.
<script language="C#" prefix="util" >
<code>
<![CDATA[
[Function("concat")]
public static string Concat(params object[] args) {
return String.Concat(args);
}
]]>
</code>
</script>
Calling these C# blocks in XML is even stranger.
<echo message="${util::concat('foo', 'bar')}" />
Over the past couple of weeks, I’ve started replacing a CruiseControl.rb/Rake continuous integration solution with one that uses CruiseControl.NET and NAnt. The reason for the switch is a combination of scalability (20+ ruby.exe instances really have a negative impact on a box) and adoption (try to get a team of MS types to learn Ruby in their free time).
CC.NET makes it really easy to checkout a project from Subversion and to run MSBuild against a solution. So there’s really no reason for using NAnt for project compilation, but rather packaging and deployment. NAnt has tasks (just XML blocks) for all sorts of file operations ranging from copying to zipping. NAnt will read and write XML. NAnt can run executables or be extended with custom tasks. NAnt supports includes for reuse and targets for modular task execution. Simply put, NAnt does good things with those less-thans and greater thans. While you may have heard that MSBuild has made NAnt unnecessary, I have to disagree. Your builds don’t have to stop at compilation.
Being a fan of Boo, I’m eventually going to have to see how far along the Boo Build System is. But those build file extensions would not be easy to introduce into a corporate environment…
Here’s a great post that served as a starting point for my CC.NET/MSBuild/NUnit/NAnt solution.
RSS feed for comments on this post. | TrackBack URI