From 8953b25e9e0fb39fccfc25a48ab693093010eab2 Mon Sep 17 00:00:00 2001
From: Stefan Bodewig Version 1.0.8.1 - 2000/06/28 Version 1.0.8.2 - 2000/07/12
Table of Contents
@@ -40,6 +40,7 @@
There is a set of built in tasks, but it is also very easy to write your own.
+All tasks share a taskname
attribute. The value of
+this attribute will be used in the logging messages generated by
+Ant.
A project can have a set of properties. These might be set in the buildfile by the property task, or might be set outside Ant. A @@ -2100,6 +2104,7 @@ instead.
default.properties
file in the org.apache.tools.ant.taskdefs
package. Then you can use it as if it were a built in task.
There is an online FAQ for Ant at jakarta.apache.org. This +FAQ is interactive, which means you can ask and answer questions +online.
+One of the questions poping up quite often is "Is there a DTD for +buildfiles?". Please refer to the FAQ for an answer.
+The FAQ contains lists of known custom tasks that don't ship with +Ant and projects that use Ant. Feel free to add your own task or project +there.
To provide feedback on this software, please subscribe to the Ant Development Mail List (ant-dev-subscribe@jakarta.apache.org)
diff --git a/src/main/org/apache/tools/ant/IntrospectionHelper.java b/src/main/org/apache/tools/ant/IntrospectionHelper.java index d59ab27d9..8483486dc 100644 --- a/src/main/org/apache/tools/ant/IntrospectionHelper.java +++ b/src/main/org/apache/tools/ant/IntrospectionHelper.java @@ -119,7 +119,7 @@ public class IntrospectionHelper { // not really user settable properties if ("setLocation".equals(name) || "setDescription".equals(name) || - "setTaskName".equals(name)) { + "setTaskType".equals(name)) { continue; } diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index 610c1416e..152a53eae 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -400,7 +400,11 @@ public class Project { task=taskA; } task.setProject(this); + task.setTaskType(taskType); + + // set default value, can be changed by the user task.setTaskName(taskType); + String msg = " +Task: " + taskType; log (msg, MSG_VERBOSE); return task; diff --git a/src/main/org/apache/tools/ant/Task.java b/src/main/org/apache/tools/ant/Task.java index e8cdff20e..77eca840f 100644 --- a/src/main/org/apache/tools/ant/Task.java +++ b/src/main/org/apache/tools/ant/Task.java @@ -67,6 +67,7 @@ public abstract class Task { protected String description=null; protected Location location = Location.UNKNOWN_LOCATION; protected String taskName = null; + protected String taskType = null; /** * Sets the project object of this task. This method is used by @@ -108,23 +109,32 @@ public abstract class Task { } /** - * Set the name with which the task has been invoked. + * Set the name to use in logging messages. * - * @param name the name the task has been invoked as. + * @param name the name to use in logging messages. */ public void setTaskName(String name) { this.taskName = name; } /** - * Get the name with which the task has been invoked. + * Get the name to use in logging messages. * - * @return the name the task has been invoked as. + * @return the name to use in logging messages. */ public String getTaskName() { return taskName; } + /** + * Set the name with which the task has been invoked. + * + * @param type the name the task has been invoked as. + */ + void setTaskType(String type) { + this.taskType = type; + } + /** * Log a message with the default (INFO) priority. *