ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Goldstein <sdgol...@MailAndNews.com>
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\A.java, 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\A.java" />

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

Scott

>===== Original Message From "Ant Users List" <ant-user@jakarta.apache.org> 
=====
>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
>example.
>  <property name="build" value="${dev_dir}"/>
>
>  <javac srcdir="${src}" destdir="${build}"/>
></target>
>
>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?
>
>Thanks,
>Phil
>
>Using ant 1.4.1 and jdk 1.3.0
>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
</TEXTAREA>
</td>
</tr>
</table>
</table>
<INPUT NAME="AttachmentList" TYPE="hidden" VALUE=""><INPUT 
NAME="AttachmentNameList" TYPE="hidden" VALUE="">
</FORM>
</center>
<CENTER>
<a href="http://www.infinitemail.com/infinite/prods/ilink/ilink.html"><IMG 
SRC="/ads/ad18.gif" alt="Ilink - multiple users" width=468 height=60 
BORDER=1></a>
</CENTER>
<HR><CENTER><img src="/ssl-lock.gif" alt="SSL" border=0>&nbsp;Secure
mode 
active.  Click <a 
href="http://mailandnews.com/MBX/sdgoldst/ID=3C2DA350">here</a> to return to 
regular mode.</CENTER>
<!--
<HR>
<CENTER>
Powered by <a href="http://www.infinite.com/InterChange">Infinite InterChange 
(WebMail Interface) v3.62</a> -- &copy; Copyright 1995-2001 by <a 
href="http://www.infinite.com">Captaris</a>
</CENTER>
-->
</HTML>

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


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message