ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Con Hennessy <>
Subject setting classpath in a build.xml file
Date Mon, 11 Aug 2003 16:33:28 GMT
	I've just started using ANT so please be kind to my stupid questions :)

During the build I'm trying to test to see if a supplied environment 
variable is valid. I know it is valid if a a class can be found in a
related jar found in a subdirectory called classes.

So I'm trying to do this with the following :

<target name="init">
   <!-- here I'm setting up my class path to test it -->
   <path id="ooo.classpath">
     <fileset dir="${env.OOO_PATH}/classes">
       <include name="**/*.jar"/>
     <pathelement location="classes"/>
   <!-- Ant does not seem to like this! -->
     <pathelement path="${classpath}"/>
     <path refid="ooo.classpath"/>
   <!-- is this the correct way to do such a test ? -->
   <condition property="no_ooo_path">
       <not><available classname="">
   <echo message="OOO_PATH is set to : ${env.OOO_PATH}"/>
   <!-- report a problem if the no_ooo_path property has been set! -->
   <fail if="no_ooo_path"
       message="you need to specify the environment variable
       OOO_PATH to point to the OpenOffice/program directory"/>

You'll see from the comments above that I have some problems.
But is  this the correct way to do this ?
What I'd also like is to have my classpath setup at the toplevel so that 
it will automatically be setup for all targets.

Thanks for any help,
Con Hennessy

P.S. Please CC: me as I am not subscribed.

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

View raw message