ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpfoe...@ThoughtWorks.com
Subject Re: Ant always rebuilds everything.
Date Wed, 05 Jul 2000 22:40:05 GMT

try this:

<javac srcdir="." includes="${isn.pkg}/*.java" ...
               ^            ^^^^^^^^^^^

The way you had it, Ant thought that the files belonged to the default
package, and was therefore looking for them in E:/ instead of
E:/com/srcvision/isn...

Matt Foemmel
ThoughtWorks, Inc.


                                                                                         
                                                    
                    "Joe                                                                 
                                                    
                    Planisky"            To:     ant-dev@jakarta.apache.org              
                                                    
                    <joep@srcvisi        cc:                                          
                                                       
                    on.com>              Subject:     Ant always rebuilds everything. 
                                                       
                                                                                         
                                                    
                    07/05/00                                                             
                                                    
                    05:29 PM                                                             
                                                    
                    Please                                                               
                                                    
                    respond to                                                           
                                                    
                    ant-dev                                                              
                                                    
                                                                                         
                                                    
                                                                                         
                                                    




Maybe a bug, maybe my ignorance (innocence?)  I'm using ant 3.1
and JDK1.2.2

I have several classes in package com.srcvision.isn.  My source
structure looks like this:

w:\Projects
     \mci
        \com
            \srcvision
                \isn
                    foo.java
                    bar.java

I want my classes to go into e:\, like this

e:\
    \com
        \srcvision
            \isn
                foo.class
                bar.class


Here's the relevant portion of my build file:

<project name="Mci" default="isn" basedir=".">

  <property name="isn.pkg" value="com/srcvision/isn"/>
  <property name="classes.dir" value="e:/"/>

  <target name="isn" >
    <javac srcdir="${isn.pkg}"
           includes="*.java"
           destdir="${classes.dir}"
           classpath="${classes.dir}"
           debug="on"
           deprecation="off"
           optimize="off" >
    </javac>
  </target>

I always start ant in w:\projects\mci.
I always get the message "Compiling 2 source files to E:\"
I thought the whole point of ant was to only rebuild what was out of
date (like make).

In looking at the ant source (javac.java, method scanDir(...)), it
appears that the source and destination file names are derived by
simply prepending the srcdir and destdir properties onto the
filename, which doesn't take into account the package name for
the destination files.

So is there a way around this or is it a bug?

-Joe P





Mime
View raw message