<?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>Ketan&#039;s Musings &#187; ant</title>
	<atom:link href="http://ketan.padegaonkar.name/tag/ant/feed" rel="self" type="application/rss+xml" />
	<link>http://ketan.padegaonkar.name</link>
	<description>Where he blogs about his eclipse musings</description>
	<lastBuildDate>Fri, 23 Jul 2010 16:03:25 +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>Growl notifications from ant</title>
		<link>http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html</link>
		<comments>http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html#comments</comments>
		<pubDate>Wed, 09 Jul 2008 03:59:34 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[growl]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/?p=234</guid>
		<description><![CDATA[If you use ant to run your builds, and would like to receive growl notifications about execution status, presenting Growl notifications for ant. All you need to do is execute: ant -listener com.google.code.ant.growlnotify.GrowlListener And you&#8217;ll need is the growlnotify binary somewhere on your path, this is bundled with the Growl binary dmg. Share this on [...]]]></description>
			<content:encoded><![CDATA[<p>If you use ant to run your builds, and would like to receive <a href="http://growl.info">growl</a> notifications about execution status, presenting <a href="http://code.google.com/p/ant-growlnotify/">Growl notifications for ant</a>.</p>
<p>All you need to do is execute:</p>
<p><code>ant -listener com.google.code.ant.growlnotify.GrowlListener</code></p>
<p>And you&#8217;ll need is the <a href="http://growl.info/documentation/growlnotify.php">growlnotify</a> binary somewhere on your path, this is bundled with the Growl binary dmg.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html&amp;title=Growl+notifications+from+ant" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html&amp;title=Growl+notifications+from+ant" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=RT+%40ketanpkr+Growl+notifications+from+ant+-+http://bit.ly/arKWvL&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html&amp;t=Growl+notifications+from+ant" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html&amp;title=Growl+notifications+from+ant&amp;description=If%20you%20use%20ant%20to%20run%20your%20builds%2C%20and%20would%20like%20to%20receive%20growl%20notifications%20about%20execution%20status%2C%20presenting%20Growl%20notifications%20for%20ant.%0A%0AAll%20you%20need%20to%20do%20is%20execute%3A%0A%0Aant%20-listener%20com.google.code.ant.growlnotify.GrowlListener%0A%0AAnd%20you%27ll%20need%20is%20the%20growlnotify%20binary%20somewhere%20on%20your%20p" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2008/07/09/growl-notifications-from-ant.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Composite Logger for Ant</title>
		<link>http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html</link>
		<comments>http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html#comments</comments>
		<pubDate>Wed, 04 Apr 2007 13:54:36 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[experiences]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html</guid>
		<description><![CDATA[When doing long builds in CruiseControl, ant build logs are generally logged using the XmlLogger. In certain cases, say for example when the build is taking longer than usual, and needs to be killed/stopped, the XmlLogger does not flush contents to disk. It would be nice if there is some sort of a composite logger [...]]]></description>
			<content:encoded><![CDATA[<p>When doing long builds in CruiseControl, ant build logs are generally logged using the XmlLogger.</p>
<p>In certain cases, say for example when the build is taking longer than usual, and needs to be killed/stopped, the XmlLogger does not flush contents to disk.</p>
<p>It would be nice if there is some sort of a composite logger than can chain any logger along with the XmlLogger.</p>
<p>I just happened to write one sometime today. This is the source code for a CompositeLogger that logs to a default logger, and the XmlLogger. This needs the environment variable ANT_LOG_PREFIX to be set (there&#8217;s no better way I can think of)</p>
<pre>
package com.thoughtworks.ant.logger;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;

import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildLogger;
import org.apache.tools.ant.DefaultLogger;
import org.apache.tools.ant.XmlLogger;

/**
 * @author Ketan Padegaonkar
 */
public class CompositeAntLogger implements BuildLogger {

        private ArrayList       loggers;
        private String          logPrefix;
        private PrintStream     out;

        public CompositeAntLogger() {
                checkLogPrefix();
                createLoggers();
        }

        public void setEmacsMode(boolean emacsMode) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.setEmacsMode(emacsMode);
                }
        }

        public void buildFinished(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.buildFinished(event);
                }
        }

        public void buildStarted(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.buildStarted(event);
                }
        }

        public void messageLogged(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.messageLogged(event);
                }

        }

        public void targetFinished(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.targetFinished(event);
                }
        }

        public void targetStarted(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.targetStarted(event);
                }
        }

        public void taskFinished(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.taskFinished(event);
                }
        }

        public void taskStarted(BuildEvent event) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.taskStarted(event);
                }
        }

        public void setMessageOutputLevel(int level) {
                for (Iterator iterator = loggers.iterator(); iterator.hasNext();) {
                        BuildLogger logger = (BuildLogger) iterator.next();
                        logger.setMessageOutputLevel(level);
                }
        }

        public void setOutputPrintStream(PrintStream output) {
                // do nothing
        }

        public void setErrorPrintStream(PrintStream err) {
                // do nothing
        }

        private void createLoggers() {
                loggers = new ArrayList();
                try {
                        loggers.add(createDefaultLogger());
                        loggers.add(createXmlLogger());
                } catch (FileNotFoundException e) {
                        throw new BuildException("The loggers could not open the file", e);
                }
        }

        private void checkLogPrefix() {
                logPrefix = System.getenv("ANT_LOG_PREFIX");
                if (logPrefix == null || logPrefix.trim().length() == 0)
                        throw new BuildException("You need to set the environment variable ANT_LOG_PREFIX.");
        }

        private DefaultLogger createDefaultLogger() throws FileNotFoundException {
                DefaultLogger logger = new DefaultLogger();
                out = new PrintStream(new FileOutputStream(logPrefix + ".txt"));
                logger.setOutputPrintStream(out);
                logger.setErrorPrintStream(out);
                return logger;
        }

        private XmlLogger createXmlLogger() throws FileNotFoundException {
                XmlLogger logger = new XmlLogger();
                out = new PrintStream(new FileOutputStream(logPrefix + ".xml"));
                logger.setOutputPrintStream(out);
                logger.setErrorPrintStream(out);
                return logger;
        }
}
</pre>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html&amp;title=Composite+Logger+for+Ant" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html&amp;title=Composite+Logger+for+Ant" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=RT+%40ketanpkr+Composite+Logger+for+Ant+-+http://bit.ly/b8opeL&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html&amp;t=Composite+Logger+for+Ant" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html&amp;title=Composite+Logger+for+Ant&amp;description=When%20doing%20long%20builds%20in%20CruiseControl%2C%20ant%20build%20logs%20are%20generally%20logged%20using%20the%20XmlLogger.%0A%0AIn%20certain%20cases%2C%20say%20for%20example%20when%20the%20build%20is%20taking%20longer%20than%20usual%2C%20and%20needs%20to%20be%20killed%2Fstopped%2C%20the%20XmlLogger%20does%20not%20flush%20contents%20to%20disk.%0A%0AIt%20would%20be%20nice%20if%20there%20is%20some%20sort%20of%20a" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2007/04/04/composite-logger-for-ant.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SVNAnt: Using ant with SVN</title>
		<link>http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html</link>
		<comments>http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html#comments</comments>
		<pubDate>Tue, 13 Mar 2007 14:40:47 +0000</pubDate>
		<dc:creator>Ketan</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[experiences]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[SVNAnt]]></category>

		<guid isPermaLink="false">http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html</guid>
		<description><![CDATA[While working on some ant build scripts today. A lot of custom batch files that were being exec&#8217;ed from within ant builds; batch files that would perform svn updates, reverts and commits, among other svn actions. A good alternative would be to use SVNAnt (some snippets follow): &#60;svn&#62; &#60;delete&#62; &#60;fileset dir="workingcopy/deleteTest"&#62; &#60;include name="**/*.del"/&#62; &#60;/fileset&#62; &#60;/delete&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>While working on some ant build scripts today. A lot of custom batch files that were being exec&#8217;ed from within ant builds; batch files that would perform svn updates, reverts and commits, among other svn actions.</p>
<p>A good alternative would be to use <a href="http://subclipse.tigris.org/svnant/">SVNAnt</a> (some snippets follow):</p>
<pre>
&lt;svn&gt;
  &lt;delete&gt;
    &lt;fileset dir="workingcopy/deleteTest"&gt;
      &lt;include name="**/*.del"/&gt;
    &lt;/fileset&gt;
  &lt;/delete&gt;
  &lt;commit message="commit deleted files"
       dir="workingcopy/deleteTest"/&gt;
&lt;/svn&gt;
</pre>
<pre>
&lt;svn&gt;
  &lt;update dir="dir/to/update/" recurse="true" /&gt;
&lt;/svn&gt;
</pre>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center">
<ul class="socials">
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html&amp;title=SVNAnt%3A+Using+ant+with+SVN" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html&amp;title=SVNAnt%3A+Using+ant+with+SVN" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=RT+%40ketanpkr+SVNAnt%3A+Using+ant+with+SVN+-+http://bit.ly/aHmXyn&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html&amp;t=SVNAnt%3A+Using+ant+with+SVN" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html&amp;title=SVNAnt%3A+Using+ant+with+SVN&amp;description=While%20working%20on%20some%20ant%20build%20scripts%20today.%20A%20lot%20of%20custom%20batch%20files%20that%20were%20being%20exec%27ed%20from%20within%20ant%20builds%3B%20batch%20files%20that%20would%20perform%20svn%20updates%2C%20reverts%20and%20commits%2C%20among%20other%20svn%20actions.%0A%0AA%20good%20alternative%20would%20be%20to%20use%20SVNAnt%20%28some%20snippets%20follow%29%3A%0A%0A%0A%26lt%3Bsvn%26gt%3B%0A%20%20%26lt%3B" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://ketan.padegaonkar.name/2007/03/13/svnant-using-ant-with-svn.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
