Ant 1.8.0 released

The Apache Ant team just announced Ant 1.8.0.  The most stunning change is that of lexically scoped local properties.  Now, you can keep a property scoped to a target, or a sequential block.  Hopefully this will mean poeple rely less on ant-contrib.   Many people appear to misunderstand the Ant properties mechanism; maybe they are going with the flow. I do admit it’s convenient to have local variables inside your macrodef sequential blocks.

Congratulations, Ant team! Here’s the rest of the changes (from the announcement):

  • <import> can now import from any file- or URL-providing resource – this includes <javaresource>.
  • 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 dramatic.
  • The way developers can extend Ant’s property expansion algorithm has been rewritten (breaking the older API) to be easier to use and be more powerful.
  • a new top level element extension-point allows build files to be extended with custom targets more easily
  • 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. if=”${foo}” will mean “yes, do it” if ${foo} expands to true, in Ant 1.7.1 it would mean “no” unless a property named “true” existed). This adds “testing conditions” as a new use-case to property expansion.
  • Ant now requires Java 1.4 or later
  • new task include provides an alternative to <import> that should be preferred when you don’t want to override any targets
  • numerous bug fixes and improvements as documented in Bugzilla and in WHATSNEW

via Apache Ant – Welcome.


3 thoughts on “Ant 1.8.0 released

  1. Adam Leggett says:

    Presumably the new import task means I can package/release a suite of common build files as a Jar, much like an antlib and load via the classloader somehow?

  2. John Arundel says:

    Here’s a question for you. Someone commented on my recent post about managing Drupal with Puppet that they don’t think Puppet should be touching the software stack on the machine (PHP + Apache in this case) and that they use Ant (plus Fabric, etc) for this.

    I see that Ant is becoming very sophisticated. So where do you think the boundary should be drawn between building the base machine with a CM tool such as Puppet, and deploying the software stack with a tool like Ant?

  3. admin says:

    @adam – that’s my reading of it. This might help some of the attempts to make more opinionated Ant tools.

    @john If you’re fluent in Puppet, who cares? My wordpress installs are managed by Puppet. Puppet will roll back unauthorised changes, which is nice. You could use Fabric or Capistrano instead, or call them from Puppet.

    I wouldn’t use Ant though. Ant’s good for building and packaging software. There are better tools for deployment but people still keep bending and twisting Ant to do deploys.

Comments are closed.

%d bloggers like this: