ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Toomey <toome...@yahoo.com>
Subject Problem with javac task using -sourcepath
Date Thu, 06 Jul 2000 15:05:04 GMT
I've run into a problem using the javac task and the
way it creates the -sourcepath parameter. I've just
started using Ant (which is great, by the way), so the
problem could very well be mine :p. Any help would be
greatly appreciated.

The javac task passes the srcdir attribute as the
-sourcepath. If the -sourcepath attribute is passed to
sun.tools.javac.Main, only the -sourcepath is searched
for source files during compilation as opposed to the
classpath. 

So if my directory structure looks like this:

\test
  \classes
     \testa
     \testb
  \java
     \testa
        classa.java (package testa)
     \testb
        classb.java (package testb)

and classa.java contains:

package testa;
import testb.classb;

public class classa {

	classb bb;

	public classa(){
		bb = new classb();
	}
}

and my build.xml looks like:

<?xml version="1.0"?>

<project name="foo" default="all" base="/test">
  <target name="init">
    <property name="in" value="${base}/java" />
    <property name="out" value="${base}/classes" />
  </target>
  <target name="all" depends="init"> 
    <javac srcdir="${in}/testa" destdir="${out}"/>
  </target>
</project>

the build fails, because only /test/java/testa is
searched, for classb.java. 


Am I missing something?

Thanks for any help,

Kevin

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Mime
View raw message