PR: 4448 This probably is not what the reporting user intended ... git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269886 13f79535-47bb-0310-9956-ffa450edef68master
@@ -24,6 +24,10 @@ Fixed bugs: | |||||
that only one test could be running at the same time - this is not | that only one test could be running at the same time - this is not | ||||
necessarily true, see junit.extensions.ActiveTestSuite. | necessarily true, see junit.extensions.ActiveTestSuite. | ||||
* <jar>'s whenEmpty attribute is useless as JARs are never empty, they | |||||
contain at least a manifest file, therefore it will now print a | |||||
warning and do nothing. | |||||
Other changes: | Other changes: | ||||
-------------- | -------------- | ||||
@@ -97,11 +97,6 @@ attributes of zipfilesets in a Zip or Jar task.)</p> | |||||
the destination file if it already exists.</td> | the destination file if it already exists.</td> | ||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">whenempty</td> | |||||
<td valign="top">Behavior to use if no files match.</td> | |||||
<td valign="top" align="center">No</td> | |||||
</tr> | |||||
</table> | </table> | ||||
<h3>Nested elements</h3> | <h3>Nested elements</h3> | ||||
<h4>metainf</h4> | <h4>metainf</h4> | ||||
@@ -38,10 +38,6 @@ JAR file already exists. When set to <code>yes</code>, the JAR file is | |||||
updated with the files specified. When set to <code>no</code> (the | updated with the files specified. When set to <code>no</code> (the | ||||
default) the JAR file is overwritten. An example use of this is | default) the JAR file is overwritten. An example use of this is | ||||
provided in the <a href="zip.html">Zip task documentation</a>.</p> | provided in the <a href="zip.html">Zip task documentation</a>.</p> | ||||
<p>The <code>whenempty</code> parameter controls what happens when no files match. | |||||
If <code>create</code> (the default), the JAR is created anyway with only a manifest. | |||||
If <code>skip</code>, the JAR is not created and a warning is issued. | |||||
If <code>fail</code>, the JAR is not created and the build is halted with an error.</p> | |||||
<p>(The Jar task is a shortcut for specifying the manifest file of a JAR file. | <p>(The Jar task is a shortcut for specifying the manifest file of a JAR file. | ||||
The same thing can be accomplished by using the <i>fullpath</i> | The same thing can be accomplished by using the <i>fullpath</i> | ||||
attribute of a zipfileset in a Zip task. The one difference is that if the | attribute of a zipfileset in a Zip task. The one difference is that if the | ||||
@@ -124,11 +120,6 @@ include an empty one for you.)</p> | |||||
the destination file if it already exists.</td> | the destination file if it already exists.</td> | ||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">whenempty</td> | |||||
<td valign="top">Behavior to use if no files match.</td> | |||||
<td valign="top" align="center">No</td> | |||||
</tr> | |||||
</table> | </table> | ||||
<h3>Nested elements</h3> | <h3>Nested elements</h3> | ||||
<h4>metainf</h4> | <h4>metainf</h4> | ||||
@@ -99,11 +99,6 @@ attributes of zipfilesets in a Zip or Jar task.)</p> | |||||
the destination file if it already exists.</td> | the destination file if it already exists.</td> | ||||
<td valign="top" align="center">No</td> | <td valign="top" align="center">No</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">whenempty</td> | |||||
<td valign="top">Behavior to use if no files match.</td> | |||||
<td valign="top" align="center">No</td> | |||||
</tr> | |||||
</table> | </table> | ||||
<h3>Nested elements</h3> | <h3>Nested elements</h3> | ||||
<h4>lib</h4> | <h4>lib</h4> | ||||
@@ -91,6 +91,11 @@ public class Jar extends Zip { | |||||
setEncoding("UTF8"); | setEncoding("UTF8"); | ||||
} | } | ||||
public void setWhenempty(WhenEmpty we) { | |||||
log("JARs are never empty, they contain at least a manifest file", | |||||
Project.MSG_WARN); | |||||
} | |||||
/** | /** | ||||
* @deprecated use setFile(File) instead. | * @deprecated use setFile(File) instead. | ||||
*/ | */ | ||||