From 0ce95ee95e9e4f99930845d67d6789d23a8bf5fd Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 22 Oct 2010 15:27:04 +0000 Subject: [PATCH] found two non-closed tags (were missing the > sign). Had to make it well-formed XML so Emacs' nXML mode could assist me. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1026374 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/tutorial-writing-tasks.html | 97 ++++++++++++------------- 1 file changed, 48 insertions(+), 49 deletions(-) diff --git a/docs/manual/tutorial-writing-tasks.html b/docs/manual/tutorial-writing-tasks.html index 53e33ac72..0577d73a6 100644 --- a/docs/manual/tutorial-writing-tasks.html +++ b/docs/manual/tutorial-writing-tasks.html @@ -18,6 +18,7 @@ Tutorial: Writing Tasks +

Tutorial: Writing Tasks

@@ -25,7 +26,7 @@

This document provides a step by step tutorial for writing tasks.

Content

-

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.

+a task if not? :-) therefore we should use Ant for our build.

We choose a directory as root directory. All things will be done here if I say nothing different. I will reference this directory as root-directory of our project. In this root-directory we -create a text file names build.xml. What should Ant do for us? +create a text file names build.xml. What should Ant do for us?

+

The method replaceProperties() is discussed further in section Nested Text.

- +

Attributes

Now we want to specify the text of our message (it seems that we are rewriting the <echo/> task :-). First we well do that with an attribute. @@ -279,7 +280,7 @@ string provided there is written as build-failes-message. Here it's necessary be 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: +

After that we have to modify our buildfile:

     <target name="use" description="Use the Task" depends="jar">
         <taskdef name="helloworld"
@@ -288,10 +289,10 @@ the log() method can't handle a null value as parameter and throws a Null
         <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: