summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Bodewig <bodewig@apache.org>2022-08-24 12:38:33 +0200
committerStefan Bodewig <bodewig@apache.org>2022-08-24 12:38:33 +0200
commit39c9b0c9384da0e1b7d31a54d96a48c2d7df380b (patch)
tree45c6f338003741d7187283a927d59225446a2dae /src
parent52fa955239c00ae00f03354a2c6145730325a5f2 (diff)
downloadant-39c9b0c9384da0e1b7d31a54d96a48c2d7df380b.tar.gz
create manifest file's parent if needed.
Bugzilla Report 66231
Diffstat (limited to 'src')
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/ManifestTask.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/org/apache/tools/ant/taskdefs/ManifestTask.java b/src/main/org/apache/tools/ant/taskdefs/ManifestTask.java
index 2345b3137..f344a6b29 100644
--- a/src/main/org/apache/tools/ant/taskdefs/ManifestTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/ManifestTask.java
@@ -238,6 +238,14 @@ public class ManifestTask extends Task {
error = new BuildException("Failed to read " + manifestFile,
e, getLocation());
}
+ } else {
+ final File parent = manifestFile.getParentFile();
+ if (parent != null && !parent.isDirectory()
+ && !(parent.mkdirs() || parent.isDirectory())) {
+ throw new BuildException(
+ "Failed to create missing parent directory for %s",
+ manifestFile);
+ }
}
// look for and print warnings