The target will be executed regardless of condition being true or false. Inside the target, I need to check the condition and act accordingly
Main Topics
Browse All TopicsIn an ANT target, I need to specify a condition. If "websso" property is true then copy file "a.txt" else copy file "b.txt".
I checked here
http://ant.apache.org/manu
but could not find if/else condition
<target name="copyCustom" depends="makedir" description="Copy Custom " >
<condition property="${websso}">
</condition>
</target>
The properties file will have the following condition
websso=true
Please let me know how to specify if/else condition?
thank you
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you have not already got the solution, you can refer advanced topics section here
http://supportweb.cs.b
So in the properties file, I have
websso=true
In ANT script I have
<target name="copyCustom" depends="makedir" description="Copy Custom " >
<condition property="is.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}
update="true" />
</target>
<target name="websso.is.false" unless="is.websso">
<echo>websso == FALSE</echo>
<jar jarfile="${cvs.module.lib}
basedir="com/documentum/we
update="true" />
</target>
But the result, I always get as
makedir:
[mkdir] Created dir: C:\cvs_repo\Documentum\web
[mkdir] Created dir: C:\cvs_repo\Documentum\web
copyCustom:
websso.is.true:
websso.is.false:
[echo] websso == FALSE
Business Accounts
Answer for Membership
by: a_bPosted on 2009-10-07 at 00:21:50ID: 25512796
use the unless keyword
target name="copyCustom" depends="makedir" description="Copy Custom " unless=??>