ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anna Teittinen" <>
Subject Need help in build.xml file...
Date Sat, 27 Dec 2008 00:21:27 GMT

I am relatively new to using ant.
Can somebody help me with a problem I have in my build.xml file?
Below is a snippet of code from my build.xml file.
Below, "caratsharp.dir" refers to a directory.
Basically, if that directory exists, then the clean, prepare, jar, and copy_jar targets will
get called; otherwise, an error msg should be printed and nothing more happens.

When this build.xml is called when the "caratsharp.dir" directory exists, all the antcall
commands get done... great!
However, when I run this script when the "caratsharp.dir" directory does not exist, the error
msg does not get printed.

Does anyone have any insight to why the error msg ("${caratsharp.dir} does not exist") does
not get printed?

 <target name="checkForCaratSharpDir">
  <available property="present" file="${caratsharp.dir}" /> 
  <available property="isaDir" file="${caratsharp.dir}" type="dir" /> 
 <condition property="isaDir">
  <isset property="present" /> 
  <isset property="isaFile" /> 
 <target name="exists" depends="checkForCaratSharpDir" if="present">
  <echo message="${caratsharp.dir} exists" /> 
  <antcall target="clean" /> 
  <antcall target="prepare" /> 
  <antcall target="jar" /> 
  <antcall target="copy_jar" /> 
 <target name="printError" depends="checkForCaratSharpDir" if="isaFile">
  <echo message="${caratsharp.dir} does not exist" /> 
  <target name="all" depends="exists,printError" description="Cleans, compile then builds
the JAR file." /> 

Thanks so much in advance for your help,

This message and all attachments are PRIVATE, and contain information that
is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to
transmit or otherwise disclose this message or any attachments to any
third party whatsoever without the express written consent of Intelligent
Automation, Inc. If you received this message in error or you are not
willing to view this message or any attachments on a confidential basis,
please immediately delete this email and any attachments and notify
Intelligent Automation, Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message