<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>Stefan Bodewig's Weblog   </title>
    <link>http://stefan.samaflost.de/blog</link>
    <description>Mixed Content</description>
    <language>en</language>

<item>
  <title>Apache Ant 1.8.1</title>
  <link>http://stefan.samaflost.de/blog/en/Apache/Ant/181.html</link>
  <description>
&lt;p&gt;Last weekend Antoine announced Ant 1.8.1.  This is more or less a
pure bugfix release which addresses a few important issues.  The fix
with the biggest impact likely is that
&lt;code&gt;&amp;lt;extension-point&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;import&amp;gt;&lt;/code&gt;
finally work together as intended - and even documented.&lt;/p&gt;

&lt;p&gt;The full list of issues raised against Ant that have been fixed
with this release can be found in &lt;a
href=&quot;https://issues.apache.org/bugzilla/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=CLOSED;component=Build%20Process;component=Core;component=Core%20tasks;component=Documentation;component=Optional%20SCM%20tasks;component=Optional%20Tasks;component=Other;component=Wrapper%20scripts;resolution=FIXED;target_milestone=1.8.1;product=Ant&quot;&gt;Bugzilla&lt;/a&gt;.
We've adressed almost all issues raised against Ant 1.8.0 so far.&lt;/p&gt;

&lt;p&gt;Thanks to the new &lt;code&gt;&amp;lt;augment&amp;gt;&lt;/code&gt; task, detecting Ant
1.8.1 means either

&lt;pre class=&quot;code&quot;&gt;
  &amp;lt;antversion property=&quot;Ant-1.8.1-or-later&quot;
              atleast=&quot;1.8.1&quot;/&gt;
&lt;/pre&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;pre class=&quot;code&quot;&gt;
  &amp;lt;available property=&quot;Ant-1.8.1-or-later&quot;
             classname=&quot;org.apache.tools.ant.taskdefs.AugmentReference&quot;/&gt;
&lt;/pre&gt;</description>
</item>
<item>
  <title>Lazy Sequence of Directory Descendants in C#</title>
  <link>http://stefan.samaflost.de/blog/en/dotNet/lazy_directory_listing.html</link>
  <description>
&lt;p&gt;Chris Sells &lt;a
href=&quot;http://www.sellsbrothers.com/news/showTopic.aspx?ixTopic=2334&quot;&gt;translated&lt;/a&gt;
a Clojure &lt;em&gt;&lt;a href=&quot;http://www.pluralsight-training.net/community/blogs/craig/archive/2010/03/09/creating-a-lazy-sequence-of-directory-descendants-in-clojure.aspx&quot;&gt;implementation of a function that descends
into a directory in a &quot;lazy&quot; manner&lt;/a&gt;&lt;/em&gt; by Craig Andera into C#
but his solution is so .NET 2.0 ;-).&lt;/p&gt;

&lt;p&gt;Here's my take&lt;/p&gt;

&lt;pre class=&quot;code&quot;&gt;
    static IEnumerable&amp;lt;string&gt; GetDirectoryDescendants(string path) {
        return Directory.GetFiles(path)
            .Concat(Directory.GetDirectories(path)
                .SelectMany&amp;lt;string, string&gt;(GetDirectoryDescendants)
            );
    }
&lt;/pre&gt;

&lt;p&gt;where I'd hope C# 4.0's compiler will be able to deduce the types
for the &lt;code&gt;SelectMany&lt;/code&gt; itself.  Interestingly the C# 3.0
compiler does fine when I use a lambda expression instead:

&lt;pre class=&quot;code&quot;&gt;
    static IEnumerable&amp;lt;string&gt; GetDirectoryDescendants(string path) {
        return Directory.GetFiles(path)
            .Concat(Directory.GetDirectories(path)
                .SelectMany(dir =&gt; GetDirectoryDescendants(dir))
            );
    }
&lt;/pre&gt;</description>
</item>
<item>
  <title>How to detect Ant 1.8.0 (or later)</title>
  <link>http://stefan.samaflost.de/blog/en/Apache/Ant/how_to_detect_180.html</link>
  <description>
&lt;p&gt;So Apache Ant 1.8.0 is out and I'm supposed to follow a tradition I
started with &lt;a
href=&quot;http://stefan.samaflost.de/blog/2004/10/07#how_to_detect_162.html&quot;&gt;Ant
1.6.2&lt;/a&gt;.  If you can be sure that you are at least using Ant 1.7.0
then the built-in &amp;lt;antversion&amp;gt; task/condition will do:

&lt;pre class=&quot;code&quot;&gt;
  &amp;lt;antversion property=&quot;Ant-1.8.0-or-later&quot;
              atleast=&quot;1.8.0&quot;/&gt;
&lt;/pre&gt;

&lt;p&gt;otherwise the trick of checking for a class that has been
introduced with Ant 1.8.0 can always be used:&lt;/p&gt;

