wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Up-to-date checks with macros Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Up-to-date checks with macros" Watch "Up-to-date checks with macros" New topic

Up-to-date checks with macros

Greg Charles

Joined: Oct 01, 2001
Posts: 2840

I'm using Ant 1.6.5, and I've started experimenting with macrodefs to build our EJBs. Basically, we have 10 to 15 EJB jar files. All classes in a directory are put into a jar, and then the EJB compiler is run on the jar.

The macrodef for creating the jar file is fine. The jar task automatically checks the dependencies between the jar file and the files it contains. If the jar is out-of-date, it is recreated. The EJB compile is a problem though. It compiles the "naked" jar and outputs the ready-to-deploy EJB, but to Ant it just looks like a Java task. Therefore, I have to put in the dependency check myself and "antcall" to a target with something like unless="${this.jar}.uptodate". Using antcall defeats the purpose of having a macrodef, but I can't figure out any other way to do it. I could use an "if" task from ant-contrib, but the docs say that uses antcall behind the scenes anyway. Help!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960

I just use XDoclet myself. Dunno if that would work for you or not.

Customer surveys are for companies who didn't pay proper attention to begin with.
Greg Charles

Joined: Oct 01, 2001
Posts: 2840

I'm not sure. I thought the purpose of XDoclet was to generate deployment descriptors, and the various component and home interface classes. Are you saying that it can also perform the EJB compiles?
jQuery in Action, 2nd edition
subject: Up-to-date checks with macros
Similar Threads
ANT could not find class for <junit>
ANT failed Optional XMLValidate task
learning Ant
hierarchical ant scripts
Ant ftp task creating problem