go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Example -- check to see if certain files are present?
 
Subject: Example -- check to see if certain files are present?
Author: ant
In response to: Ant -- Condition Task
Posted on: 08/11/2010 06:06:25 PM

<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>



 

> On 08/11/2010 06:04:14 PM ant wrote:

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>






References:

 


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