ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Goldstein <>
Subject RE: compiling current directory
Date Fri, 28 Dec 2001 23:28:20 GMT
This means the srcdir shouldn't contain the relative path of the package.

So, for instance, in the your source is in C:\src and the file you want to 
compile is C:\src\com\foo\, you should have

<javac srcdir="C:\src\com\foo" destdir="${build}"/>

Instead, you need something like

<javac srcdir="c:\src" destdir="${build}" include="com\foo\" />

(Note: I haven't tested this, but it should give you the general idea.)


>===== Original Message From "Ant Users List" <> 
>I am trying to set up a target that will compile the directory I ran ant
>from along with any subdirectories.  For instance if c:\dev is in my
>classpath and I am in the c:\dev\foo directory, I want to compile all of
>the .java files in foo and all of it's subdirectories.
><target name="compile">
>  <property name="src" value="${user.dir}"/>
>  <!-- ${dev_dir} is set up on the command line.  It will be c:\dev in this
>  <property name="build" value="${dev_dir}"/>
>  <javac srcdir="${src}" destdir="${build}"/>
>This works, but it always compiles ALL of the files instead of just the
>ones that changed.
>The ant documentation for the javac task states:
>Note: If you wish to compile only source-files located in some packages
>below a common root you should not include these packages in the
>srcdir-attribute. Use include/exclude-attributes or elements to filter for
>these packages. If you include part of your package-structure inside the
>srcdir-attribute (or nested src-elements) Ant will start to recompile your
>sources every time you call it.
>but, I can't seem to figure out what the documentation is talking about.
>Can someone please point me in the right direction?
>Using ant 1.4.1 and jdk 1.3.0
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>
<INPUT NAME="AttachmentList" TYPE="hidden" VALUE=""><INPUT 
NAME="AttachmentNameList" TYPE="hidden" VALUE="">
<a href=""><IMG 
SRC="/ads/ad18.gif" alt="Ilink - multiple users" width=468 height=60 
<HR><CENTER><img src="/ssl-lock.gif" alt="SSL" border=0>&nbsp;Secure
active.  Click <a 
href="">here</a> to return to 
regular mode.</CENTER>
Powered by <a href="">Infinite InterChange 
(WebMail Interface) v3.62</a> -- &copy; Copyright 1995-2001 by <a 

"Just a mirror for the sun...
 My smiling eyes are just a mirror for the sun."

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message