wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Incremental compile with RAD's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Incremental compile with RAD Watch "Incremental compile with RAD New topic
Author

Incremental compile with RAD's "workspaceBuild" ant task

pepe lotas
Greenhorn

Joined: Feb 20, 2009
Posts: 10
Hi everyone!!

I am using the ant task "workspaceBuild" that is included with the IBM RAD 7.5

I have no problems with it, it compiles ok.

But, now, if I have compiled a workspace I imported using a PSF file, and then I delete some ".java" source files on some of the projects from that PSF file, the ".class" files created in the previous compilation do not get deleted, so when I create the ".EAR" with de EARExport, this old files get in the ".EAR" file.

Could I do anything in order to avoid this? I mean, using the incremental compilation. I could delete all the ".class" compiled classes and compile everything over, but I just want to do an incremental compilation, because my application has a lot of eclipse projects with a lot of java classes.

How do I know that some ".java" files have been deleted, and how do I delete their corresponding ".class" files?
Is there a task to do so?

Thanks a lot in advance!!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

, the ".class" files created in the previous compilation do not get deleted,

There should be a 'clean' target that does this.

Or wait a minute, are you writing your own Ant script? If so, then it is up to you to provide a "clean" target that removes the old generated artifacts.


JBoss In Action
pepe lotas
Greenhorn

Joined: Feb 20, 2009
Posts: 10
Hi Peter, thanks for you answer!!

The RAD additional tasks provide some nice tasks to do things eclipse does automatically, but it does not provide a "clean" task like eclipse does when you go to the "project" menu and click on clean, and I think it should, but it does not

Here are the additional tasks provided:
http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.j2eeapp.doc/topics/tantcapturebuildmessages.html

Not having this task means that I have to delete all the ".class" and compile everything each time I compile, or I have to implement an ANT script that looks for all the ".class" associated to its ".java" files, and delete those old ".class" files with no association to a ".java" file...

The second proposal might take longer than first one, so I should do a deletion of everything and then perform a full compile?

How does the eclipse "clean" work? How could I implement something alike? Or does the eclipse delete the ".class" file associated to a ".java" file as soon as you delete the ".java" file and then recompile?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Incremental compile with RAD's "workspaceBuild" ant task
 
Similar Threads
Trouble launching ant exec task
ant javac task not copying directory with no java files
use a specific jvm with ant
Problem with JspC taskdef
Eclipse and Ant