ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: ant/docs/manual/OptionalTasks script.html
Date Fri, 12 Sep 2003 14:15:17 GMT
jhm         2003/09/12 07:15:17

  Modified:    docs/manual/OptionalTasks script.html
  Link to documentation of "JavaAdapter".
  How to import classes outside of "java" namespace.
  Revision  Changes    Path
  1.13      +18 -4     ant/docs/manual/OptionalTasks/script.html
  Index: script.html
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/script.html,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- script.html	16 Jun 2003 10:09:09 -0000	1.12
  +++ script.html	12 Sep 2003 14:15:17 -0000	1.13
  @@ -9,14 +9,14 @@
   <h2><a name="script">Script</a></h2>
  -<p>Execute a script in a 
  +<p>Execute a script in a
     <a href="" target="_top">Apache BSF</a> supported
   <p><b>Note:</b> This task depends on external libraries not included
in the Ant distribution.
   See <a href="../install.html#librarydependencies">Library Dependencies</a>
for more information.</p>
   <p>All items (tasks, targets, etc) of the running project are
   accessible from the script, using either their <code>name</code> or
   <code>id</code> attributes (as long as their names are considered
  -valid Java identifiers, that is). 
  +valid Java identifiers, that is).
   The name "project" is a pre-defined reference to the Project, which can be
   used instead of the project name. The name "self" is a pre-defined reference to the actual
   &lt;script&gt;-Task instance.<br>From these objects you have access to the
Ant Java API, see the
  @@ -26,6 +26,15 @@
   <p>If you are using JavaScript a good resource is <a target="_blank" href=""></a> as we are using their JavaScript interpreter.</p>
   <p>Scripts can do almost anything a task written in Java could do.</p>
  +<p>Rhino provides a special construct - the <i>JavaAdapter</i>. Whith
that you can
  +create an object which implements several interfaces, extends classes and for which you
  +can overwrite methods. Because this is an undocumented feature (yet), here is the link
  +to an explanation: <a href="">
  +Groups@Google: "Rhino, enum.js, JavaAdapter?"</a> by Norris Boyd in the newsgroup
   <table border="1" cellpadding="2" cellspacing="0">
  @@ -178,7 +187,12 @@
   <p>We want to use the Java API. Because we donīt want always typing the package signature
   we do an import. Rhino knows to different methods for import statements: one for packages
  -and one for a single class. <br>
  +and one for a single class. By default only the <i>java</i> packages are available,
  +<i>java.lang.System</i> can be directly imported with <code>importClass/importPackage</code>.
  +For other packages you have to prefix the full classified name with <i>Package</i>.
  +For example antīs <i>FileUtil</i> class can be imported with
   The &lt;script&gt; task populates the Project instance under
   the name <i>project</i>, so we can use that reference. Another way is to use
its given name
   or getting its reference from the task itself.<br>
  @@ -199,4 +213,4 @@
  \ No newline at end of file

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message