You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Michael Quinn <mi...@onaustralia.com.au> on 2001/08/18 05:40:23 UTC
Fw: javac fails inside ANT Compilation of dependent files -
Environment
ANT : 1.3
JDK : 1.3
NT4 SP6
Cygwin
Help
I have a scenario where javac behaves as expected OUTSIDE ant, but
when launched by ANT (javac task), I get a failure
If classA, depends on ClassB, but ClassB exists only as a .java file, then
wheh classA is compiled, the javac will automatically compile the ClassB
file, if the .java version is available on the classpath
My structure is as follows
_____ e:\Testing _____
| |
Proj1 Proj2
| |
com com
| |
a c
| |
b e
| |
class1 class2
(uses class2)
Classpath has Testing/proj2 in it, but if I build class1 outside ANT, using
-classpath in
javac, it works file, ie class2.class is built and then class1.class
BUT if I build inside ANT, the javac fails to find the class2.java, but if
the class2.class file
exists, then all is fine ?? what gives ??
Heres the build.xml
<?xml version="1.0"?>
<project name = "Build Common-OFX"
default = "main"
basedir = "." >
<property name = "src.dir" value = "e:\\testing\\prj1" />
<property name = "java.dir" value = "${src.dir}" />
<property name = "lib.dir" value = "lib" />
<property name = "docs.dir" value = "docs" />
<!--
===================================================================
Set the properties for the build area, this comes from the template
and is common for ALL components.
===================================================================
-->
<property name = "build.dir" value = "build" />
<property name = "build.classes" value = "${build.dir}/classes" />
<property name = "build.lib" value = "${build.dir}/lib" />
<property name = "build.javadocs" value = "${build.dir}/javadocs" />
<property name = "build.tests" value = "${build.dir}/testcases" />
<property name = "dist" value = "${build.dir}/dist" />
<!-- define the classpath needed to build here -->
<property name = "localclassPath"
value = "e:\\testing\\prj2" />
<property name = "thesrc.src"
value = "com/a/b/class1.java" />
<target name = "build">
<javac srcdir="${java.dir}"
includes="${thesrc.src}"
verbose="yes"
classpath="${localclassPath}"
/>
</target>
</project>
please help
cheers Michael Quinn