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: 39548
    
  27
Here's a hint: A property called "websso" is never checked by the Ant script.


Ping & DNS - updated with new look and Ping home screen widget
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: 39548
    
  27
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
 
Similar Threads
ant exception
Rename a file while adding to a JAR
ANT: update JAR file
Ant build fail, sometimes 'cause ant forgets property
Building a war in eclipse using ant