bodewig 00/08/11 06:58:31
Modified: docs index.html junit.html
Log:
The attribute name is id not ID, ts.
Added a little bit of documentation for <script>.
Revision Changes Path
1.80 +87 -13 jakarta-ant/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- index.html 2000/08/11 12:45:18 1.79
+++ index.html 2000/08/11 13:58:29 1.80
@@ -232,7 +232,7 @@
<hr>
<h2><a name="buildfile">Writing a simple buildfile</a></h2>
<p>The buildfile is written in XML. Each buildfile contains one project.</p>
-<p>Each element of the buildfile can have an <code>ID</code> attribute and
+<p>Each element of the buildfile can have an <code>id</code> attribute and
can later be referred to by the value supplied to this. The value has
to be unique.</p>
<h3>Projects</h3>
@@ -511,7 +511,7 @@
<code>\dir;\dir2;\dir3</code> on DOS based systems and
<code>/dir:/dir2:/dir3</code> on Unix like systems.</p>
<h3><a name="references">References</a></h3>
-<p>The <code>ID</code> attribute of the buildfile's elements can be
+<p>The <code>id</code> attribute of the buildfile's elements can be
used to refer to them. This can useful if you are going to replicate
the same snippet of XML over and over again - using a
<code><classpath></code> structure more than once for
@@ -536,7 +536,7 @@
<p>could be rewritten as</p>
<blockquote><pre>
<rmic ...>
- <classpath ID="project.class.path">
+ <classpath id="project.class.path">
<pathelement location="lib/" />
<pathelement path="${java.class.path}/" />
<pathelement path="${additional.path}" />
@@ -664,7 +664,7 @@
If you do not want these default excludes applied, you may disable them with
the
<code>defaultexcludes="no"</code> attribute.</p>
<h3><a name="patternset">PatternSets</a></h3>
-<p>Patterns can be group to sets and later be referenced by their ID
+<p>Patterns can be group to sets and later be referenced by their id
attribute. They are defined via a <code>patternset</code> element -
which can currently only appear nested into a <a
href="#fileset">FileSet</a> or a directory based task that constitutes
@@ -699,7 +699,7 @@
</table>
<h4>Examples:</h4>
<blockquote><pre>
-<patternset ID="non.test.sources" >
+<patternset id="non.test.sources" >
<include name="**/*.java" />
<exclude name="**/*Test*" />
</patternset>
@@ -766,7 +766,7 @@
<h4>Examples:</h4>
<blockquote><pre>
<fileset dir="${server.src}" >
- <patternset ID="non.test.sources" >
+ <patternset id="non.test.sources" >
<include name="**/*.java" />
<exclude name="**/*Test*" />
</patternset>
@@ -1047,7 +1047,7 @@
<p>makes all files below <code>shared/sources1</code> (except those
below any directory named trial) writable for members of the same
group on a UNIX system. In addition all files belonging to a FileSet
-with <code>ID</code> <code>other.shared.sources</code> get the same
+with <code>id</code> <code>other.shared.sources</code> get the same
permissions.</p>
<hr>
<h2><a name="copydir">Copydir</a></h2>
@@ -1587,7 +1587,7 @@
</pre></blockquote>
<p>invokes <code>ls -l</code>, adding the absolute filenames of all
files below <code>/tmp</code> not ending in <code>.txt</code> and all
-files of the FileSet with <code>ID</code> <code>other.files</code> to
+files of the FileSet with <code>id</code> <code>other.files</code> to
the command line.</p>
<hr>
<h2><a name="filter">Filter</a></h2>
@@ -4351,8 +4351,10 @@
<h3><b>Description:</b></h3>
<p>Execute a script in a
<a
href="http://oss.software.ibm.com/developerworks/opensource/bsf/">BSF</a>
supported language.
-<p>All items (tasks, targets, etc) of the running project are accessible
-from the script.
+<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.</p>
+<p>Scripts can do almost anything a task written in Java could do.</p>
<h3>Parameters:</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -4373,9 +4375,81 @@
</tr>
</table>
<h3>Examples</h3>
-<blockquote>
- <p>None yet available</p>
-</blockquote>
+<blockquote><pre>
+<project name="squares" default="main"
basedir=".">
+
+ <target name="setup">
+
+ <script language="javascript"> <![CDATA[
+
+ for (i=1; i<=10; i++) {
+ echo = squares.createTask("echo");
+ main.addTask(echo);
+ echo.setMessage(i*i);
+ }
+
+ ]]> </script>
+
+ </target>
+
+ <target name="main" depends="setup" />
+
+</project>
+</pre></blockquote>
+<p>generates</p>
+<blockquote><pre>
+setup:
+
+main:
+1
+4
+9
+16
+25
+36
+49
+64
+81
+100
+
+BUILD SUCCESSFUL
+</pre></blockquote>
+<p>Another example, using <a href="#references">references by id</a>.</p>
+<blockquote><pre>
+<project name="testscript" default="main">
+ <target name="sub">
+ <echo id="theEcho" />
+ </target>
+
+ <target name="sub1">
+ <script language="javascript"><![CDATA[
+ theEcho.setMessage("In sub1");
+ sub.execute();
+ ]]></script>
+ </target>
+
+ <target name="sub2">
+ <script language="javascript"><![CDATA[
+ theEcho.setMessage("In sub2");
+ sub.execute();
+ ]]></script>
+ </target>
+
+ <target name="main" depends="sub1,sub2" />
+</project>
+</pre></blockquote>
+<p>generates</p>
+<blockquote><pre>
+sub1:
+In sub1
+
+sub2:
+In sub2
+
+main:
+
+BUILD SUCCESSFUL
+</pre></blockquote>
<hr>
<h2><a name="vssget">VssGet</a></h2>
<h3><b>Description:</b></h3>
1.5 +1 -1 jakarta-ant/docs/junit.html
Index: junit.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/junit.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- junit.html 2000/08/11 12:55:12 1.4
+++ junit.html 2000/08/11 13:58:30 1.5
@@ -190,7 +190,7 @@
of nested <a
href="index.html#fileset"><code><fileset></code></a> and
<code><filesetref></code> (referring to a
-<code><fileset></code> defined elsewhere via its <code>ID</code>
+<code><fileset></code> defined elsewhere via its <code>id</code>
attribute) elements. It then generates a test class name for each file
that ends in <code>.java</code> or <code>.class</code>.</p>