From b8c5368ced35c8b774ff8fb7220dc87dfaa04e05 Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Tue, 23 Dec 2003 15:57:02 +0000 Subject: [PATCH] Correction of pages which do not fit with XHTML or JavaHelp PR: 25707 Submitted by: Jesse Glick (jglick at netbeans dot org) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275838 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/mail.html | 15 +++--- docs/manual/tutorial-writing-tasks.html | 70 ++++++++++++------------- 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/docs/manual/CoreTasks/mail.html b/docs/manual/CoreTasks/mail.html index 05dacc12f..23fcf6ab9 100644 --- a/docs/manual/CoreTasks/mail.html +++ b/docs/manual/CoreTasks/mail.html @@ -9,11 +9,11 @@

Mail

Description

-

A task to send SMTP email.

+

A task to send SMTP email.



This task can send mail using either plain -text, UU encoding, or MIME format mail, depending on what is available.
-
-SMTP auth and SSL/TLS require JavaMail and are only available in MIME format.

+text, UU encoding, or MIME format mail, depending on what is available.



+
+SMTP auth and SSL/TLS require JavaMail and are only available in MIME format.



Attachments may be sent using nested fileset elements.

Note: This task may depend on external libraries @@ -104,18 +104,18 @@ Library Dependencies for more information. user user name for SMTP auth - Yes, if SMTP auth is required on your SMTP server
+ Yes, if SMTP auth is required on your SMTP server

the email message will be then sent using Mime and requires JavaMail password password for SMTP auth - Yes, if SMTP auth is required on your SMTP server
+ Yes, if SMTP auth is required on your SMTP server

the email message will be then sent using Mime and requires JavaMail ssl - "true", "on" or "yes" accepted here
+ "true", "on" or "yes" accepted here

indicates whether you need TLS/SSL No @@ -264,4 +264,3 @@ Reserved.

- diff --git a/docs/manual/tutorial-writing-tasks.html b/docs/manual/tutorial-writing-tasks.html index 948410991..30be6140e 100644 --- a/docs/manual/tutorial-writing-tasks.html +++ b/docs/manual/tutorial-writing-tasks.html @@ -20,7 +20,7 @@ tasks.

  • Write the Task
  • Use the Task
  • Integration with TaskAdapter
  • -
  • Deriving from Antīs Task
  • +
  • Deriving from Ant's Task
  • Attributes
  • Nested Text
  • Nested Elements
  • @@ -29,7 +29,7 @@ tasks.

  • Resources
  • - +

    Set up the build environment

    Ant builds itself, we are using Ant too (why we would write a task if not? :-) therefore we should use Ant for our build.

    @@ -96,7 +96,7 @@ the execution of some steps bofore. So the refactored code is: build-in properties [1] of Ant. - +

    Write the Task

    Now we write the simplest Task - a HelloWorld-Task (what else?). Create a text file @@ -113,7 +113,7 @@ its depends-clause the "compile" is executed before). - +

    Use the Task

    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 @@ -134,7 +134,7 @@ new target "use". Before we can use our new task we have to declare it with Important is the classpath-attribute. Ant searches in its /lib directory for -tasks and our task isnīt there. So we have to provide the right location.

    +tasks and our task isn't there. So we have to provide the right location.

    Now we can type in ant and all should work ...

    @@ -156,16 +156,16 @@ Total time: 3 seconds
     
     
     
    -
    +
     

    Integration with TaskAdapter

    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 public void execute(). This class is wrapped by Antīs +a method with signature public void execute(). This class is wrapped by Ant's org.apache.tools.ant.TaskAdapter which is a task and uses reflection for setting a reference to the project and calling the execute() method.

    Setting a reference to the project? 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:

     import org.apache.tools.ant.Project;
    @@ -191,14 +191,14 @@ Here is project 'MyTask'.
     

    - -

    Deriving from Antīs Task

    +
    +

    Deriving from Ant's Task

    Ok, that works ... But usually you will extend org.apache.tools.ant.Task. -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 in the buildfile this task instance is used.

    -

    Oki-doki - letīs us use some of these: +

    Oki-doki - let's us use some of these:

     import org.apache.tools.ant.Task;
     
    @@ -207,7 +207,7 @@ public class HelloWorld extends Task {
             // 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?
    @@ -249,10 +249,10 @@ public class HelloWorld extends Task {
     
     }
     
    -

    Oh, whatīs that in execute()? Throw a BuildException? Yes, thatīs the usual +

    Oh, what's that in execute()? Throw a BuildException? 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 null 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 null value as parameter and throws a NullPointerException. (Of course you can initialize the message with a default string.)

    After that we have to modify our buildfile: @@ -264,7 +264,7 @@ the log() method can <helloworld message="Hello World"/> </target>

    -Thatīs all.

    +That's all.

    Some background for working with attributes: Ant supports any of these datatypes as arguments of the set-method: