In ant1 it was very easy to write your own task. In Ant2 we plan
+
In ant1 it was very easy to write your own task. In Ant2 we plan
to make it even easier. To write a basic task simply follow the following
formula.
- Create a Java class that extends
+ Create a Java class that extends
org.apache.myrmidon.api.AbstractTask
- For each attribute, write a setter method. The setter method
- must be a public void method that takes a single argument. The name
- of the method must begin with "set", followed by the attribute name, with
- the first character of the name in uppercase, and the rest in lowercase.
+ For each attribute, write a setter method. The setter method
+ must be a public void method that takes a single argument. The name
+ of the method must begin with "set", followed by the attribute name, with
+ the first character of the name in uppercase, and the rest in lowercase.
The type of the attribute can be:
String
- Any primitive type - they are converted for you from their
+ Any primitive type - they are converted for you from their
String-representation in the buildfile
- File - the string representation will be interpreted relative to
+ File - the string representation will be interpreted relative to
the project's basedir.
- For each nested element create a public void method that takes a single
- argument. The name of the method must begin with "add", followed by the
- attribute name, with the first character of the name in uppercase, and
- the rest in lowercase. The type of the parameter is an object with a
- no-arguement constructor. It is configured in exactly the same was a
+ For each nested element create a public void method that takes a single
+ argument. The name of the method must begin with "add", followed by the
+ attribute name, with the first character of the name in uppercase, and
+ the rest in lowercase. The type of the parameter is an object with a
+ no-arguement constructor. It is configured in exactly the same was a
task is configured (via setters and adders) and then added to the task.
- Write a public void method named "execute" with no arguments that
- throws a TaskException. This is the method called to do the
+ Write a public void method named "execute" with no arguments that
+ throws a TaskException. This is the method called to do the
actual work of the task.
@@ -125,7 +125,7 @@ formula.
-
So a basic task that has one attribute named "message" and just prints
+
So a basic task that has one attribute named "message" and just prints
out this message is as simple as;
@@ -142,8 +142,8 @@ package org.realityforge.tasks;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-public class SystemOutPrinterTask
- extends Task
+public class SystemOutPrinterTask
+ extends Task
{
private String m_message;
@@ -154,8 +154,8 @@ public class SystemOutPrinterTask
}
// The method executing the task
- public void execute()
- throws TaskException
+ public void execute()
+ throws TaskException
{
System.out.println( m_message );
}
@@ -170,7 +170,7 @@ public class SystemOutPrinterTask
-
To use this task you could create a library but instead we will
+
To use this task you could create a library but instead we will
just use <taskdef> to define the task. An example usage would be;
@@ -189,7 +189,7 @@ just use <taskdef> to define the task. An example usage would be;
<project version="2.0">
<target name="main">
- <taskdef name="printer"
+ <taskdef name="printer"
classname="org.realityforge.tasks.SystemOutPrinterTask"
classpath="build/classes"/>
diff --git a/proposal/myrmidon/docs/todo.html b/proposal/myrmidon/docs/todo.html
index dd40fdb15..9c54776b5 100644
--- a/proposal/myrmidon/docs/todo.html
+++ b/proposal/myrmidon/docs/todo.html
@@ -53,12 +53,12 @@
Library HOWTO
diff --git a/proposal/myrmidon/src/xdocs/stylesheets/project.xml b/proposal/myrmidon/src/xdocs/stylesheets/project.xml
index 1d2f81d7e..aac7ce633 100644
--- a/proposal/myrmidon/src/xdocs/stylesheets/project.xml
+++ b/proposal/myrmidon/src/xdocs/stylesheets/project.xml
@@ -15,10 +15,10 @@
+
diff --git a/proposal/myrmidon/src/xdocs/task.xml b/proposal/myrmidon/src/xdocs/task.xml
index 668ed79c5..ecccbae22 100644
--- a/proposal/myrmidon/src/xdocs/task.xml
+++ b/proposal/myrmidon/src/xdocs/task.xml
@@ -2,58 +2,58 @@
Peter Donald
-Writing a task
+My First Task
-
+
-
In ant1 it was very easy to write your own task. In Ant2 we plan
+
In ant1 it was very easy to write your own task. In Ant2 we plan
to make it even easier. To write a basic task simply follow the following
formula.
- Create a Java class that extends
+ Create a Java class that extends
org.apache.myrmidon.api.AbstractTask
- For each attribute, write a setter method. The setter method
- must be a public void method that takes a single argument. The name
- of the method must begin with "set", followed by the attribute name, with
- the first character of the name in uppercase, and the rest in lowercase.
+ For each attribute, write a setter method. The setter method
+ must be a public void method that takes a single argument. The name
+ of the method must begin with "set", followed by the attribute name, with
+ the first character of the name in uppercase, and the rest in lowercase.
The type of the attribute can be:
String
- Any primitive type - they are converted for you from their
+ Any primitive type - they are converted for you from their
String-representation in the buildfile
- File - the string representation will be interpreted relative to
+ File - the string representation will be interpreted relative to
the project's basedir.
- For each nested element create a public void method that takes a single
- argument. The name of the method must begin with "add", followed by the
- attribute name, with the first character of the name in uppercase, and
- the rest in lowercase. The type of the parameter is an object with a
- no-arguement constructor. It is configured in exactly the same was a
+ For each nested element create a public void method that takes a single
+ argument. The name of the method must begin with "add", followed by the
+ attribute name, with the first character of the name in uppercase, and
+ the rest in lowercase. The type of the parameter is an object with a
+ no-arguement constructor. It is configured in exactly the same was a
task is configured (via setters and adders) and then added to the task.
- Write a public void method named "execute" with no arguments that
- throws a TaskException. This is the method called to do the
+ Write a public void method named "execute" with no arguments that
+ throws a TaskException. This is the method called to do the
actual work of the task.
-
So a basic task that has one attribute named "message" and just prints
+
So a basic task that has one attribute named "message" and just prints
out this message is as simple as;
@@ -62,8 +62,8 @@ package org.realityforge.tasks;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-public class SystemOutPrinterTask
- extends Task
+public class SystemOutPrinterTask
+ extends Task
{
private String m_message;
@@ -74,15 +74,15 @@ public class SystemOutPrinterTask
}
// The method executing the task
- public void execute()
- throws TaskException
+ public void execute()
+ throws TaskException
{
System.out.println( m_message );
}
}
-
To use this task you could create a library but instead we will
+
To use this task you could create a library but instead we will
just use <taskdef> to define the task. An example usage would be;
@@ -93,7 +93,7 @@ just use <taskdef> to define the task. An example usage would be;
-