From e7c48c8f8677cd3dff58f3b836b41543f8e37032 Mon Sep 17 00:00:00 2001
From: Matt Benson
Date: Fri, 25 Feb 2022 18:48:19 -0600
Subject: [PATCH] local += nested name elements
---
manual/Tasks/local.html | 16 ++++++
.../org/apache/tools/ant/taskdefs/Local.java | 56 +++++++++++++++++--
src/tests/antunit/taskdefs/local-test.xml | 20 +++++++
3 files changed, 88 insertions(+), 4 deletions(-)
diff --git a/manual/Tasks/local.html b/manual/Tasks/local.html
index 830cc1858..2e64ec631 100644
--- a/manual/Tasks/local.html
+++ b/manual/Tasks/local.html
@@ -53,6 +53,12 @@ examples section.
+Parameters specified as nested elements
+Name
+As an alternative to (or in conjunction with) the name
attribute, the nested text of
+each of one or more nested <name>
elements specifies a property name to declare in
+the local scope.
+
Examples
Temporarily shadow a global property's value
@@ -171,5 +177,15 @@ come up with unique names in some cases.
Each invocation gets its own property named parent
and there will be no global
property of that name at all.
+Use of nested name elements
+This style declares and executes a single task, as compensation for requiring more lines of XML than
+would individual invocations using @name
:
+
+<local>
+ <name>foo</name>
+ <name>bar</name>
+ <name>baz</name>
+</local>
+