summaryrefslogtreecommitdiff
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
parent52fa955239c00ae00f03354a2c6145730325a5f2 (diff)
downloadant-39c9b0c9384da0e1b7d31a54d96a48c2d7df380b.tar.gz
create manifest file's parent if needed.
Bugzilla Report 66231
-rw-r--r--WHATSNEW4
-rw-r--r--src/main/org/apache/tools/ant/taskdefs/ManifestTask.java8
2 files changed, 12 insertions, 0 deletions
diff --git a/WHATSNEW b/WHATSNEW
index c0fe5ea7d..9872c70c4 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -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