ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Solofnenko <>
Subject RE: scriptdef
Date Mon, 09 Jun 2003 14:14:48 GMT
This is just great. It also solves <script> with parameters problem. Is it
in the nightly builds?

- Alexey.
{ } Alexey N. Solofnenko
Pleasant Hill, CA (GMT-8 usually)

-----Original Message-----
From: Conor MacNeill [] 
Sent: Monday, June 09, 2003 6:58 AM
To: Ant Developers List
Subject: scriptdef

Hi all,

I've just added a <scriptdef> task to allow tasks to be created using
It's loosely based on something I wrote a while back for Mutant. 

Attached below is an example usage. I had to make a few small mods to the
to give me enough control over the configuration of the task and its nested 
elements. The example should make usage pretty straight forward. Attributes 
and nested elements are passed in two script variables, oddly named 
"attributes" and "elements". The first of these is a simple map of Strings 
whilst the second is a map of lists.

One question I have is whether people feel this is something appropriate in 
Ant? Let me know your thoughts.

Formal documentation to follow ...


<project name="scripttest" default="test">

  <scriptdef name="scripttest" language="javascript">
    <attribute name="attr1"/>
    <element name="fileset" type="fileset"/>
    <element name="path" type="path"/>
      project.log("Hello from script");
      project.log("Attribute attr1 = " + attributes.get("attr1"));
      project.log("First fileset basedir = "
        + elements.get("fileset").get(0).getDir(project));
  <target name="test">
    <scripttest attr1="test">
        <pathelement location="src"/>
      <fileset dir="src"/>
      <fileset dir="main"/>

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

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

View raw message