&lt;pre class=&quot;code&quot;&gt;
  &amp;lt;available property=&quot;Ant-1.8.0-or-later&quot;
             classname=&quot;org.apache.tools.ant.types.resources.MappedResource&quot;/&gt;
&lt;/pre&gt;
</description>
</item>
<item>
  <title>What's New in Ant 1.8.0?</title>
  <link>http://stefan.samaflost.de/blog/en/Apache/Ant/whats_new_in_180.html</link>
  <description>
&lt;p&gt;Antoine Levy-Lambert has recently built the first release candidate
  for Ant 1.8.0
  and &lt;a href=&quot;http://mail-archives.apache.org/mod_mbox/ant-dev/201001.mbox/%3C4B43C4A5.8070103@gmx.de%3E&quot;&gt;called
  for a vote&lt;/a&gt;, so we should be close to the first Ant release since
  eighteen months.  This release mostly brings enhancements and bug
  fixes to many tasks and types (this is the real strength of Ant
  IMHO) but there also are a few core changes, the full list
  is &lt;a href=&quot;http://svn.apache.org/repos/asf/ant/core/tags/ANT_180_RC1/WHATSNEW&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My personal top five changes (I know there are six items, but the
  first one doesn't count ;-):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://issues.apache.org/bugzilla/buglist.cgi?query_format=advanced&amp;bug_status=RESOLVED&amp;bug_status=CLOSED&amp;component=Build%20Process&amp;component=Core&amp;component=Core%20tasks&amp;component=Documentation&amp;component=Optional%20SCM%20tasks&amp;component=Optional%20Tasks&amp;component=Other&amp;component=Wrapper%20scripts&amp;resolution=FIXED&amp;target_milestone=1.8.0&amp;product=Ant&quot;&gt;More
      than 275&lt;/a&gt; fixed Bugzilla issues.&lt;/li&gt;

  &lt;li&gt;Lexically scoped local properties, i.e. properties that are only
    defined inside a target, sequential block or similar environment.
    This is very useful inside of &lt;code&gt;&amp;lt;macrodef&amp;gt;&lt;/code&gt;s where
    a macro can now define a temporary property that will disappear
    once the task has finished.&lt;/li&gt;

  &lt;li&gt;&lt;code&gt;&amp;lt;import&amp;gt;&lt;/code&gt; can now import from any file- or
    URL-providing resource - this
    includes &lt;code&gt;&amp;lt;javaresource&amp;gt;&lt;/code&gt;.  This
    means &lt;code&gt;&amp;lt;import&amp;gt;&lt;/code&gt; can read build file snippets
    from JARs or fixed server URLs.  There are several other
    improvements in the area of import.&lt;/li&gt;

  &lt;li&gt;Various improvements to the directory scanning code that help
    with symbolic link cycles (as can be found on MacOS X Java
    installations for example) and improve scanning performance.  For
    big directory trees the improvement
    is &lt;a href=&quot;http://mail-archives.apache.org/mod_mbox/ant-dev/200809.mbox/%3Cy1u4p48li29.fsf@v30161.1blu.de%3E&quot;&gt;dramatic&lt;/a&gt;.&lt;/li&gt;

  &lt;li&gt;The way developers can extend Ant's property expansion algorithm
    has been rewritten (breaking the older API) to be easier to use a
    be more powerful.  The whole local properties mechanism is
    implemented using that API and could be implemented in a separate
    library without changes in Ant's core.  Things like the
    yet-to-be-released &lt;a href=&quot;http://ant.apache.org/antlibs/props/index.html&quot;&gt;props
    Antlib&lt;/a&gt; can now provide often required &quot;scripty&quot; fuctions
    without touching Ant itself.

    &lt;br/&gt;

    At the same time the if and unless attributes have been rewritten
    to do the expected thing if applied to a property expansion
    (i.e. &lt;code&gt;if=&quot;${foo}&quot;&lt;/code&gt; will mean &quot;yes, do it&quot;
    if &lt;code&gt;${foo}&lt;/code&gt; expands to true, in Ant 1.7.1 it would mean
    &quot;no&quot; unless a property named &quot;true&quot; existed).  This adds &quot;testing
    conditions&quot; as a new use-case to property expansion.&lt;/li&gt;

  &lt;li&gt;A new top-level element &lt;code&gt;&amp;lt;extension-point&amp;gt;&lt;/code&gt;
  assists in writing re-usable build files that are meant to be
  imported.  &lt;code&gt;&amp;lt;extension-point&amp;gt;&lt;/code&gt; has a name and a
  dependency-list like &lt;code&gt;&amp;lt;target&amp;gt;&lt;/code&gt; and can be used like a
    &lt;code&gt;&amp;lt;target&amp;gt;&lt;/code&gt; from the command line or
    a dependy-list but the importing build file can add targets to
    the &lt;code&gt;&amp;lt;extension-point&amp;gt;&lt;/code&gt;'s depends list.

    &lt;br/&gt;
    In Ant 1.7.1 one would use something like
