ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: scriptdef documentation - usage examples
Date Mon, 16 Feb 2004 14:28:46 GMT
Mark Lybarger wrote:

>i'm looking for examples of the scriptdef task usage.  my desire to use this task is that
i have a need to loop through all the beans in a directory and call a deploy ant task.  is
this possible with the scriptdef?  what i'm looking for is a way to call another local task
from w/i the scriptdef. and how to pass values to that task.  i'm familiar with java script,
but could give another scripting a whirl if it's more suited.
Something like this:

    <scriptdef name="deploybeans" language="beanshell">
       <element name="beans" type="path"/>
      files = elements.get("beans").get(0).list();
      for (i = 0; i < files.length; ++i) {
         t = project.createTask("echo");
         t.setMessage("File is " + files[i]);
        <fileset dir="." includes="*.bean"/>

Or use <for> from antcontrib

<ac:for param="file" xmlns:ac="antlib:net.sf.antcontrib">
     <ac:fileset dir="." includes="*.bean"/>
        <echo>File is @{file}</echo>


>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (
>Version: 6.0.574 / Virus Database: 364 - Release Date: 1/29/2004
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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

View raw message