wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes ANT if/else condition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ANT if/else condition" Watch "ANT if/else condition" New topic
Author

ANT if/else condition

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
In an ANT target, I need to specify a condition. If "websso" property is true then do "X" else do "Y".


In the properties file, I have



In ANT script I have



But the result, I always get as "FALSE".


Since in properties file, true is specified, result should also be true.
Can someone please let me know how to correct this?

Thank you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
Here's a hint: A property called "websso" is never checked by the Ant script.


Ping & DNS - my free Android networking tools app
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
Thanks for replying.

I did this as well

<target name="websso.is.true" if="${websso}">

but still same result

Thank you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41524
    
  53
Have you verified that the properties file is correctly included by outputting the value of "websso"?
Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
thanks a lot.

That was precisely the problem
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ANT if/else condition