Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Up-to-date checks with macros

 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18168
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just use XDoclet myself. Dunno if that would work for you or not.
 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic