On 04/10/2002 11:59:50 PM, "Conor MacNeill" wrote:
> Javac compiler will handle this issue. If a class, which is required,
> does not yet exist, javac will attempt to find a source file by looking
> at the source path.

After digging into the various options including <depend>, it does
seem like javac should be magically taking care of this.  Here are a
few snippets of build.xml (BTW, I couldn't find a good example in the
Ant manual...some simple generic build.xml should probably be in there
and you're welcome to use the one I have below if there aren't any
problems with it) and the results from debug/compile:

=========build.xml:
<project name="TransMedia" default="compile" basedir=".">
      <property name="app.name"   value="transmedia" />
      <property name="build.dir"  value="build/classes" />
      <property name="jar.dir"  value="build/lib" />

      <target name="compile">
          <mkdir dir="${build.dir}"/>
          <javac srcdir="src/" destdir="${build.dir}" >
              <include name="**/*.java"/>
              <classpath>
                  <pathelement path="${classpath}"/>
                  <fileset dir="lib">
                      <include name="**/*.jar"/>
                  </fileset>
              </classpath>
          </javac>
      </target>

      <target name="jar" depends="compile">
          <mkdir dir="${jar.dir}"/>
          <jar jarfile="${jar.dir}/${app.name}.jar"
               basedir="${build.dir}" includes="**/*"/>
      </target>

      <target name="clean">
          <delete dir="build"/>
      </target>

</project>

========== relevant ant -debug info:
    [javac] Files to be compiled:
    F:\work\Transcend\TransMedia2\src\AbstractTreeModel.java
    F:\work\Transcend\TransMedia2\src\BrowserSplitPane.java
    F:\work\Transcend\TransMedia2\src\com\transcend\utils\FileManager.java
    F:
\work\Transcend\TransMedia2\src\com\transcend\utils\MultiContentSender.jav
a
    F:
\work\Transcend\TransMedia2\src\com\transcend\utils\ProgressListener.java
    F:
\work\Transcend\TransMedia2\src\com\vistech\events\ImageLoadedEvent.java

===========javac error:
    [javac] F:
\work\Transcend\TransMedia2\src\com\transcend\utils\MultiContentSe
nder.java:186: cannot resolve symbol
    [javac] symbol  : class ProgressListener
    [javac] location: class MultiContentSender
    [javac]                                     private ProgressListener
listene

===========

The ProgressListener Interface is in ProgressListener.java in the
same directory (com/transcend/utils) as MultiContentSender.java.
The only thing I could think of is javac isn't including "." in the
sourcepath, but couldn't see a way of setting it (only the javadoc
tag in build.xml has a sourcepath value).


 ken



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to