You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/12/12 22:47:57 UTC
svn commit: r486341 - in /ant/core/trunk/docs/manual:
CoreTasks/conditions.html CoreTypes/filterchain.html CoreTypes/mapper.html
CoreTypes/selectors.html OptionalTasks/scriptdef.html
Author: peterreilly
Date: Tue Dec 12 13:47:56 2006
New Revision: 486341
URL: http://svn.apache.org/viewvc?view=rev&rev=486341
Log:
add some more doc for the scripting changes
Modified:
ant/core/trunk/docs/manual/CoreTasks/conditions.html
ant/core/trunk/docs/manual/CoreTypes/filterchain.html
ant/core/trunk/docs/manual/CoreTypes/mapper.html
ant/core/trunk/docs/manual/CoreTypes/selectors.html
ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html
Modified: ant/core/trunk/docs/manual/CoreTasks/conditions.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/conditions.html?view=diff&rev=486341&r1=486340&r2=486341
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/conditions.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/conditions.html Tue Dec 12 13:47:56 2006
@@ -469,7 +469,10 @@
<p>Evaluate a condition based on a script in any
<a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a>
-supported language.</p>
+ or
+ <a href="https://scripting.dev.java.net">JSR 223</a>
+supported language.
+</p>
<p>
See the <a href="../OptionalTasks/script.html">Script</a> task for
an explanation of scripts and dependencies.
Modified: ant/core/trunk/docs/manual/CoreTypes/filterchain.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/filterchain.html?view=diff&rev=486341&r1=486340&r2=486341
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/filterchain.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/filterchain.html Tue Dec 12 13:47:56 2006
@@ -1356,6 +1356,8 @@
<p><b><em><a name="scriptfilter">ScriptFilter</a></em></b></p>
This is an optional filter that executes a script in a
<a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a>
+ or
+ <a href="https://scripting.dev.java.net">JSR 223</a>
supported language.</p>
See the <a href="../OptionalTasks/script.html">Script</a> task for
an explanation of scripts and dependencies.
@@ -1377,18 +1379,49 @@
<tr>
<td vAlign=top>language</td>
<td vAlign=top> The programming language the script is written in.
-Must be a supported Apache BSF language</td>
+Must be a supported Apache BSF or JSR 223 language</td>
<td vAlign=top align="center">Yes</td>
</tr>
<tr>
+ <td valign="top">manager</td>
+ <td valign="top">
+ The script engine manager to use.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ for using this attribute.
+ </td>
+ <td valign="top" align="center">No - default is "auto"</td>
+ </tr>
+ <tr>
<td vAlign=top>src</td>
<td vAlign=top>The location of the script as a file, if not inline
</td>
<td vAlign=top align="center">No</td>
</tr>
<tr>
+ <td valign="top">setbeans</td>
+ <td valign="top">whether to have all properties, references and targets as
+ global variables in the script.</td>
+ <td valign="top" align="center">No, default is "true".</td>
+ </tr>
+ <tr>
+ <td valign="top">classpath</td>
+ <td valign="top">
+ The classpath to pass into the script.
+ </td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">classpathref</td>
+ <td valign="top">The classpath to use, given as a
+ <a href="../using.html#references">reference</a> to a path defined elsewhere.
+ <td align="center" valign="top">No</td>
+ </tr>
</table>
-
+ <p>
+ This filter can take a nested <classpath> element.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ on how to use this element.
+ </p>
<h4>Examples:</h4>
Convert to uppercase:
Modified: ant/core/trunk/docs/manual/CoreTypes/mapper.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/mapper.html?view=diff&rev=486341&r1=486340&r2=486341
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/mapper.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/mapper.html Tue Dec 12 13:47:56 2006
@@ -707,6 +707,8 @@
<h4><a name="script-mapper">scriptmapper (since Ant 1.7)</a></h4>
<p>
This mapper executes a script written in <a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a>
+or
+ <a href="https://scripting.dev.java.net">JSR 223</a>
supported language, once per file to map.</p>
The script can be declared inline or in a specified file.
</p>
@@ -729,16 +731,49 @@
<td align="center" valign="top">Yes</td>
</tr>
<tr>
+ <td valign="top">manager</td>
+ <td valign="top">
+ The script engine manager to use.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ for using this attribute.
+ </td>
+ <td valign="top" align="center">No - default is "auto"</td>
+ </tr>
+ <tr>
<td valign="top">src</td>
<td valign="top">
File containing the script
</td>
<td align="center" valign="top">No</td>
</tr>
+ <tr>
+ <td valign="top">setbeans</td>
+ <td valign="top">whether to have all properties, references and targets as
+ global variables in the script.</td>
+ <td valign="top" align="center">No, default is "true".</td>
+ </tr>
+ <tr>
+ <td valign="top">classpath</td>
+ <td valign="top">
+ The classpath to pass into the script.
+ </td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">classpathref</td>
+ <td valign="top">The classpath to use, given as a
+ <a href="../using.html#references">reference</a> to a path defined elsewhere.
+ <td align="center" valign="top">No</td>
+ </tr>
</table>
+ <p>
+ This filename mapper can take a nested <classpath> element.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ on how to use this element.
+ </p>
<p>
-Example
+ <b>Example:</b>
</p>
<blockquote><pre>
<scriptmapper language="javascript">
Modified: ant/core/trunk/docs/manual/CoreTypes/selectors.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/selectors.html?view=diff&rev=486341&r1=486340&r2=486341
==============================================================================
--- ant/core/trunk/docs/manual/CoreTypes/selectors.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/selectors.html Tue Dec 12 13:47:56 2006
@@ -87,7 +87,8 @@
they are signed, and optionally if they have a signature of a certain name.
</li>
<li><a href="#scriptselector"><code><scriptselector></code></a> -
- Use a BSF scripting language to create your own selector
+ Use a BSF or JSR 223 scripting language to create
+ your own selector
</li>
</ul>
@@ -976,6 +977,8 @@
The <code><scriptselector></code> element enables you
to write a complex selection algorithm in any
<a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a>
+ or
+ <a href="https://scripting.dev.java.net">JSR 223</a>
supported language.</p>
See the <a href="../OptionalTasks/script.html">Script</a> task for
an explanation of scripts and dependencies.
@@ -995,11 +998,44 @@
<td valign="top" align="center">yes</td>
</tr>
<tr>
+ <td valign="top">manager</td>
+ <td valign="top">
+ The script engine manager to use.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ for using this attribute.
+ </td>
+ <td valign="top" align="center">No - default is "auto"</td>
+ </tr>
+ <tr>
<td valign="top">src</td>
<td valign="top">filename of the script</td>
<td valign="top" align="center">no</td>
</tr>
+ <tr>
+ <td valign="top">setbeans</td>
+ <td valign="top">whether to have all properties, references and targets as
+ global variables in the script.</td>
+ <td valign="top" align="center">No, default is "true".</td>
+ </tr>
+ <tr>
+ <td valign="top">classpath</td>
+ <td valign="top">
+ The classpath to pass into the script.
+ </td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">classpathref</td>
+ <td valign="top">The classpath to use, given as a
+ <a href="../using.html#references">reference</a> to a path defined elsewhere.
+ <td align="center" valign="top">No</td>
+ </tr>
</table>
+ <p>
+ This selector can take a nested <classpath> element.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ on how to use this element.
+ </p>
<p>
If no <code>src</code> attribute is supplied, the script must be nested
inside the selector declaration.
Modified: ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html?view=diff&rev=486341&r1=486340&r2=486341
==============================================================================
--- ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html (original)
+++ ant/core/trunk/docs/manual/OptionalTasks/scriptdef.html Tue Dec 12 13:47:56 2006
@@ -28,7 +28,10 @@
<h3>Description</h3>
<p>Scriptdef can be used to define an Ant task using a scripting language. Ant
scripting languages supported by
-<a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a> may be
+<a href="http://jakarta.apache.org/bsf" target="_top">Apache BSF</a>
+or
+ <a href="https://scripting.dev.java.net">JSR 223</a>
+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,10 +98,19 @@
<tr>
<td valign="top">language</td>
<td valign="top">The programming language the script is written in.
- Must be a supported Apache BSF language</td>
+ Must be a supported Apache BSF or JSR 223 language</td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
+ <td valign="top">manager</td>
+ <td valign="top">
+ The script engine manager to use.
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ for using this attribute.
+ </td>
+ <td valign="top" align="center">No - default is "auto"</td>
+ </tr>
+ <tr>
<td valign="top">src</td>
<td valign="top">The location of the script as a file, if not inline</td>
<td valign="top" align="center">No</td>
@@ -110,7 +122,29 @@
</td>
<td valign="top" align="center">No</td>
</tr>
-</table>
+ <tr>
+ <td valign="top">classpath</td>
+ <td valign="top">
+ The classpath to pass into the script.
+ </td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">classpathref</td>
+ <td valign="top">The classpath to use, given as a
+ <a href="../using.html#references">reference</a> to a path defined elsewhere.
+ <td align="center" valign="top">No</td>
+ </tr>
+ <tr>
+ <td valign="top">loaderRef</td>
+ <td valign="top">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.
+ </td>
+ <td align="center" valign="top">No</td>
+ </tr>
+ </table>
<h3>Nested elements</h3>
<h4>attribute</h4>
@@ -158,7 +192,11 @@
</tr>
</table>
-
+ <h4>classpath</h4>
+ <p>
+ See the <a href="../OptionalTasks/script.html">script</a> task
+ for using this nested element.
+ </p>
<h3>Examples</h3>
@@ -236,7 +274,7 @@
</p>
<pre>
- <target name="echo-task-jython">
+<target name="echo-task-jython">
<scriptdef language="jython"
name="echo"
uri="http://example.org/script">
@@ -252,6 +290,26 @@
</target>
</pre>
+The next example shows the use of <classpath> and
+"loaderref" to get access to the beanshell jar.
+<pre>
+ <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"/>
+</pre>
<h3>Testing Scripts</h3>
<p>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org