<?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>Robin&#039;s Tech Tips &#187; ant</title>
	<atom:link href="http://robin.mytechtip.com/tag/ant/feed/" rel="self" type="application/rss+xml" />
	<link>http://robin.mytechtip.com</link>
	<description>Just another My Tech Tip weblog</description>
	<lastBuildDate>Wed, 06 Jul 2011 02:35:54 +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>Use Ant to Generate ChangeLogs From CVS ang Group by Date</title>
		<link>http://robin.mytechtip.com/2009/09/02/use-ant-to-generate-changelogs-from-cvs-ang-group-by-date/</link>
		<comments>http://robin.mytechtip.com/2009/09/02/use-ant-to-generate-changelogs-from-cvs-ang-group-by-date/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 05:58:44 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[cvs]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=43</guid>
		<description><![CDATA[


Since version 1.6.1, Ant, the java build tool, has a core task called &#8220;cvschangelog&#8220;. It is quite useful to use this task to grab a list of recent changes committed to the CVS repository. The output of this task is in XML format. Something like the following:

&#60;changelog&#62;
 &#60;entry&#62;
 &#60;date&#62;2009-09-02&#60;/date&#62;
 &#60;time&#62;12:00&#60;/time&#62;
 &#60;author&#62;robin&#60;/author&#62;
 &#60;file&#62;
 &#60;name&#62;test/ant/task/ChangeLog.txt&#60;/name&#62;
 &#60;revision&#62;1.2&#60;/revision&#62;
 &#60;prevrevision&#62;1.1&#60;/prevrevision&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-3371750151985752";
google_ad_slot = "0950801022";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>Since version 1.6.1, Ant, the java build tool, has a core task called &#8220;<a id="ylcq" title="cvschangelog" href="http://ant.apache.org/manual/CoreTasks/changelog.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/ant.apache.org');">cvschangelog</a>&#8220;. It is quite useful to use this task to grab a list of recent changes committed to the CVS repository. The output of this task is in XML format. Something like the following:</p>
<blockquote>
<div><span style="font-family: Courier New">&lt;changelog&gt;</span><br />
<span style="font-family: Courier New"> &lt;entry&gt;</span><br />
<span style="font-family: Courier New"> &lt;date&gt;2009-09-02&lt;/date&gt;</span><br />
<span style="font-family: Courier New"> &lt;time&gt;12:00&lt;/time&gt;</span><br />
<span style="font-family: Courier New"> &lt;author&gt;robin&lt;/author&gt;</span><br />
<span style="font-family: Courier New"> &lt;file&gt;</span><br />
<span style="font-family: Courier New"> &lt;name&gt;test/ant/task/ChangeLog.txt&lt;/name&gt;</span><br />
<span style="font-family: Courier New"> &lt;revision&gt;1.2&lt;/revision&gt;</span><br />
<span style="font-family: Courier New"> &lt;prevrevision&gt;1.1&lt;/prevrevision&gt;</span><br />
<span style="font-family: Courier New"> &lt;/file&gt;</span><br />
<span style="font-family: Courier New"> &lt;msg&gt;&lt;![CDATA[</span>A commit message<span style="font-family: Courier New">]]&gt;&lt;/msg&gt;</span><br />
<span style="font-family: Courier New"> &lt;/entry&gt;</span><br />
&lt;entry&gt;<br />
&#8230;<br />
&lt;/entry&gt;<br />
&#8230;<br />
<span style="font-family: Courier New">&lt;/changelog&gt;</span></div>
</blockquote>
<p>To transform the xml formatted changelog into a human friendly html, you can do an XSL transformation with a XSL file. There is a default one in the Ant distribution, so you can use the following task to get a change log in html format.</p>
<blockquote><p><span style="font-family: Courier New"> &lt;style in=&#8221;changelog.xml&#8221; </span><br />
<span style="font-family: Courier New"> out=&#8221;changelog.html&#8221; </span><br />
<span style="font-family: Courier New"> style=&#8221;${ant.home}/etc/changelog.xsl&#8221;&gt;</span><br />
<span style="font-family: Courier New"> &lt;param name=&#8221;title&#8221; expression=&#8221;Ant ChangeLog&#8221;/&gt;</span><br />
<span style="font-family: Courier New"> &lt;param name=&#8221;module&#8221; expression=&#8221;the_module&#8221;/&gt;</span><br />
<span style="font-family: Courier New"> &lt;param name=&#8221;cvsweb&#8221; expression=&#8221;the_url&#8221;/&gt;</span><br />
<span style="font-family: Courier New"> &lt;/style&gt;</span></p></blockquote>
<p>The default generated html lists each commit change one by one. In some cases, we want to group the commit changes by dates. To do so, we have to change the default xsl file.</p>
<p>It seems that the new <a id="dwod" title="XSLT version 2.0 has specified a group functionality" href="http://www.xml.com/pub/a/2003/11/05/tr.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.xml.com');">XSLT version 2.0 has specified a group functionality</a>. However, it turns out only a few XSLT tools support this new feature. Fortunately, There is a way that <a id="mxme" title="allows us to do the grouping using XSLT version 1.0" href="http://www.jenitennison.com/xslt/grouping/muenchian.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.jenitennison.com');">allows us to do the grouping using XSLT version 1.0</a>. By applying this method, we have the following looking xsl code for the HTML &lt;BODY&gt; part.</p>
<blockquote><p><span> &lt;body&gt;</span><br />
<span> &lt;h1&gt;</span><br />
<span> &lt;a name=&#8221;top&#8221;&gt;&lt;xsl:value-of select=&#8221;$title&#8221;/&gt;&lt;/a&gt;</span><br />
<span> &lt;/h1&gt;</span><br />
<span> &lt;p style=&#8221;text-align: right&#8221;&gt;Designed for use with &lt;a href=&#8221;http://ant.apache.org/&#8221;&gt;Apache Ant&lt;/a&gt;.&lt;/p&gt;</span><br />
<span> &lt;hr/&gt;</span><br />
<span> </span><br />
<span> &lt;xsl:key name=&#8221;log-by-date&#8221; match=&#8221;entry&#8221; use=&#8221;date&#8221; /&gt;</span><br />
<span> </span><br />
<span> &lt;xsl:template match=&#8221;changelog&#8221;&gt;</span><br />
<span> &lt;xsl:for-each select=&#8221;entry[count(. | key('log-by-date', date)[1]) = 1]&#8221;&gt;</span><br />
<span> &lt;xsl:sort select=&#8221;date&#8221; order=&#8221;descending&#8221; /&gt;</span><br />
<span> &lt;h2&gt;&lt;xsl:value-of select=&#8221;date&#8221;/&gt;&lt;xsl:text&gt;&lt;/xsl:text&gt;&lt;/h2&gt;</span><br />
<span> &lt;xsl:for-each select=&#8221;key(&#8217;log-by-date&#8217;, date)&#8221;&gt;</span><br />
<span> </span><br />
<span> &lt;xsl:sort select=&#8221;time&#8221; order=&#8221;descending&#8221; /&gt;</span><br />
<span> </span><br />
<span> &lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;1&#8243;&gt;</span><br />
<span> &lt;tr&gt;</span><br />
<span> &lt;td class=&#8221;dateAndAuthor&#8221;&gt;</span><br />
<span> &lt;!&#8211; &lt;xsl:value-of select=&#8221;date&#8221;/&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt; &#8211;&gt;</span><br />
<span> &lt;xsl:value-of select=&#8221;time&#8221;/&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;xsl:value-of select=&#8221;author&#8221;/&gt;</span><br />
<span> &lt;/td&gt;</span><br />
<span> &lt;/tr&gt;</span><br />
<span> &lt;tr&gt;</span><br />
<span> &lt;td&gt;</span><br />
<span> &lt;pre&gt;&lt;xsl:apply-templates select=&#8221;msg&#8221;/&gt;&lt;/pre&gt;</span><br />
<span> &lt;ul&gt;</span><br />
<span> &lt;xsl:apply-templates select=&#8221;file&#8221;/&gt;</span><br />
<span> &lt;/ul&gt;</span><br />
<span> &lt;/td&gt;</span><br />
<span> &lt;/tr&gt;</span><br />
<span> &lt;/table&gt;</span><br />
<span> &lt;/xsl:for-each&gt;</span><br />
<span> &lt;/xsl:for-each&gt;</span><br />
<span> &lt;/xsl:template&gt;</span><br />
<span> </span><br />
<span> &lt;/body&gt;</span></p></blockquote>
<p>Use the above code to replace the &lt;body&gt; part in the original changelog.xsl file, then it  will allow you to group the change logs by date.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/09/02/use-ant-to-generate-changelogs-from-cvs-ang-group-by-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ant: how to list files that are copied/compiled</title>
		<link>http://robin.mytechtip.com/2009/01/08/ant-how-to-list-files-copied/</link>
		<comments>http://robin.mytechtip.com/2009/01/08/ant-how-to-list-files-copied/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 02:01:56 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/2009/01/08/12/</guid>
		<description><![CDATA[


Ant is a good tool to automate the project build / deploy process (especially for java projects). What&#8217;s more, it can also be an general tool used for file synchronization, backup and etc.
When i used ant to synchronize my folder in the desktop computer to my usb flash drive, i wanted to know what exact [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-3371750151985752";
google_ad_slot = "0950801022";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<br />
<strong><a id="lc41" title="Ant" href="http://ant.apache.org/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ant.apache.org');">Ant</a> </strong>is a good tool to automate the project build / deploy process (especially for java projects). What&#8217;s more, it can also be an general tool used for file synchronization, backup and etc.</p>
<p>When i used <strong>ant </strong>to synchronize my folder in the desktop computer to my usb flash drive, i wanted to know what exact files have been copied over for synchronization. However, by default, <strong>ant </strong>only shows how many files have been copied over.</p>
<p>I tried adding option &#8220;&#8211;verbose&#8221; (or &#8220;-v&#8221;) to the <strong>ant </strong>command. But this option make the output too verbose to tell the copied files.</p>
<p>Finally, I found the solution. It&#8217;s actually very easy. In the &#8220;build.xml&#8221; file, for the &#8220;copy&#8221; task, just add the attribute &#8220;verbose&#8221; with the value &#8220;true&#8221;. For example:</p>
<div style="margin-left: 40px">&lt;target name=&#8221;backup-download&#8221; description=&#8221;backup&#8221;&gt;<br />
&lt;copy todir=&#8221;${todir}&#8221; <strong>verbose=&#8221;true&#8221;</strong>&gt;<br />
&lt;fileset dir=&#8221;${download}&#8221; &gt;&lt;/fileset&gt;<br />
&lt;/copy&gt;<br />
&lt;/target&gt;</div>
<p>This &#8220;verbose&#8221; attribute is also available for the task &#8220;javac&#8221;, which means you can list java files that are actually compiled with this attribute turned on.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/01/08/ant-how-to-list-files-copied/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

