antoine 2003/12/23 11:20:13 Modified: docs/manual/CoreTasks Tag: ANT_16_BRANCH mail.html docs/manual Tag: ANT_16_BRANCH tutorial-writing-tasks.html Log: Merge from HEAD Get rid of characters not supported by XHTML PR: 25707 Submitted by: Jesse Glick (jglick at netbeans dot org) Revision Changes Path No revision No revision 1.21.2.2 +7 -8 ant/docs/manual/CoreTasks/mail.html Index: mail.html =================================================================== RCS file: /home/cvs/ant/docs/manual/CoreTasks/mail.html,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -u -r1.21.2.1 -r1.21.2.2 --- mail.html 9 Oct 2003 21:01:07 -0000 1.21.2.1 +++ mail.html 23 Dec 2003 19:20:13 -0000 1.21.2.2 @@ -10,11 +10,11 @@ <h2><a name="mail">Mail</a></h2> <h3>Description</h3> -<p>A task to send SMTP email.<br/><br/> +<p>A task to send SMTP email.<br></br><br></br> This task can send mail using either plain -text, UU encoding, or MIME format mail, depending on what is available.<br/> -<br/> -SMTP auth and SSL/TLS require JavaMail and are only available in MIME format.<br/><br/> +text, UU encoding, or MIME format mail, depending on what is available.<br></br><br></br> +<br> +SMTP auth and SSL/TLS require JavaMail and are only available in MIME format.<br></br><br></br> Attachments may be sent using nested <a href="../CoreTypes/fileset.html">fileset</a> elements.</p> <p><strong>Note:</strong> This task may depend on external libraries @@ -105,18 +105,18 @@ <tr> <td valign="top">user</td> <td valign="top">user name for SMTP auth</td> - <td valign="center">Yes, if SMTP auth is required on your SMTP server<br/> + <td valign="center">Yes, if SMTP auth is required on your SMTP server<br></br> the email message will be then sent using Mime and requires JavaMail</td> </tr> <tr> <td valign="top">password</td> <td valign="top">password for SMTP auth</td> - <td valign="center">Yes, if SMTP auth is required on your SMTP server<br/> + <td valign="center">Yes, if SMTP auth is required on your SMTP server<br></br> the email message will be then sent using Mime and requires JavaMail</td> </tr> <tr> <td valign="top">ssl</td> - <td valign="top">"true", "on" or "yes" accepted here<br/> + <td valign="top">"true", "on" or "yes" accepted here<br></br> indicates whether you need TLS/SSL</td> <td valign="center">No</td> </tr> @@ -265,4 +265,3 @@ </body> </html> - No revision No revision 1.2.2.2 +33 -33 ant/docs/manual/tutorial-writing-tasks.html Index: tutorial-writing-tasks.html =================================================================== RCS file: /home/cvs/ant/docs/manual/tutorial-writing-tasks.html,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -r1.2.2.1 -r1.2.2.2 --- tutorial-writing-tasks.html 9 Oct 2003 21:01:14 -0000 1.2.2.1 +++ tutorial-writing-tasks.html 23 Dec 2003 19:20:13 -0000 1.2.2.2 @@ -21,7 +21,7 @@ <li><a href="#write1">Write the Task</a></li> <li><a href="#use1">Use the Task</a></li> <li><a href="#TaskAdapter">Integration with TaskAdapter</a></li> -<li><a href="#derivingFromTask">Deriving from Antīs Task</a></li> +<li><a href="#derivingFromTask">Deriving from Ant's Task</a></li> <li><a href="#attributes">Attributes</a></li> <li><a href="#NestedText">Nested Text</a></li> <li><a href="#NestedElements">Nested Elements</a></li> @@ -30,7 +30,7 @@ <li><a href="#resources">Resources</a></li> </ul></p> -<a name="buildenvironment"/> +<a name="buildenvironment"></a> <h2>Set up the build environment</h2> <p>Ant builds itself, we are using Ant too (why we would write a task if not? :-) therefore we should use Ant for our build.<p> @@ -97,7 +97,7 @@ build-in properties [1]</a> of Ant. -<a name="write1"/> +<a name="write1"></a> <h2>Write the Task</h2> Now we write the simplest Task - a HelloWorld-Task (what else?). Create a text file @@ -114,7 +114,7 @@ -<a name="use1"/> +<a name="use1"></a> <h2>Use the Task</h2> <p>But after creating the jar we want to use our new Task. Therefore we need a new target "use". Before we can use our new task we have to declare it with @@ -135,7 +135,7 @@ </pre> Important is the <i>classpath</i>-attribute. Ant searches in its /lib directory for -tasks and our task isnīt there. So we have to provide the right location. </p> +tasks and our task isn't there. So we have to provide the right location. </p> <p>Now we can type in <tt>ant</tt> and all should work ... <pre class="output"> @@ -157,16 +157,16 @@ -<a name="TaskAdapter"/> +<a name="TaskAdapter"></a> <h2>Integration with TaskAdapter</h2> <p>Our class has nothing to do with Ant. It extends no superclass and implements no interface. How does Ant know to integrate? Via name convention: our class provides -a method with signature <tt>public void execute()</tt>. This class is wrapped by Antīs +a method with signature <tt>public void execute()</tt>. This class is wrapped by Ant's <tt>org.apache.tools.ant.TaskAdapter</tt> which is a task and uses reflection for setting a reference to the project and calling the <i>execute()</i> method.</p> <p><i>Setting a reference to the project</i>? Could be interesting. The Project class -gives us some nice abilities: access to Antīs logging facilities getting and setting +gives us some nice abilities: access to Ant's logging facilities getting and setting properties and much more. So we try to use that class: <pre class="code"> import org.apache.tools.ant.Project; @@ -192,14 +192,14 @@ </pre></p> -<a name="derivingFromTask"/> -<h2>Deriving from Antīs Task</h2> +<a name="derivingFromTask"></a> +<h2>Deriving from Ant's Task</h2> <p>Ok, that works ... But usually you will extend <tt>org.apache.tools.ant.Task</tt>. -That class is integrated in Ant, getīs the project-reference, provides documentation +That class is integrated in Ant, get's the project-reference, provides documentation fiels, provides easier access to the logging facility and (very useful) gives you the exact location where <i>in the buildfile</i> this task instance is used.</p> -<p>Oki-doki - letīs us use some of these: +<p>Oki-doki - let's us use some of these: <pre class="code"> import org.apache.tools.ant.Task; @@ -208,7 +208,7 @@ // use of the reference to Project-instance String message = getProject().getProperty("ant.project.name"); - // Taskīs log method + // Task's log method log("Here is project '" + message + "'."); // where this task is used? @@ -250,10 +250,10 @@ } </pre> -<p>Oh, whatīs that in execute()? Throw a <i>BuildException</i>? Yes, thatīs the usual +<p>Oh, what's that in execute()? Throw a <i>BuildException</i>? Yes, that's the usual way to show Ant that something important is missed and complete build should fail. The -string provided there is written as build-failes-message. Here itīs necessary because -the log() method canīt handle a <i>null</i> value as parameter and throws a NullPointerException. +string provided there is written as build-failes-message. Here it's necessary because +the log() method can't handle a <i>null</i> value as parameter and throws a NullPointerException. (Of course you can initialize the <i>message</i> with a default string.)</p> <p>After that we have to modify our buildfile: @@ -265,7 +265,7 @@ <helloworld <b>message="Hello World"</b>/> </target> </pre> -Thatīs all.</p> +That's all.</p> <p>Some background for working with attributes: Ant supports any of these datatypes as arguments of the set-method:<ul> @@ -280,7 +280,7 @@ would not set the message string to "${msg}" if there is a property "msg" with a set value. -<a name="NestedText"/> +<a name="NestedText"></a> <h2>Nested Text</h2> <p>Maybe you have used the <echo> task in a way like <tt><echo>Hello World</echo></tt>. For that you have to provide a <tt>public void addText(String text)</tt> method. @@ -295,11 +295,11 @@ } </pre> But here properties are <b>not</b> resolved! For resolving properties we have to use -Projectīs <tt>replaceProperties(String propname) : String</tt> method which takes the +Project's <tt>replaceProperties(String propname) : String</tt> method which takes the property name as argument and returns its value (or ${propname} if not set).</p> -<a name="NestedElements"/> +<a name="NestedElements"></a> <h2>Nested Elements</h2> <p>There are several ways for inserting the ability of handling nested elements. See the <a href="http://ant.apache.org/manual/develop.html#nested-elements">Manual [4]</a> for other. @@ -354,7 +354,7 @@ </pre> -<a name="complex"/> +<a name="complex"></a> <h2>Our task in a little more complex version</h2> <p>For recapitulation now a little refactored buildfile: <pre class="code"> @@ -439,7 +439,7 @@ /** * The task of the tutorial. - * Printīs a message or let the build fail. + * Print a message or let the build fail. * @author Jan Matčrne * @since 2003-08-19 */ @@ -559,7 +559,7 @@ -<a name="TestingTasks"/> +<a name="TestingTasks"></a> <h2>Test the Task</h2> <p>We have written a test already: the use.* tasks in the buildfile. But its difficult to test that automatically. Common (and in Ant) used is JUnit for @@ -572,7 +572,7 @@ <p>In Ant it is usual that the testcase has the same name as the task with a prepending <i>Test</i>, therefore we will create a file <i>HelloWorldTest.java</i>. Because we -have a very small project we can put this file into <i>src</i> directory (Antīs own +have a very small project we can put this file into <i>src</i> directory (Ant's own testclasses are in /src/testcases/...). Because we have already written our tests for "hand-test" we can use that for automatic tests, too. But there is one little problem we have to solve: all test supporting classes are not part of the binary @@ -691,7 +691,7 @@ } </pre></p> -<p>When starting <tt>ant</tt> weīll get a short message to STDOUT and +<p>When starting <tt>ant</tt> we'll get a short message to STDOUT and a nice HTML-report. <pre class="output"> C:\tmp\anttests\MyFirstTask>ant @@ -724,7 +724,7 @@ </pre></p> -<a name="resources"/> +<a name="resources"></a> <h2>Resources</h2> <p>This tutorial and its resources are available via <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22570">BugZilla [6]</a>. @@ -744,13 +744,13 @@ Used Links:<br/> - [1] <a href="http://ant.apache.org/manual/using.html#built-in-props">http://ant.apache.org/manual/using.html#built-in-props</a><br/> - [2] <a href="http://ant.apache.org/manual/CoreTasks/taskdef.html">http://ant.apache.org/manual/CoreTasks/taskdef.html</a><br/> - [3] <a href="http://ant.apache.org/manual/develop.html#set-magic">http://ant.apache.org/manual/develop.html#set-magic</a><br/> - [4] <a href="http://ant.apache.org/manual/develop.html#nested-elements">http://ant.apache.org/manual/develop.html#nested-elements</a><br/> - [5] <a href="http://gump.covalent.net/jars/latest/ant/ant-testutil.jar">http://gump.covalent.net/jars/latest/ant/ant-testutil.jar</a><br/> - [6] <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22570">http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22570</a><br/> - [7] <a href="tutorial-writing-tasks-src.zip">tutorial-writing-tasks-src.zip</a><br/> + [1] <a href="http://ant.apache.org/manual/using.html#built-in-props">http://ant.apache.org/manual/using.html#built-in-props</a><br> + [2] <a href="http://ant.apache.org/manual/CoreTasks/taskdef.html">http://ant.apache.org/manual/CoreTasks/taskdef.html</a><br> + [3] <a href="http://ant.apache.org/manual/develop.html#set-magic">http://ant.apache.org/manual/develop.html#set-magic</a><br> + [4] <a href="http://ant.apache.org/manual/develop.html#nested-elements">http://ant.apache.org/manual/develop.html#nested-elements</a><br> + [5] <a href="http://gump.covalent.net/jars/latest/ant/ant-testutil.jar">http://gump.covalent.net/jars/latest/ant/ant-testutil.jar</a><br> + [6] <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22570">http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22570</a><br> + [7] <a href="tutorial-writing-tasks-src.zip">tutorial-writing-tasks-src.zip</a><br> <hr> <p align="center">Copyright © 2003 Apache Software Foundation. All rights
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]