ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject FYI: leafcutter - An API which allows you to execute Ant tasks from Java code
Date Tue, 18 Oct 2005 08:34:22 GMT
Haven´t worked with that - just found the page while visiting some blogs.

Sayed Hashimi started a discussion [1] about build tools (primarily Ant+Maven). Suggestions
in comments were combining Ant+Groovy. But also leafcutter [2] was listed.

>From leafcutter´s homepage:
Leafcutter is an API which allows you to execute Ant tasks from Java code. 
Leafcutter is useful as:
- A way of integrating Ant tasks into existing Java programs. 
- A wholesale alternative to standard Ant for process automation. We'll look at reasons for
doing this in a moment. 
Prior knowledge of Ant is helpful, but not necessary. 

<target name="backup" depends="init" if="backup.enabled">   
    <property name="source.dir" value="src/main"/>
    <copy todir="home/backups" verbose=true>
        <fileset dir=${source.dir}" includes="**/*.txt"/>

This Java code does the same job using the Leafcutter API:

public void backup(boolean enabled){
    if (enabled){
        File sourceDir = new File("src/main");"copy todir=home/backups verbose=true (fileset dir=${1} includes=**/*.txt)",

In case someone want´s to play a little bit :-)



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message