ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morten Mortensen <morten.morten...@tietoenator.com>
Subject RE: Implementing "conditions"
Date Wed, 30 Jul 2003 21:28:10 GMT

...*Damn!* :-)
Yes, I see the "type"-attribute (I exactly want to differentiate into
"is-file", "is-directory" and "is-something-else").
Not really a simple condition, but it sure is there!

     -----

Still, how to implement generic conditions?

Med venlig hilsen 
  Morten Sabroe Mortensen 
  TietoEnator A/S, Ved Lunden 12, 8230 Åbyhøj, Danmark 
  mailto:Morten.Mortensen@tietoenator.com 
  http://www.tietoenator.com


-----Original Message-----
From: Dominique Devienne [mailto:DDevienne@lgc.com]
Sent: 30. juli 2003 21:55
To: 'Ant Developers List'
Subject: RE: Implementing "conditions"


Is-file and is-dir exist already. It's called <available>, which is both a
Task and a Condition. --DD

> -----Original Message-----
> From: Morten Mortensen [mailto:morten.mortensen@tietoenator.com]
> Sent: Wednesday, July 30, 2003 2:48 PM
> To: 'Ant Developers List'
> Subject: Q: Implementing "conditions"
> 
> 
> Hi All,
> 
> Regarding the "condition"-framework, I miss stuff like "is-file" and
> "is-dir". Hence I have implemented these as regular tasks setting a
> property
> and then used the condition-framework to branch on the values of these.
> 
> But I would like e.g. "is-file" and "is-dir" to be conditions, that is,
> looking at the API, my guess is, that they should implement the interface
> "org.apache.tools.ant.taskdefs.condition.Condition" and its "eval()"-
> method.
> 
> But the "ConditionTask" - or its super "ConditionBase" - contains
> "add"-methods *SPECIFIC* to the specific conditions  "IsTrue", "IsSet",
> "Equals", etc. (I am looking at
> http://nagoya.apache.org/gump/javadoc/ant/build/javadocs/org/apache/tools/
> an
> t/taskdefs/condition/ConditionBase.html). Does this mean, that the
> "Condition"-class is not at all generic and that one can not add ones own
> conditions and have them operate as part of "<condition>" and
> sf.ant-contrib's "<if>"??
> 
> I notice, that "addCondition()" is added to 1.6. Is this to loosen up? -
> Then
> e.g. "addIsTrue()" should have been marked deprecated in the API??
> 
> Is there a discussion of this, somewhere? "How to implement your own
> conditions"?
> 
>      ?
> 
> Med venlig hilsen
>   Morten Sabroe Mortensen
>   TietoEnator A/S, Ved Lunden 12, 8230 Åbyhøj, Danmark
>   mailto:Morten.Mortensen@tietoenator.com
>   http://www.tietoenator.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message