From 2b855ea39720729cb88e5a8c35b48b15c6b6c8b2 Mon Sep 17 00:00:00 2001
From: Gintas Grigelionis <fileset/> caught.
java.lang.System can be directly imported
with importClass/importPackage. For other packages you have to prefix the
full classified name with Packages. For example
Ant's FileUtils class can be imported
-with importClass(Packages.org.apache.tools.ant.util.FileUtils)<script> task populates the Project instance under the
-name project, so we can use that reference. Another way is to use its given name or
-getting its reference from the task itself.<copy> for example).importClass(Packages.org.apache.tools.ant.util.FileUtils)
+In Java 8+, you may use the built-in Nashorn JavaScript engine rather than Rhino (which is
+available in Java 7 runtime). Then, use Java.type as import statement for any Java
+class
+or the
+compatibility script: load("nashorn:mozilla_compat.js");.
The <script> task populates the Project instance under the
+name project, so we can use that reference. Another way is to use its
+given name or getting its reference from the task itself. The Project provides methods for accessing
+and setting properties, creating DataTypes and Tasks and much more.
After creating a FileSet
+object we initialize that by calling its set-methods. Then we can use that object like a normal Ant
+task (<copy> for example).
For getting the size of a file we instantiate
a java.io.File. So we are using normal Java API here.
Finally we use
the <echo> task for producing the output. The task is not executed by
its execute() method, because the perform()