&lt;pre class=&quot;code&quot;&gt;
imported.xml:
&amp;lt;project name=&quot;imported&quot;...&amp;gt;
  ...
  &amp;lt;target name=&quot;setup&quot;&amp;gt;
    ...
  &amp;lt;/target&amp;gt;
  &amp;lt;target name=&quot;compile&quot; depends=&quot;setup&quot;&amp;gt;
    ...
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;

importing.xml
&amp;lt;project ...&amp;gt;
  ...
  &amp;lt;import file=&quot;imported.xml&quot;&amp;gt;
  &amp;lt;target name=&quot;setup&quot; depends=&quot;imported.setup&quot;&amp;gt;
    ... stuff that should happen before compile ...
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;
    to define a pre-compilation stage by target overriding.  With
    some planning it can be improved to
&lt;pre class=&quot;code&quot;&gt;
imported.xml:
&amp;lt;project name=&quot;imported&quot;...&amp;gt;
  ...
  &amp;lt;target name=&quot;setup&quot;&amp;gt;
    ...
  &amp;lt;/target&amp;gt;
  &amp;lt;target name=&quot;ready-to-compile&quot; depends=&quot;setup&quot;/&amp;gt;
  &amp;lt;target name=&quot;compile&quot; depends=&quot;ready-to-compile&quot;&amp;gt;
    ...
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;

importing.xml
&amp;lt;project ...&amp;gt;
  ...
  &amp;lt;import file=&quot;imported.xml&quot;&amp;gt;
  &amp;lt;target name=&quot;ready-to-compile&quot; depends=&quot;imported.ready-to-compile&quot;&amp;gt;
    ... stuff that should happen before compile ...
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;
    In Ant 1.8.0 one would write this as
&lt;pre class=&quot;code&quot;&gt;
imported.xml:
&amp;lt;project name=&quot;imported&quot;...&amp;gt;
  ...
  &amp;lt;target name=&quot;setup&quot;&amp;gt;
    ...
  &amp;lt;/target&amp;gt;
  &amp;lt;extension-point name=&quot;ready-to-compile&quot; depends=&quot;setup&quot;/&amp;gt;
  &amp;lt;target name=&quot;compile&quot; depends=&quot;ready-to-compile&quot;&amp;gt;
    ...
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;

importing.xml
&amp;lt;project ...&amp;gt;
  ...
  &amp;lt;import file=&quot;imported.xml&quot;&amp;gt;
  &amp;lt;target name=&quot;pre-compile&quot; extensionOf=&quot;ready-to-compile&quot;&amp;gt;
    ... stuff that should happen before compile ...
  &amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
  &lt;/pre&gt;

    and the &lt;code&gt;pre-compile&lt;/code&gt; target was added
    to &lt;code&gt;ready-to-compile&lt;/code&gt; dependeny-list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;extension-point&lt;/code&gt; and some changes
  in &lt;code&gt;import&lt;/code&gt; and its new cousin &lt;code&gt;include&lt;/code&gt; have
  been inspired by &lt;a href=&quot;http://www.easyant.org/trac&quot;&gt;Easyant&lt;/a&gt;
  which can now use an un-patched version of Ant together with a
  custom &lt;code&gt;ProjectHelper&lt;/code&gt; to create a build system quite
  different from Ant's original ideas.  &lt;code&gt;ProjectHelper&lt;/code&gt; is the mechanism that allowed
  me
  to &lt;a href=&quot;http://stefan.samaflost.de/blog/en/Apache/Ant/ant_javafront.html&quot;&gt;sketch&lt;/a&gt;
  &lt;a href=&quot;http://svn.apache.org/repos/asf/ant/sandbox/javafront/&quot;&gt;JavaFront&lt;/a&gt;
  or Nicolas Lalev&amp;#xe9;e to
  write &lt;a href=&quot;http://svn.apache.org/repos/asf/ant/sandbox/groovyfront/&quot;&gt;GroovyFront&lt;/a&gt;
  which lets you write build files in Groovy.&lt;/p&gt;</description>
</item>
<item>
  <title>Uncle Stefan</title>
  <link>http://stefan.samaflost.de/blog/en/personal/family/uncle_stefan.html</link>
  <description>
&lt;p&gt;When my Mum called us this morning to tell us that my brother's
first daughter was born my kids celebrated &quot;finally I'm a cousin&quot;.&lt;/p&gt;

&lt;p&gt;Welcome Carina - being born on 11/11 will not always be easy in the
rhine area - and congratulations Claudia and Maik.&lt;/p&gt;</description>
</item>
  </channel>
</rss>