<?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>Nick Carroll &#187; gant</title>
	<atom:link href="http://ca.rroll.net/tag/gant/feed/" rel="self" type="application/rss+xml" />
	<link>http://ca.rroll.net</link>
	<description>Metabolising caffeine into code</description>
	<lastBuildDate>Thu, 01 Sep 2011 04:18:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>You are a tool if you aren&#8217;t using Gant</title>
		<link>http://ca.rroll.net/2008/12/09/you-are-a-tool-if-you-arent-using-gant/</link>
		<comments>http://ca.rroll.net/2008/12/09/you-are-a-tool-if-you-arent-using-gant/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 02:23:28 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gant]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[ThoughtWorks]]></category>

		<guid isPermaLink="false">http://ca.rroll.net/?p=154</guid>
		<description><![CDATA[If you are still writing your build scripts in XML then you my friend are a tool (the slang associated with the word &#8220;tool&#8221; is also implied :p). You are doing far too much heavy lifting and wasting everybody&#8217;s time and money by maintaining your build scripts in XML. My recommendation is to use a [...]]]></description>
			<content:encoded><![CDATA[<p>If you are still writing your build scripts in XML then you my friend are a tool (the slang associated with the word &#8220;tool&#8221; is also implied :p).  You are doing far too much heavy lifting and wasting everybody&#8217;s time and money by maintaining your build scripts in XML.</p>
<p>My recommendation is to use a build tool like <a href="http://gant.codehaus.org">Gant</a>, which is a groovy based build tool that wraps Ant tasks and more.  All you need is the standalone version of Gant, which includes all dependencies (eg groovy, ivy, maven, etc).  You&#8217;ll need to use at least version 1.4, as there is a bug with 1.3 that prevents you from using the Ivy tool set.</p>
<p>The following is a simple Gant script that shows you how to manage your project&#8217;s dependencies using Gant&#8217;s Ivy integration.  The script creates a lib directory and two sub-directories.  The sub-directories will contain Jars for the application and for testing respectively.  The script depends on having internet access, as the Jars will be downloaded from a public repositiory (<a href="http://www.ibiblio.org">ibiblio</a>) and stored in your local repository.  Your local repository acts as a cache, so you don&#8217;t have to keep downloading the dependencies every time you run your build script in a continuous integration system like Cruise.</p>
<pre name="code" class="java">
libDirectory = 'lib'

includeTargets << gant.targets.Clean
cleanDirectory << libDirectory
cleanPattern << [ '**/*~' , '**/*.bak' ]

includeTool << gant.tools.Ivy

target ( retrieveDependencies : 'Retrieves library dependencies for main and test.' ) {
    depends ( clean )
    mkdir ( dir : libDirectory )
    ivy.retrieve ( organisation : 'commons-lang' , module : 'commons-lang' , revision : '2.3' , inline : 'true', pattern : libDirectory + '/main/[artifact]-[revision].[ext]' )
    ivy.retrieve ( organisation : 'junit', module : 'junit', revision : '4.5', inline : 'true', pattern : libDirectory + '/test/[artifact]-[revision].[ext]')
}

setDefaultTarget ( retrieveDependencies )
</pre>
<p>Execute the build.gant script using Gant and you will observe the Jars being downloaded and copied to the main and test directories.  If you run the script again the Jars will be copied to the lib directory from your local Ivy repository (on Ubuntu this is .ivy2).  The end result is the following directory structure.</p>
<pre>
build.gant
lib
    main
        commons-lang-2.3.jar
    test
        junit-4.5.jar
</pre>
<p>The equivalent script in XML will probably take ten times more effort, especially if you have to maintain your Ivy files in XML as well!  Your build scripts in Gant look less cluttered and more readable than your typical XML based Ant scripts, which will make maintaining your build scripts far less painful.  Plus you have the power of Groovy at your disposal for handling more complicated logic.  So don't be a tool when it comes to builds.  Use Gant for your build tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://ca.rroll.net/2008/12/09/you-are-a-tool-if-you-arent-using-gant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

