You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2000/10/12 17:18:01 UTC

Re: Javac and includesfile

I'm going to guess you have fewer files that should be excluded than you
do the list of files to include -- so use excludesfile's to list those,
and just use the ** wildcard for the package. So, your <javac> task looks
something like (plus whatever other attributes):
<javac srcdir="${src} destdir="${build}
   includes="${com.dir}/thispackage/**"
   excludesfile="${this.dir}/excludes.txt"/>

You'd still need to list files in the excludes file with
COM/foo/thispackage/NotReady.java, but since you'd (probably, I'm
assuming) have fewer files (and you can always wildcard where possible
there as well), it shouldn't be that big of a deal.

Diane

--- Dan Smith <da...@globalone.net> wrote:

<HR>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Is there a way to specify the package for files once in an include
file?&nbsp;
Here is why I ask:
<p>&nbsp;&nbsp;&nbsp; We have many build.xml files, one for each
package.&nbsp;
I did this so people could compile from any subdirectory, not only the
root directory.&nbsp; In order to allow for files that are not yet 'ready
for primetime', I used the includesfiles tag.&nbsp; The only problem (and
it is more of an inconvenience than anything), is that each file needs
to have the full package path. &nbsp;For example:
<p>&nbsp;&nbsp;&nbsp; Contents of 'javafiles.dat'
<p>com/mycompany/myproject/common/File1.java
<br>com/mycompany/myproject/common/File2.java
<br>com/mycompany/myproject/common/File3.java
<p>&nbsp;&nbsp;&nbsp; Contents of build.xml:
<br>...
<br>&lt;javac srcdir="/home/mydir/src/myproject"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
includesfile="javafiles.dat"
<br>....
<p>It would be nice to specify the 'include' directory once.&nbsp; If I
specify the full path in the 'srcdir' tag (i.e.
srcdir="/home/mydir/src/myproject/com/mycompany/myproject/common"),
then those files are compiled everytime I run ant because ant expects the
srcdir to be the project root.
<p>Any suggestions?
<p>Thanks
<br>Dan
<pre>--&nbsp;
"Sometimes I wish I could be you, just so I could be friends with me."
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-- Agelica Pickles</pre>
&nbsp;</html>



=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/