From 18141ca0aa421a5e1c2be04a22fe70a331c0ad69 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Tue, 9 Jun 2009 15:48:29 +0000 Subject: [PATCH] really add setbeans attribute to scriptmapper/filter/condition. PR 47336 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@783050 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 4 ++++ docs/manual/CoreTasks/conditions.html | 2 +- docs/manual/CoreTypes/filterchain.html | 2 +- docs/manual/CoreTypes/mapper.html | 2 +- .../types/optional/AbstractScriptComponent.java | 15 +++++++++++++++ .../tools/ant/types/optional/ScriptFilter.java | 14 ++++++++++++++ 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 2744eb3f3..d7eb1d42c 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -375,6 +375,10 @@ Fixed bugs: filter ended with a begin token. Bugzilla Report 47306. + * , and didn't support + the setbeans attribute. + Bugzilla Report 47336. + Other changes: -------------- * A HostInfo task was added performing information on hosts, including info on diff --git a/docs/manual/CoreTasks/conditions.html b/docs/manual/CoreTasks/conditions.html index 3d89e74d2..4856dac38 100644 --- a/docs/manual/CoreTasks/conditions.html +++ b/docs/manual/CoreTasks/conditions.html @@ -513,7 +513,7 @@ an explanation of scripts and dependencies. setbeans whether to have all properties, references and targets as - global variables in the script. + global variables in the script. since Ant 1.8.0 No, default is "true". diff --git a/docs/manual/CoreTypes/filterchain.html b/docs/manual/CoreTypes/filterchain.html index 29a86134e..aa53f994c 100644 --- a/docs/manual/CoreTypes/filterchain.html +++ b/docs/manual/CoreTypes/filterchain.html @@ -1400,7 +1400,7 @@ Must be a supported Apache BSF or JSR 223 language setbeans whether to have all properties, references and targets as - global variables in the script. + global variables in the script. since Ant 1.8.0 No, default is "true". diff --git a/docs/manual/CoreTypes/mapper.html b/docs/manual/CoreTypes/mapper.html index dd9ca9387..14f4fbbe0 100644 --- a/docs/manual/CoreTypes/mapper.html +++ b/docs/manual/CoreTypes/mapper.html @@ -799,7 +799,7 @@ an explanation of scripts and dependencies. setbeans whether to have all properties, references and targets as - global variables in the script. + global variables in the script. since Ant 1.8.0 No, default is "true". diff --git a/src/main/org/apache/tools/ant/types/optional/AbstractScriptComponent.java b/src/main/org/apache/tools/ant/types/optional/AbstractScriptComponent.java index 025a57ea8..3e896e8bb 100644 --- a/src/main/org/apache/tools/ant/types/optional/AbstractScriptComponent.java +++ b/src/main/org/apache/tools/ant/types/optional/AbstractScriptComponent.java @@ -141,4 +141,19 @@ public abstract class AbstractScriptComponent extends ProjectComponent { protected void executeScript(String execName) { getRunner().executeScript(execName); } + + /** + * Set the setbeans attribute. + * If this is true, <script> will create variables in the + * script instance for all + * properties, targets and references of the current project. + * It this is false, only the project and self variables will + * be set. + * The default is true. + * @param setBeans the value to set. + * @since Ant 1.8.0 + */ + public void setSetBeans(boolean setBeans) { + helper.setSetBeans(setBeans); + } } diff --git a/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java b/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java index 27f748c10..113c0e4ec 100644 --- a/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java +++ b/src/main/org/apache/tools/ant/types/optional/ScriptFilter.java @@ -165,4 +165,18 @@ public class ScriptFilter extends TokenFilter.ChainableReaderFilter { helper.setClasspathRef(r); } + /** + * Set the setbeans attribute. + * If this is true, <script> will create variables in the + * script instance for all + * properties, targets and references of the current project. + * It this is false, only the project and self variables will + * be set. + * The default is true. + * @param setBeans the value to set. + * @since Ant 1.8.0 + */ + public void setSetBeans(boolean setBeans) { + helper.setSetBeans(setBeans); + } }