File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 42936
    
  68
Here's a hint: A property called "websso" is never checked by the Ant script.
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: 42936
    
  68
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ANT if/else condition