@@ -41,11 +41,14 @@ lowercase names, so even if you use name="SomeAttribute", you'll have
to use "someattribute" to retrieve the attribute's value from the
to use "someattribute" to retrieve the attribute's value from the
<code>attributes</code> collection.</p>
<code>attributes</code> collection.</p>
<p>The name "self" (<i>since Ant 1.6.3</i>) is a pre-defined reference to the script def task instance.
It can be used for logging purposes</p>
<p>The name "project" is a pre-defined reference to the Ant Project. For
<p>The name "project" is a pre-defined reference to the Ant Project. For
more information on writing scripts, please refer to the
more information on writing scripts, please refer to the
<a href="script.html"><script></a> task
<a href="script.html"><script></a> task
</p>
</p>
<h3>Parameters</h3>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<tr>
@@ -133,9 +136,9 @@ of the first fileset.
<element name="path" type="path"/>
<element name="path" type="path"/>
<![CDATA[
<![CDATA[
project .log("Hello from script");
project .log("Attribute attr1 = " + attributes.get("attr1"));
project .log("First fileset basedir = "
self .log("Hello from script");
self .log("Attribute attr1 = " + attributes.get("attr1"));
self .log("First fileset basedir = "
+ elements.get("fileset").get(0).getDir(project));
+ elements.get("fileset").get(0).getDir(project));
]]>
]]>
@@ -159,9 +162,9 @@ and iterates through them
<element name="fileset" type="fileset"/>
<element name="fileset" type="fileset"/>
<![CDATA[
<![CDATA[
filesets = elements.get("fileset");
filesets = elements.get("fileset");
project .log("Number of filesets = " + filesets.size());
self .log("Number of filesets = " + filesets.size());
for (i = 0; i < filesets.size(); ++i) {
for (i = 0; i < filesets.size(); ++i) {
project .log("fileset " + i + " basedir = "
self .log("fileset " + i + " basedir = "
+ filesets.get(i).getDir(project));
+ filesets.get(i).getDir(project));
}
}
]]>
]]>
@@ -192,4 +195,4 @@ Script errors are only detected when a script task is actually executed.
Reserved.</p>
Reserved.</p>
</body>
</body>
</html>
</html>