go to  ForumEasy.com   
JavaPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » Java Deploying » Ant -- Condition Task
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: Ant -- Condition Task
ant
member
offline   
 
posts: 20
joined: 04/19/2010
from: San Jose, CA
  posted on: 08/11/2010 06:04:14 PM    Edit  |   Quote  |   Report 
Ant -- Condition Task
If the condition holds true, the property value is set (true by default); otherwise, the property is not set. You can set the value to something other than the default by specifying the value attribute.

For example:
<condition property="operate_os" value="mac" else="unix">
    <and>
        <os family="mac"/>
        <not>
          <os family="unix"/>
         </not>
    </and>
</condition>


 Profile | Reply Points Earned: 0
ant
member
offline   
 
posts: 20
joined: 04/19/2010
from: San Jose, CA
  posted on: 08/11/2010 06:06:25 PM    Edit  |   Quote  |   Report 
Example -- check to see if certain files are present?
<target name="check_endorsed">
    <condition property="endorsed.exists">
      <and>
        <available file="${endorsed.dir}/xalan.jar"/>
        <available file="${endorsed.dir}/dom3-xml-apis-2.5.0.jar"/>
        <available file="${endorsed.dir}/dom3-xercesImpl-2.5.0.jar"/>
      </and>
    </condition>
    <fail unless="endorsed.exists">
      Your Java endorsed folder does not contain all the necessary jar files!
      Run the dist target and then copy all the jar files from dist/endorsed to:
      ${endorsed.dir}
    </fail>
</target>


 Profile | Reply Points Earned: 0

 
Powered by ForumEasy © 2003-2005, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.