diff options
author | Stefan Bodewig <bodewig@apache.org> | 2022-08-24 12:38:33 +0200 |
---|---|---|
committer | Stefan Bodewig <bodewig@apache.org> | 2022-08-24 12:38:33 +0200 |
commit | 39c9b0c9384da0e1b7d31a54d96a48c2d7df380b (patch) | |
tree | 45c6f338003741d7187283a927d59225446a2dae | |
parent | 52fa955239c00ae00f03354a2c6145730325a5f2 (diff) | |
download | ant-39c9b0c9384da0e1b7d31a54d96a48c2d7df380b.tar.gz |
create manifest file's parent if needed.
Bugzilla Report 66231
-rw-r--r-- | WHATSNEW | 4 | ||||
-rw-r--r-- | src/main/org/apache/tools/ant/taskdefs/ManifestTask.java | 8 |
2 files changed, 12 insertions, 0 deletions
@@ -59,6 +59,10 @@ Other changes: performance in some special cases. Bugzilla Report 66048 + * <manifest> will now create the parent directory of the manifestFile + attribute if it doesn't exist. + Bugzilla Report 66231 + Changes from Ant 1.10.11 TO Ant 1.10.12 ======================================= 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 |