ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <>
Subject Re: Skipping empty JARs
Date Mon, 07 Jan 2002 13:14:46 GMT wrote:
> Ant`s equivalent of jar -M is to not use <jar>, the only point of
> <jar> is that it adds a manifest and makes sure that there is one,
> there is nothing <jar> would do, that cannot be done using <zip>.

Thanks for info on <jar> vs. <zip>.  I'll be using <zip> in my build 
files, but I disagree with the design decision made here.  From a 
readability standpoint, it makes more sense for me to use the <jar> 
task since that's what I'm doing - creating jars, not zips.

It seems that the whenempty="skip" attribute should check two 
things: 1) is there a user-specified manifest and 2) are there any 
files that match?  If both of these fail, then the jar file should not 
be created.  If there is a user-specified manifest, the jar file 
should always be created - the reasoning being that 1) jar files 
always have at least a manifest, but 2) Ant shouldn't be creating 
something from nothing.

Perhaps the various actions for the whenempty attribute (skip, 
fail, create) should be modified for jars instead of disabled entirely.  
How they function is dependent on the existence of a manifest, 
and a distinction (in terms of functional behavior) exists 
between a  user-specified manifest and Ant's auto-generated 
manifest.  Consequently, we end up with an intelligent <jar> task.

I'm currently working on a modified <jar> task with these changes; 
unless others out there are strongly opposed to modifiying how 
the whenempty attribute functions, I'll post the patch when finished.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message