ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: Include nested arg elements in my custom task
Date Thu, 01 Jul 2004 05:17:20 GMT
> <target name="main">
>    <mytask>
>      <arg line="foo">
>      <arg line="bar">
>    </mytask>
> </target>
> I understand this means I need an add method in my Task subclass:
>      public void add(Arg arg) {}
> What class matches <arg> elements?

Depends on the <arg> you want to have :-)
If I want to reuse existing tasks/datatypes I search for an existing task
using that. In this case <exec> uses a nested <arg>.

ExecTask:027: import;
ExecTask:287:     public Commandline.Argument createArg() {
ExecTask:288:        return cmdl.createArgument();
ExecTask:289:     }

> Within this add method, can I just get the arg value or is 
> there something 
> else related to Ant that needs to be done?

Have you read
  Manual "Writing Your Own Task"

  Manual "Tutorial: Writing Tasks"


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message