One and a half year after Ant 1.5, we've finally released Ant 1.6.0. It's been a long time and many of Ant's internals have changed. The most notable changes IMHO:
- Ant has improved support for big build problems with new tasks <import> and <subant> that can be used to import (and extend) build templates or recursively run a common target in a whole hierarchy of build files.
New tasks can be created by composing existing tasks via <macrodef>.
This can be used to to eliminate <antcall> in many cases - but a few problems with Ant's immutable properties remain and will get addressed in a future release.
- Ant has added new introspection rules for nested elements, those are mainly visible to task writers. One effect of those new rules is that you can now define custom conditions for <condition> and friends without modifying Ant's code.
A new concept of Ant libraries has been introduced. You can use them as a composition of the old <typedef> and <taskdef>, but there is more.
Ant 1.6.0 now also supports XML namespaces and there is a certain URI space reserved for Ant libraries. If you use
xmlns:mytasks="antlib:org.example"
in your build file, Ant will look for an Ant library descriptor/org/example/antlib.xml
in the classpath and tie the definitions found to the namespace prefix mytasks. You don't have to do anything else to use your tasks after that.Speaking of classpath. Ant now has a new launcher that sets up the classpath for Ant - this means that Ant will no longer place the libraries found in ANT_HOME/lib into the system classloader, but instead into a "core classloader" that is used to load all Ant classes.
The new launcher's initial goal was to avoid a command line length limit problem on the Windows platform, but it adds a few additional features. ANT_HOME/lib is no longer unique, you can now point Ant at any directory using the -lib command line switch and all jars inside the directory will be added to Ant's core classloader.
- With the help of JSch Ant finally supports SSH and SCP. This has become possible since JCraft decided to license JSch under a BSDish license instead of the LGPL they used initiallly.
A more complete list can be found in the Release Notes.
path: /en/Apache/Ant | #