From 9bead93cc5697dc7384ef93abd88f8239bf171b7 Mon Sep 17 00:00:00 2001
From: Peter Reilly
Evaluate a condition based on a script in any Apache BSF -supported language.
+ or + JSR 223 +supported language. +See the Script task for an explanation of scripts and dependencies. diff --git a/docs/manual/CoreTypes/filterchain.html b/docs/manual/CoreTypes/filterchain.html index e2a99da22..29a86134e 100644 --- a/docs/manual/CoreTypes/filterchain.html +++ b/docs/manual/CoreTypes/filterchain.html @@ -1356,6 +1356,8 @@ Delete tabs from lines, trim the lines and removes empty lines.
This is an optional filter that executes a script in a Apache BSF + or + JSR 223 supported language. See the Script task for an explanation of scripts and dependencies. @@ -1377,9 +1379,18 @@ This filter may be used directly within a filterchain.
+ This filter can take a nested <classpath> element. + See the script task + on how to use this element. +
<uptodate>
and <junit>
output.
This mapper executes a script written in Apache BSF +or + JSR 223 supported language, once per file to map.
The script can be declared inline or in a specified file. @@ -728,6 +730,15 @@ an explanation of scripts and dependencies.+ This filename mapper can take a nested <classpath> element. + See the script task + on how to use this element. +
-Example + Example:
<scriptmapper language="javascript"> diff --git a/docs/manual/CoreTypes/selectors.html b/docs/manual/CoreTypes/selectors.html index 70b7ab067..6d5a11744 100755 --- a/docs/manual/CoreTypes/selectors.html +++ b/docs/manual/CoreTypes/selectors.html @@ -87,7 +87,8 @@ they are signed, and optionally if they have a signature of a certain name.@@ -976,6 +977,8 @@ The <scriptselector>
- - Use a BSF scripting language to create your own selector + Use a BSF or JSR 223 scripting language to create + your own selector<scriptselector>
element enables you to write a complex selection algorithm in any Apache BSF + or + JSR 223 supported language. See the Script task for an explanation of scripts and dependencies. @@ -994,12 +997,45 @@language of the script. yes ++ manager ++ The script engine manager to use. + See the script task + for using this attribute. + +No - default is "auto" ++ src filename of the script no + +setbeans +whether to have all properties, references and targets as + global variables in the script. +No, default is "true". ++ +classpath ++ The classpath to pass into the script. + +No ++ +classpathref +The classpath to use, given as a + reference to a path defined elsewhere. + No ++ This selector can take a nested <classpath> element. + See the script task + on how to use this element. +
If no
src
attribute is supplied, the script must be nested inside the selector declaration. diff --git a/docs/manual/OptionalTasks/scriptdef.html b/docs/manual/OptionalTasks/scriptdef.html index 77ef56f37..58334fbf2 100755 --- a/docs/manual/OptionalTasks/scriptdef.html +++ b/docs/manual/OptionalTasks/scriptdef.html @@ -28,7 +28,10 @@Description
Scriptdef can be used to define an Ant task using a scripting language. Ant scripting languages supported by -Apache BSF may be +Apache BSF +or + JSR 223 +may be used to define the script. Scriptdef provides a mechanism to encapsulate control logic from a build within an Ant task minimizing the need for providing control style tasks in Ant itself. Complex logic can be made @@ -95,9 +98,18 @@ more information on writing scripts, please refer to the
+ language The programming language the script is written in. - Must be a supported Apache BSF language + Must be a supported Apache BSF or JSR 223 languageYes + manager ++ The script engine manager to use. + See the script task + for using this attribute. + +No - default is "auto" +- + src The location of the script as a file, if not inline @@ -110,7 +122,29 @@ more information on writing scripts, please refer to theNo + +classpath ++ The classpath to pass into the script. + +No ++ +classpathref +The classpath to use, given as a + reference to a path defined elsewhere. + No ++ +loaderRef +the name of the loader that is + used to load the script, constructed from the specified + classpath. This allows multiple script defintions + to reuse the same class loader. + +No +Nested elements
attribute
@@ -158,7 +192,11 @@ more information on writing scripts, please refer to the - +classpath
++ See the script task + for using this nested element. +
Examples
@@ -236,7 +274,7 @@ Script errors are only detected when a script task is actually executed.- <target name="echo-task-jython"> +<target name="echo-task-jython"> <scriptdef language="jython" name="echo" uri="http://example.org/script"> @@ -252,6 +290,26 @@ self.log("text: " +self.text) </target>+The next example shows the use of <classpath> and +"loaderref" to get access to the beanshell jar. ++ <scriptdef name="b1" language="beanshell" + loaderref="beanshell-ref"> + <attribute name="a"/> + <classpath + path="${user.home}/scripting/beanshell/bsh-1.3b1.jar"/> + self.log("attribute a is " + attributes.get("a")); + </scriptdef> + + <scriptdef name="b2" language="beanshell" + loaderref="beanshell-ref"> + <attribute name="a2"/> + self.log("attribute a2 is " + attributes.get("a2")); + </scriptdef> + + <b1 a="this is an 'a'"/> + <b2 a2="this is an 'a2' for b2"/> +Testing Scripts