ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Property array?
Date Thu, 14 Aug 2008 21:56:50 GMT

Hey Mark-

no declaration of property array as far as I can see you can feel free to create your own
as in this example
  
public class MyTask extends Task {
    private List conditions = new ArrayList();
    public void add(Condition c) {
        conditions.add(c);
    }
    public void execute() {
     // iterator over the conditions
    }
}  
  
  
    One may define and use this class like this:
  
  
    <taskdef name="mytask" classname="MyTask" classpath="classes"/>
<typedef name="condition.equals"
         classname="org.apache.tools.ant.taskdefs.conditions.Equals"/>
<mytask>
    <condition.equals arg1="${debug}" arg2="true"/>
</mytask>
    
  There are a number of hidden implementation details such as which constructors are created
and used but the
mechanics of creating the stub are here..more info available at
http://ant.apache.org/manual/develop.html

Maybe some of the committers can weigh in???
Martin 

______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 


> Date: Thu, 14 Aug 2008 13:14:33 -0700
> From: markww@gmail.com
> To: user@ant.apache.org
> Subject: Property array?
> 
> 
> Hi,
> 
> Is there any way to make an array property in Ant? I want to write some
> stuff to a file based on an array property. Something like the user enters
> this:
> 
>    <property array name = "colors">
>        <val = "red">
>        <val = "green">
>        <val = "blue">
>     </property array>
> 
>     for (i = 0; i < ${colors}; i++) {
>         <echo file="myfile.txt" append="yes" message="${colors[i]}" />
>     }
> 
> Yeah I'm just making the syntax up as I go along - anything like that?
> 
> Thanks
> -- 
> View this message in context: http://www.nabble.com/Property-array--tp18988851p18988851.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

_________________________________________________________________
Reveal your inner athlete and share it with friends on Windows Live.
http://revealyourinnerathlete.windowslive.com?locale=en-us&ocid=TXT_TAGLM_WLYIA_whichathlete_us
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message