This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Javac-includesfile problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Javac-includesfile problem." Watch "Javac-includesfile problem." New topic
Author

Javac-includesfile problem.

Sudarsan Raman
Greenhorn

Joined: Aug 20, 2003
Posts: 12
Hi,

I need to compile java files in batches. For this I'm trying out this following example.

- I have a directory "code" which contains around 1071 java files
- I need the classes to get generated in "output" directory.
- I have a "javac.tmp" file that has only one line "myBean.java"
(This myBean.java is part of the "code" directory)

- I need to compile only this particular file.
- I want to use only includesfile and not includes attribute

The reason for not using includes is that the list of files that has to be compiled will grow (I don't know the limit includes, what if the the file list is around 500 ??). Includesfile is supposed to take just a filename and this file should contain list of files.

What I'm trying :

<project name ="project" default ="init" >
<target name="init" >
<echo>compiling</echo>
<javac srcdir="./code" destdir="./output" includes="*.java" includesfile="./javac.tmp" />
</target>
</project>

Output :

Buildfile: build.xml

init:
[echo] compiling
[javac] Compiling 1071 source files to /users7/e46011/javafile/output

Problem : It tries to compile all the files in the directory "code". Does the includesfile file require to have the filenames in some format (anything other than filenames on different lines) - Something like package name etc ??

Thanks,

Sudarsan.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I haven't used includesfile, but you problem is likely because you have also used includes="*.java". Remove that if you don't want *.java included.
hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

i am also facing the same problem.

none of the files are getting compiled.


SCJP, SCWCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Javac-includesfile problem.
 
Similar Threads
ant exception
Unable to compile java file through ant
Set Ant Classpath for Compile
package javax.ejb does not exist
HOW TO COMPILE JAVA FILES PROGAMMATICALLY