Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Other Build Tools
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Other Build Tools
ANT if/else condition
Anjali S Sharma
Ranch Hand
Posts: 279
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
websso=true
In ANT script I have
<target name="copyCustom" depends="makedir" description="Copy Custom " > <condition property="${websso}"> <istrue value="${websso}"/> </condition> <antcall target="websso.is.true"/> <antcall target="websso.is.false"/> </target> <target name="websso.is.true" if="is.websso"> <echo>websso == TRUE</echo> <jar jarfile="${cvs.module.lib}/webtop.jar" includesfile="../build/AuthenticationSchemes-websso.properties" basedir="com/documentum/web/formext/session/AuthenticationSchemes.properties" update="true" /> </target> <target name="websso.is.false" unless="is.websso"> <echo>websso == FALSE</echo> <jar jarfile="${cvs.module.lib}/webtop.jar" includesfile="../build/AuthenticationSchemes-no-websso.properties" basedir="com/documentum/web/formext/session/AuthenticationSchemes.properties" update="true" /> </target>
But the result, I always get as "FALSE".
makedir: [mkdir] Created dir: C:\cvs_repo\Documentum\webtop\bin [mkdir] Created dir: C:\cvs_repo\Documentum\webtop\dist copyCustom: websso.is.true: websso.is.false: [echo] websso == 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
Rancher
Posts: 43081
77
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Here's a hint: A property called "websso" is never checked by the Ant script.
Anjali S Sharma
Ranch Hand
Posts: 279
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks for replying.
I did this as well
<target name="websso.is.true" if="${websso}">
but still same result
Thank you
Ulf Dittmer
Rancher
Posts: 43081
77
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Have you verified that the properties file is correctly included by outputting the value of "websso"?
Anjali S Sharma
Ranch Hand
Posts: 279
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
thanks a lot.
That was precisely the problem
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Ant build fail, sometimes 'cause ant forgets property
ANT: update JAR file
ant exception
Building a war in eclipse using ant
Rename a file while adding to a JAR
More...