Example 2

Run an inline script that prints out the contents of the variable s.

JavaScript

enableTaskPackage("org.apache.ant"); new AntTF(). setSource( new CharSequenceReadableFile( "<project name=\"my_project\" default=\"prints\">\n" + "<target name=\"prints\">\n" + " <echo>" + s + "</echo>\n" + "</target>\n" + "</project>")).run();

Example 3

Run an inline script (using setSourceBody) that prints out the contents of the variable s.

JavaScript

enableTaskPackage("org.apache.ant"); new AntTF(). setSourceBody( "<target name=\"doit\">\n" + " <echo>" + s + "</echo>\n" + "</target>").run();

Example 4

Run an inline script (using setSourceTargetBody) that prints out the contents of the variable s.

JavaScript

enableTaskPackage("org.apache.ant"); new AntTF(). setSourceTargetBody("<echo>" + s + "</echo>").run();

Example 5

Run an inline script (using setSourceTargetBody) that prints out the contents of the variable s. The variable s is assigned to the property s in the Ant script.

JavaScript

enableTaskPackage("org.apache.ant"); new AntTF(). setSourceTargetBody("<echo>${s}</echo>"). addProperty("s", s).run();


* That a task is not EntityFS-aware means that it is not aware of DirectoryView filters (it uses them as plain Directory:s) and also that it usually requires that the entities it takes as arguments are in a File-based file file system. (That they are ECFileResolvable.) A non File-resolvable entity can be made so by using the SchmantFileSystems.makeFileResolvable(org.entityfs.EFile) method.