If I specify an absolute classpath as below in the compile-test target and run
this on Win2000 I
see the path get translated to one relative to the project basedir and
subsequently thrown
out because it does not exist. The problem is that when the
Project.resolveFile(String)
only looks for the unix style absolute path:
Project.java:413 if (fileName.startsWith("/")) return new File( fileName
);
The Javac.compileClasspath value that is passed to Project.revolveFile(String)
from within
the Javac.addExistingToClasspath(StringBuffer ,String ) method is translated to
the native
OS path of "\usr\local\Java\packages" when the compileClasspath property was
set in
Javac.setClasspath(String).
Shouldn't java.io.File object be used in place of String paths to avoid having
to keep track
of what path delimiters are being used?
<target name="compile-test" depends="build">
<mkdir dir="${build.classes}"/>
<echo message="classpath=${classpath}" />
<javac srcdir="."
destdir="${build.classes}"
classpath="/usr/local/Java/packages:."
debug="on"
deprecation="off"
optimize="off"
excludes="*.jj,*.html"
includes="com/bear/racs/net/RFSnapDispatcher.java"
/>
</target>
bash-2.02$ ant.bat -verbose -f tstbuild.xml compile-test
...
Build sequence for target `compile-test' is [init, build, compile-test]
Complete build sequence is [init, build, compile-test]
Executing Target: init
Executing Target: build
Executing Target: compile-test
classpath=/usr/local/Java/packages:.
Compiling 1 source files to
D:\usr\local\src\scott_home_rips\packages\build\classes
Using classic compiler
Dropping from classpath:
D:\usr\local\src\scott_home_rips\packages\usr\local\Java\packages
Compilation args: [-d, D:\usr\local\src\scott_home_rips\packages\build\classes,
-classpath,
D:\usr\local\src\scott_home_rips\packages\build\classes;D:\usr\local\src\scott_home_rips\packages;D:\usr\local\Java\Ant\jakarta-ant\
build\classes;D:\usr\local\Java\Ant\jakarta-ant\dist\lib\xml.jar;D:\usr\local\Java\jdk1.2.2lib\tools.jar;D:\usr\local\Java\Ant\ant,
-sourcepath, D:\usr\local\src\scott_home_rips\packages, -g]
Files to be compiled:
D:\usr\local\src\scott_home_rips\packages\com\bear\racs\net\RFSnapDispatcher.java
D:\usr\local\src\scott_home_rips\packages\com\bear\racs\net\RFSnapDispatcher.java:7:
Class com.objectspace.jgl.BinaryPredicate not
found in import.
import com.objectspace.jgl.BinaryPredicate;
...
many more errors because of bad classpath...