You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Joe Planisky <jo...@srcvision.com> on 2000/07/06 00:29:52 UTC

Ant always rebuilds everything.

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


Re: Ant always rebuilds everything.

Posted by Vitaly Stulsky <vi...@yahoo.com>.
You're using improper srcdir.
Just point on w:\Projects\mci or ".", but better put your sources under some
kind
of "src" dir and point to it.

Vitaly

----- Original Message -----
From: Joe Planisky <jo...@srcvision.com>
To: <an...@jakarta.apache.org>
Sent: Wednesday, July 05, 2000 3:29 PM
Subject: Ant always rebuilds everything.


> 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


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com