ant-dev mailing list archives

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

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


Mime
View raw message