Antlion
Welcome
License
 
How-To Guides
Getting Started
Libraries
Artifacts
Subprojects
Repositories
Policy Strategies
Format Strings
Extending Antlion
FAQ
 
Tutorials
First Tutorial: Simple
 
Ant Tasks
<artifact>
<libraryDef>
<library>
<library-policy>
inner processors
inner repositories
<library-type>
<library-repository>
<library-urlrepository>
<library-mavenrepository>
<library-repositoryset>
<create-artifact>
<subprojects>
<run-subproject>
<replace-target>
 
Optional Tasks
About optional tasks
RegexpTokenFormatter
 
RegexpTokenFormatter

The RegexpTokenFormatter is an alternative to the default Antlion formatter. It allows for using a matched regular expression based on an attribute's value.

Here's an example:

<repository basedir="${lib}">
  <format text="[groupid,commons-(.*),$1]/[groupid]-[version].jar" />
</repository>

  :
  
<libraryDef policyRef="track">
  <lib-entry groupid="commons-lang" version="2.1"/>
</library>
Here, the groupid attribute value ("commons-lang") is checked against the regular expression commons-(.*), and the final value used is the match on .*. So, the repository will check this entry for the file ${lib}/lang/commons-lang-2.1.jar.

At the moment, there is no way to escape the end-token character in the token text. This means that if you want to use a regular expression like t-([^\.]*), you would need to change the end-token character using a format statement like:

<format text="@groupid,t-([^\.]*),$1@.@type@"
  startToken="@" endToken="@" />


Document version $Revision: 1.1 $ $Date: 2005/12/01 23:12:49 $

SourceForge Logo
Copyright © 2004-2006, The Antlion Project