You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Martin Jericho <ma...@jabcreative.com> on 2002/04/30 04:54:21 UTC

"if" task

I have seen a reference to a task called "if" in the dev mailing list.  It
mentioned something called ant-contrib, which I found as a project on
sourceforge, but it didn't seem to contain an if task.
Does anyone know where I can get this extension?
Why on earth isn't such basic functionality included in the standard ant
tasks?  The whole process of creating a new target with an "if" attribute
for every conditional execution is very ugly.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: "if" task

Posted by Douglas WF Acheson <dw...@yahoo.com>.
Hello,

  I created my own "if" task that works something like this:

<if expression = "${property}" equals = "someVale">
  <task name  = "some oater antTask"/>
</if>

  It works by comparing the value in expression to the value of equals.
 If the comparison it does an ANT call to the task described in the
sub-element task.  It only took me 30 mins to write the code.

  In addition, you can replace equals with notEquals, greaterThan etc. 
If you want the code please let me know and I will tell you where to
download it from.

Douglas WF Acheson


--- Martin Jericho <ma...@jabcreative.com> wrote:
> I have seen a reference to a task called "if" in the dev mailing
> list.  It
> mentioned something called ant-contrib, which I found as a project on
> sourceforge, but it didn't seem to contain an if task.
> Does anyone know where I can get this extension?
> Why on earth isn't such basic functionality included in the standard
> ant
> tasks?  The whole process of creating a new target with an "if"
> attribute
> for every conditional execution is very ugly.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


=====
Douglas WF Acheson

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: "if" task

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Write your builds in Perl if you want "scripty".

Hey, even call Ant from there if you like.  :))

By the way, there is a <script> task too.

    Erik

----- Original Message -----
From: "Dave Bettin" <ja...@yahoo.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, April 30, 2002 12:04 AM
Subject: Re: "if" task


>
> > It's considered too "scripty".
>
>  What is the motivation to keep ant from being to
> "scripty"?
>
> Thanks,
> Dave
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: "if" task

Posted by Dave Bettin <ja...@yahoo.com>.
> It's considered too "scripty".

 What is the motivation to keep ant from being to
"scripty"? 

Thanks,
Dave

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: "if" task

Posted by Diane Holt <ho...@yahoo.com>.
--- Martin Jericho <ma...@jabcreative.com> wrote:
> I have seen a reference to a task called "if" in the dev mailing list. 
> It mentioned something called ant-contrib, which I found as a project on
> sourceforge, but it didn't seem to contain an if task.
> Does anyone know where I can get this extension?

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant-contrib/src/net/sf/antcontrib/logic/

> Why on earth isn't such basic functionality included in the standard ant
> tasks?

It's considered too "scripty".

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>