I have several external jars that are located relative to a
directory specified by an environment variable $MYPROJECT. I need
to construct a classpath within my build.xml so that javac can
compile my project. I do not want to include the external jars in
my project - just reference them. It seemed pretty straightforward
but I can't seem to get it to work under XCode. I have had some
success from the Terminal though. What's the recommended way to do
this?
and then used classpathref="myclasspath" in the javac task but that
didn't work either. I also tried using FileSets.
What am I missing?
SYSTEM/VERSION INFO
Mac OS X Intel 10.4.7 and XCode 2.3
% ant -version
Apache Ant version 1.6.5 compiled on April 11 2006
% uname -a
Darwin localhost 8.7.1 Darwin Kernel Version 8.7.1: Wed Jun 7
16:19:56 PDT 2006; root:xnu-792.9.72.obj~2/RELEASE_I386 i386 i386
I can't address the mix of XCode and Ant, but I do have some Ant
stuff that uses environment variables. In every one of those
build.xml files, I have an early entry like:
<property environment="env"/>
And then at various other points as needed I have:
That allows me to use "propname" where needed, in this case as a
directory location. Since you specifically asked about using jar
files from such a location, I might suggest using a <fileset> as part
of your classpath build. In some of my project files, I have some
that specifically designate all jar directories in a given directory
using *.jar. You might do something like: