antoine 2003/04/22 16:16:30
Modified: src/main/org/apache/tools/ant/types ZipFileSet.java src/etc/testcases/taskdefs war.xml Log: avoid backward compatibility problems for lib attribute of war task, so relax ZipFileSet#getRef Revision Changes Path 1.17 +11 -10 ant/src/main/org/apache/tools/ant/types/ZipFileSet.java Index: ZipFileSet.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/ZipFileSet.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ZipFileSet.java 18 Apr 2003 22:02:59 -0000 1.16 +++ ZipFileSet.java 22 Apr 2003 23:16:30 -0000 1.17 @@ -234,8 +234,8 @@ } /** - * A 3 digit octal string, specify the user, group and - * other modes in the standard Unix fashion; + * A 3 digit octal string, specify the user, group and + * other modes in the standard Unix fashion; * optional, default=0644 * * @since Ant 1.5.2 @@ -247,7 +247,7 @@ this.fileMode = UnixStat.FILE_FLAG | Integer.parseInt(octalString, 8); } - + /** * @since Ant 1.5.2 */ @@ -257,10 +257,10 @@ } return fileMode; } - + /** - * A 3 digit octal string, specify the user, group and - * other modes in the standard Unix fashion; + * A 3 digit octal string, specify the user, group and + * other modes in the standard Unix fashion; * optional, default=0755 * * @since Ant 1.6 @@ -272,7 +272,7 @@ this.dirMode = UnixStat.DIR_FLAG | Integer.parseInt(octalString, 8); } - + /** * @since Ant 1.6 */ @@ -284,7 +284,8 @@ } /** - * A ZipFileset accepts only another ZipFileSet as reference + * A ZipFileset accepts another ZipFileSet or a FileSet as reference + * FileSets are often used by the war task for the lib attribute */ protected AbstractFileSet getRef(Project p) { if (!isChecked()) { @@ -294,8 +295,8 @@ } Object o = getRefid().getReferencedObject(p); - if (!(o instanceof ZipFileSet)) { - String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset"; + if (!(o instanceof ZipFileSet) && !(o instanceof FileSet)) { + String msg = getRefid().getRefId() + " doesn\'t denote a zipfileset or a fileset"; throw new BuildException(msg); } else { return (AbstractFileSet) o; 1.3 +1 -1 ant/src/etc/testcases/taskdefs/war.xml Index: war.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/war.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- war.xml 19 Apr 2003 17:10:26 -0000 1.2 +++ war.xml 22 Apr 2003 23:16:30 -0000 1.3 @@ -12,7 +12,7 @@ </target> <target name="testlibrefs" depends="setup"> - <zipfileset id="test" dir="." includes="foobar"/> + <fileset id="test" dir="." includes="foobar"/> <war webxml="war.xml" destfile="${working.dir}/test.war"> <lib refid="test"/> </war>