git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1027000 13f79535-47bb-0310-9956-ffa450edef68master
@@ -164,7 +164,10 @@ Fixed bugs: | |||||
* <signjar> would fail if used via its Java API and the File passed | * <signjar> would fail if used via its Java API and the File passed | ||||
into the setJar method was not "normalized" (i.e. contained ".." | into the setJar method was not "normalized" (i.e. contained ".." | ||||
segments). | segments). | ||||
Bugzilla Report 50081 | |||||
Bugzilla Report 50081. | |||||
* <delete> ignored <fileset>'s errorOnMissingDir attribute | |||||
Bugzilla Report 50124. | |||||
Other changes: | Other changes: | ||||
-------------- | -------------- | ||||
@@ -603,6 +603,10 @@ public class Delete extends MatchingTask { | |||||
fs.setProject(getProject()); | fs.setProject(getProject()); | ||||
} | } | ||||
final File fsDir = fs.getDir(); | final File fsDir = fs.getDir(); | ||||
if (!fs.getErrorOnMissingDir() && | |||||
(fsDir == null || !fsDir.exists())) { | |||||
continue; | |||||
} | |||||
if (fsDir == null) { | if (fsDir == null) { | ||||
throw new BuildException( | throw new BuildException( | ||||
"File or Resource without directory or file specified"); | "File or Resource without directory or file specified"); | ||||
@@ -443,6 +443,15 @@ public abstract class AbstractFileSet extends DataType | |||||
this.errorOnMissingDir = errorOnMissingDir; | this.errorOnMissingDir = errorOnMissingDir; | ||||
} | } | ||||
/** | |||||
* Gets whether an error is/shold be thrown if the base directory | |||||
* does not exist. | |||||
* @since Ant 1.8.2 | |||||
*/ | |||||
public boolean getErrorOnMissingDir() { | |||||
return errorOnMissingDir; | |||||
} | |||||
/** | /** | ||||
* Returns the directory scanner needed to access the files to process. | * Returns the directory scanner needed to access the files to process. | ||||
* @return a <code>DirectoryScanner</code> instance. | * @return a <code>DirectoryScanner</code> instance. | ||||
@@ -131,4 +131,11 @@ | |||||
</delete> | </delete> | ||||
<au:assertFileDoesntExist file="${input}/images/foo.jpg"/> | <au:assertFileDoesntExist file="${input}/images/foo.jpg"/> | ||||
</target> | </target> | ||||
<target name="testFilesetWithMissingButIgnoredDir" | |||||
description="https://issues.apache.org/bugzilla/show_bug.cgi?id=50124"> | |||||
<delete> | |||||
<fileset dir="${input}/not-there" errorOnMissingDir="false"/> | |||||
</delete> | |||||
</target> | |||||
</project> | </project> |