Re: Implementing conditions

2003-07-31 Thread Stefan Bodewig
On Wed, 30 Jul 2003, Dominique Devienne [EMAIL PROTECTED] wrote:

 In Ant 1.6, just write a class that implements Condition, taskdef
 it, and use it inside condition.

s/task/type/

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Implementing conditions

2003-07-31 Thread Stefan Bodewig
On Wed, 30 Jul 2003, Morten Mortensen
[EMAIL PROTECTED] wrote:

 Ahhh! addCondition() is good! Then it *really* is, what I hoped it
 to be.  Is going to try it.  (Can Peter Reilly also deprecate the
 specific addspecific-condition-name()-method?? From my point of
 view, here, it should be history.)

deprecate but never remove, yes.  The hell of backwards compatibility.

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Implementing conditions

2003-07-31 Thread peter reilly
On Thursday 31 July 2003 07:55, Stefan Bodewig wrote:
 On Wed, 30 Jul 2003, Dominique Devienne [EMAIL PROTECTED] wrote:
  In Ant 1.6, just write a class that implements Condition, taskdef
  it, and use it inside condition.

 s/task/type/

Just to be sure:
use typedef/ and not taskdef/ to define the condition.

I am writing an update to the ant manual describing this
at the moment. (With my one word of doc per day productivity
it should be ready soon..)

Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Implementing conditions

2003-07-30 Thread Morten Mortensen

...*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:[EMAIL PROTECTED] 
  http://www.tietoenator.com


-Original Message-
From: Dominique Devienne [mailto:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
 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:[EMAIL PROTECTED]
   http://www.tietoenator.com
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Implementing conditions

2003-07-30 Thread Dominique Devienne
In Ant 1.5.x, the Condition framework is not extensible without modifying
Ant's code. In Ant 1.6, just write a class that implements Condition,
taskdef it, and use it inside condition. Cannot get any simpler, right?
I haven't played with Ant 1.6 at all, so this is all in theory ;-)

If it doesn't work, complain to Peter Reilly who did this (great!) piece of
code ;-) --DD

 -Original Message-
 From: Morten Mortensen [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 30, 2003 4:28 PM
 To: 'Ant Developers List'
 Subject: RE: Implementing conditions
 
 Still, how to implement generic conditions?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Implementing conditions

2003-07-30 Thread Morten Mortensen

Ahhh! addCondition() is good! Then it *really* is, what I hoped it to be.
Is going to try it.
(Can Peter Reilly also deprecate the specific
addspecific-condition-name()-method?? From my point of view, here, it
should be history.)

I have already skipped 1.5.3 - 'Antoine Levy-Lambert' did something cool and
quite useful the other day; I am using Ant-1.6-20030728.

Can not get any simpler.

 !

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


-Original Message-
From: Dominique Devienne [mailto:[EMAIL PROTECTED]
Sent: 30. juli 2003 23:36
To: 'Ant Developers List'
Subject: RE: Implementing conditions


In Ant 1.5.x, the Condition framework is not extensible without modifying
Ant's code. In Ant 1.6, just write a class that implements Condition,
taskdef it, and use it inside condition. Cannot get any simpler, right?
I haven't played with Ant 1.6 at all, so this is all in theory ;-)

If it doesn't work, complain to Peter Reilly who did this (great!) piece of
code ;-) --DD

 -Original Message-
 From: Morten Mortensen [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 30, 2003 4:28 PM
 To: 'Ant Developers List'
 Subject: RE: Implementing conditions
 
 Still, how to implement generic conditions?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]