<?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>Divide and Conquer &#187; Ant</title>
	<atom:link href="http://www.divideandconquer.se/tag/ant/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.divideandconquer.se</link>
	<description>David's Software Development Blog</description>
	<lastBuildDate>Thu, 24 Jun 2010 13:47:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My cape and sword</title>
		<link>http://www.divideandconquer.se/2008/03/25/my-cape-and-sword/</link>
		<comments>http://www.divideandconquer.se/2008/03/25/my-cape-and-sword/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 19:27:44 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/03/25/my-cape-and-sword/</guid>
		<description><![CDATA[In the Walt Disney short animated movie Ferdinand The Bull the matador never get to show off his cape and sword. Sometimes I feel like the matador and want to show off my cape and sword (i.e. my programming skills), but for various reasons I can&#8217;t. The bull (i.e. the task at hand) might be [...]]]></description>
			<content:encoded><![CDATA[<p><img width="320" vspace="5" hspace="5" height="240" border="0" align="right" src="/wp-content/uploads/2008/03/vlcsnap-1895417.png" alt="Crying matador" />In the Walt Disney short animated movie <a href="http://www.youtube.com/watch?v=CGTVRbpAuRo" target="_self" onclick="pageTracker._trackPageview('/outgoing/www.youtube.com/watch?v=CGTVRbpAuRo&amp;referer=');">Ferdinand The Bull</a> the matador never get to show off his cape and sword. Sometimes I feel like the matador and want to show off my cape and sword (i.e. my programming skills), but for various reasons I can&#8217;t. The bull (i.e. the task at hand) might be too big, too small, or not even there&#8230;</p>
<p>Right now I&#8217;m pretty confident in writing custom <a href="http://ant.apache.org" target="_self" onclick="pageTracker._trackPageview('/outgoing/ant.apache.org?referer=');">Ant</a> tasks and using <a href="http://hc.apache.org/httpclient-3.x/index.html" target="_self" onclick="pageTracker._trackPageview('/outgoing/hc.apache.org/httpclient-3.x/index.html?referer=');">HttpClient</a>. It&#8217;s a pretty small bull, but not too bad.</p>
<div style="clear: both;">&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/03/25/my-cape-and-sword/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The case of the failing ant copy filterset</title>
		<link>http://www.divideandconquer.se/2008/03/04/the-case-of-the-failing-ant-copy-filterset/</link>
		<comments>http://www.divideandconquer.se/2008/03/04/the-case-of-the-failing-ant-copy-filterset/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 14:38:46 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/03/04/the-case-of-the-failing-ant-copy-filterset/</guid>
		<description><![CDATA[I wanted to set a couple of Windows environment variables from Ant.  The environment key-value pairs are stored on the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment key in the registry. As a starting point I used the registry editor to export all keys. I called the file environment.reg.template and modified it to look something like this:

Windows Registry Editor [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to set a couple of Windows environment variables from Ant.  The environment key-value pairs are stored on the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment key in the registry. As a starting point I used the registry editor to export all keys. I called the file environment.reg.template and modified it to look something like this:</p>
<pre>
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE&#92;SYSTEM&#92;CurrentControlSet&#92;Control&#92;Session Manager&#92;Environment]
&quot;FOO&quot;=&quot;@FOO&quot;
&quot;BAR&quot;=&quot;@BAR@&quot;</pre>
<p>My ant script contains something like this:</p>
<pre>
&lt;copy file=&quot;environment.reg.template&quot; tofile=&quot;environment.reg&quot;
    overwrite=&quot;true&quot;&gt;
  &lt;filterset&gt;
    &lt;filter token=&quot;FOO&quot; value=&quot;${foo}&quot;/&gt;
    &lt;filter token=&quot;BAR&quot; value=&quot;${bar}&quot;/&gt;
  &lt;/filterset&gt;
&lt;/copy&gt;
&lt;exec executable=&quot;regedit.exe&quot;&gt;
  &lt;arg value=&quot;/s&quot;/&gt;&lt;!-- &quot;silent&quot; --&gt;
  &lt;arg value=&quot;environment.reg&quot;/&gt;
&lt;/exec&gt;</pre>
<pre>
&nbsp;</pre>
<p>I ran the ant script and looked in environment.reg. It still looked just like environment.reg.template! Running again obviously didn&#8217;t work, but I had to try! :-) When did a cut &amp; paste of the above and sent to a colleague he could not reproduce the issue. I thought hard about it and then it dawned on me: the registry editor exported a file in Unicode format. I used notepad to convert it to ANSI and then everything worked fine. Case closed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/03/04/the-case-of-the-failing-ant-copy-filterset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle PL/SQL declare, begin, end from Ant</title>
		<link>http://www.divideandconquer.se/2008/01/29/oraclle-plsql-declare-begin-end-from-ant/</link>
		<comments>http://www.divideandconquer.se/2008/01/29/oraclle-plsql-declare-begin-end-from-ant/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 08:34:43 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/01/29/oraclle-plsql-declare-begin-end-from-ant/</guid>
		<description><![CDATA[Ant again. We had a file with Oracle PL/SQL statements using declare, begin and end. When using the sql task in Ant, it complained about reaching end-of-file on the line with &#8220;declare&#8221;. The problem is that Ant assumes that one line is one SQL statement, but it&#8217;s not that simple when using declare, begin and [...]]]></description>
			<content:encoded><![CDATA[<p>Ant again. We had a file with Oracle PL/SQL statements using declare, begin and end. When using the sql task in Ant, it complained about reaching end-of-file on the line with &#8220;declare&#8221;. The problem is that Ant assumes that one line is one SQL statement, but it&#8217;s not that simple when using declare, begin and end. The solution is to set slash (&#8217;/') as a statement delimiter. The excellent blog article <a href="http://www.javaddicts.net/blog/index.php/2005/06/13/executing-oracle-plsql-from-ant/" onclick="pageTracker._trackPageview('/outgoing/www.javaddicts.net/blog/index.php/2005/06/13/executing-oracle-plsql-from-ant/?referer=');">Executing Oracle PL/SQL from Ant</a> describes the problem and solution in more depth.<a href="http://www.javaddicts.net/blog/index.php/2005/06/13/executing-oracle-plsql-from-ant/" onclick="pageTracker._trackPageview('/outgoing/www.javaddicts.net/blog/index.php/2005/06/13/executing-oracle-plsql-from-ant/?referer=');"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/01/29/oraclle-plsql-declare-begin-end-from-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ant &#8220;replace&#8221; task does not preserve Unix file permissions</title>
		<link>http://www.divideandconquer.se/2007/12/18/ant-replace-task-does-not-preserve-unix-file-permissions/</link>
		<comments>http://www.divideandconquer.se/2007/12/18/ant-replace-task-does-not-preserve-unix-file-permissions/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 12:34:50 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2007/12/18/ant-replace-task-does-not-preserve-unix-file-permissions/</guid>
		<description><![CDATA[This is probably a well-known fact for everyone who has used Ant on Unix for a while, but an annoying discovery for me who have been hiding under a C++ rock. The five year old bug report File Permissions not preserved in replace task pretty much says it all: Java couldn&#8217;t stat files, and it [...]]]></description>
			<content:encoded><![CDATA[<p>This is probably a well-known fact for everyone who has used Ant on Unix for a while, but an annoying discovery for me who have been hiding under a C++ rock. The five year old bug report <a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=5661" onclick="pageTracker._trackPageview('/outgoing/issues.apache.org/bugzilla/show_bug.cgi?id=5661&amp;referer=');">File Permissions not preserved in replace task</a> pretty much says it all: Java couldn&#8217;t <a href="http://en.wikipedia.org/wiki/Stat_%28Unix%29" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Stat_28Unix_29?referer=');">stat</a> files, and it seems like it still can&#8217;t.</p>
<p><strong>Update</strong> The &#8220;replace&#8221; task destroys file ownership too, of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2007/12/18/ant-replace-task-does-not-preserve-unix-file-permissions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache Ant is regrettably (?) using XML</title>
		<link>http://www.divideandconquer.se/2007/12/13/ant/</link>
		<comments>http://www.divideandconquer.se/2007/12/13/ant/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 14:51:40 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2007/12/13/memorable-quotes-from-the-original-author-of-apache-ant/</guid>
		<description><![CDATA[I&#8217;ve done some Apache Ant build file hacking today and that made me recall that the original author of Ant, James Duncan Davidson, actually regretted using XML as the file format.
Mysteriously missing from today&#8217;s world wide web, but fortunately captured by the Wayback Machine, the blog entry Ant and XML  is worth reading. The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done some <a href="http://ant.apache.org/" onclick="pageTracker._trackPageview('/outgoing/ant.apache.org/?referer=');">Apache Ant</a> build file hacking today and that made me recall that the original author of Ant, James Duncan Davidson, actually regretted using XML as the file format.</p>
<p>Mysteriously missing from today&#8217;s world wide web, but fortunately captured by the Wayback Machine, the blog entry <a href="http://web.archive.org/web/20041217023752/http://x180.net/Journal/2004/03/31.html" onclick="pageTracker._trackPageview('/outgoing/web.archive.org/web/20041217023752/http_//x180.net/Journal/2004/03/31.html?referer=');">Ant and XML</a>  is worth reading. The entry is concluded like this:</p>
<blockquote><p> If I knew then what I knew now, I would have tried using a real scripting language, such as JavaScript via the Rhino component or Python via JPython, with bindings to Java objects which implemented the functionality expressed in todays tasks. Then, there would be a first class way to express logic and we wouldn&#8217;t be stuck with XML as a format that is too bulky for the way that people really want to use the tool.</p>
<p>Or maybe I should have just written a simple tree based text format that captured just what was needed to express a project and no more and which would avoid the temptation for people to want to build a Turing complete scripting environment out of Ant build files.</p>
<p>Both of these approaches would have meant more work for me at the time, but the result might have been better for the tens of thousands of people who use and edit Ant build files every day.</p>
<p>Hindsight is always 20/20.</p></blockquote>
<p>The &#8220;real scripting language&#8221; part sounds just like Ruby&#8217;s build program <a href="http://rake.rubyforge.org/" onclick="pageTracker._trackPageview('/outgoing/rake.rubyforge.org/?referer=');">Rake</a> and &#8220;a simple tree based text format&#8221; sounds very much like <a href="http://www.yaml.org/" onclick="pageTracker._trackPageview('/outgoing/www.yaml.org/?referer=');">YAML</a>, a format well worth considering for hierarchical data structures.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2007/12/13/ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
