ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ringo De Smet <>
Subject Defining paths AFTER defining properties?
Date Fri, 02 Mar 2001 14:49:01 GMT

When I start my build I first check if all the required Jar
files can be found on the build machine. I let Ant fail when
there are missing files.

<target name="init">
  <available property="junit.lib"


<target name="NoJUnit" depends="init" unless="junit.lib">
  <fail message="JUnit not found!"/>

<target name="compile" depends="NoJUnit">

I have a similar setup for other Jar files too. After checking
the required jar files, I would like to define paths that can be
used several times in other tasks, e.g.

<path id="build.classpath">
  <pathelement location="${junit.lib}/>
  <pathelement location="${log4j.lib}/>

<target name="compile" depends="NoJUnit">
  <javac src="." dest="build">
    <classpathref id="build.classpath">

However, the properties representing jar files are defined
through available in the init target. Since paths must be
defined outside targets, I can't create paths after init has
I can however define other properties that are the compound of
the value of other properties, but I think paths are nicer. Is
there a solution to my problem? (I hope my explanation is


Ringo De Smet
Email @ home:
Email @ work:

Do You Yahoo!?
Get your free address at
or your free address at

View raw message