stevel 02/01/06 22:20:56
Modified: src/main/org/apache/tools/ant/taskdefs Ear.java Jar.java
War.java Zip.java
Log:
Addition of destFile(File) attr to the zip/war/ear/jar tasks, fixup of docs,
replacement of deprecation methods and appropriate changes to the tests.
Revision Changes Path
1.6 +13 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ear.java
Index: Ear.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ear.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Ear.java 11 Dec 2001 14:55:45 -0000 1.5
+++ Ear.java 7 Jan 2002 06:20:56 -0000 1.6
@@ -79,11 +79,17 @@
emptyBehavior = "create";
}
+ /**
+ * @deprecated Use setDestFile(destfile) instead
+ */
public void setEarfile(File earFile) {
- log("DEPRECATED - The earfile attribute is deprecated. Use file
attribute instead.");
- setFile(earFile);
+ log("DEPRECATED - The earfile attribute is deprecated. Use destfile
attribute instead.");
+ setDestFile(earFile);
}
+ /**
+ * set the application XML file
+ */
public void setAppxml(File descr) {
deploymentDescriptor = descr;
if (!deploymentDescriptor.exists())
@@ -121,11 +127,11 @@
protected void zipFile(File file, ZipOutputStream zOut, String vPath)
throws IOException
{
- // If the file being added is WEB-INF/web.xml, we warn if it's not
the
- // one specified in the "webxml" attribute - or if it's being added
twice,
- // meaning the same file is specified by the "webxml" attribute and
in
+ // If the file being added is META-INF/application.xml, we warn if
it's not the
+ // one specified in the "appxml" attribute - or if it's being added
twice,
+ // meaning the same file is specified by the "appxml" attribute and
in
// a <fileset> element.
- if (vPath.equalsIgnoreCase("META-INF/aplication.xml")) {
+ if (vPath.equalsIgnoreCase("META-INF/application.xml")) {
if (deploymentDescriptor == null ||
!deploymentDescriptor.equals(file) || descriptorAdded) {
log("Warning: selected "+archiveType+" files include a
META-INF/application.xml which will be ignored " +
"(please use appxml attribute to "+archiveType+" task)",
Project.MSG_WARN);
@@ -139,7 +145,7 @@
}
/**
- * Make sure we don't think we already have a web.xml next time this task
+ * Make sure we don't think we already have a application.xml next time
this task
* gets executed.
*/
protected void cleanUp() {
1.31 +3 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
Index: Jar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Jar.java 12 Dec 2001 10:54:08 -0000 1.30
+++ Jar.java 7 Jan 2002 06:20:56 -0000 1.31
@@ -97,11 +97,11 @@
}
/**
- * @deprecated use setFile(File) instead.
+ * @deprecated Use setDestFile(File) instead
*/
public void setJarfile(File jarFile) {
- log("DEPRECATED - The jarfile attribute is deprecated. Use file
attribute instead.");
- setFile(jarFile);
+ log("DEPRECATED - The jarfile attribute is deprecated. Use destfile
attribute instead.");
+ setDestFile(jarFile);
}
/**
1.16 +8 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/War.java
Index: War.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/War.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- War.java 11 Dec 2001 14:55:45 -0000 1.15
+++ War.java 7 Jan 2002 06:20:56 -0000 1.16
@@ -79,11 +79,17 @@
emptyBehavior = "create";
}
+ /**
+ * @deprecated Use setDestFile(File) instead
+ */
public void setWarfile(File warFile) {
- log("DEPRECATED - The warfile attribute is deprecated. Use file
attribute instead.");
- setFile(warFile);
+ log("DEPRECATED - The warfile attribute is deprecated. Use destfile
attribute instead.");
+ setDestFile(warFile);
}
+ /**
+ * set the web app descriptor for this WAR file
+ */
public void setWebxml(File descr) {
deploymentDescriptor = descr;
if (!deploymentDescriptor.exists())
1.57 +21 -5
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
Index: Zip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- Zip.java 11 Dec 2001 14:55:45 -0000 1.56
+++ Zip.java 7 Jan 2002 06:20:56 -0000 1.57
@@ -120,22 +120,38 @@
* This is the name/location of where to
* create the .zip file.
*
- * @deprecated Use setFile() instead
+ * @deprecated Use setDestFile(File) instead
*/
public void setZipfile(File zipFile) {
- log("DEPRECATED - The zipfile attribute is deprecated. Use file
attribute instead.");
- setFile( zipFile );
+ log("DEPRECATED - The zipfile attribute is deprecated. Use destfile
attribute instead.");
+ setDestFile(zipFile);
}
/**
* This is the name/location of where to
* create the .zip file.
- *
+ * @since 1.5alpha
+ * @todo pull this before shipping 1.5
+ * @deprecated Use setDestFile(File) instead
*/
public void setFile(File file) {
- this.zipFile = file;
+ log("DEPRECATED - The file attribute has been renamed destfile."
+ +" This attribute will be unsupported before Ant1.5 is released",
+ Project.MSG_ERR);
+ setDestFile(file);
}
+
+ /**
+ * Sets the destfile attribute.
+ * @since 1.5
+ * @param destFile The new destination File
+ */
+ public void setDestFile(File destFile) {
+ this.zipFile = destFile;
+ }
+
+
/**
* This is the base directory to look in for
* things to zip.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>