ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Con Hennessy <Con.Henne...@propylon.com>
Subject setting classpath in a build.xml file
Date Mon, 11 Aug 2003 16:33:28 GMT
Hi,
	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"/>
     </fileset>
     <pathelement location="classes"/>
   </path>
   <!-- Ant does not seem to like this! -->
   <classpath>
     <pathelement path="${classpath}"/>
     <path refid="ooo.classpath"/>
   </classpath>
   <!-- is this the correct way to do such a test ? -->
   <condition property="no_ooo_path">
       <not><available classname="com.sun.star.beans.LocalOfficeConnect">
       </not>
   </condition>
   <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"/>
</target>

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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message