From 8953b25e9e0fb39fccfc25a48ab693093010eab2 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 12 Jul 2000 11:51:30 +0000 Subject: [PATCH] Added a taskType attribute in addition to the taskName attribute to Task. Documented taskname. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267762 13f79535-47bb-0310-9956-ffa450edef68 --- build.xml | 4 ++-- docs/index.html | 17 ++++++++++++++++- .../apache/tools/ant/IntrospectionHelper.java | 2 +- src/main/org/apache/tools/ant/Project.java | 4 ++++ src/main/org/apache/tools/ant/Task.java | 18 ++++++++++++++---- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/build.xml b/build.xml index 9f205e4d8..9b670aaa4 100644 --- a/build.xml +++ b/build.xml @@ -133,8 +133,8 @@ version="true" windowtitle="${Name} API" doctitle="${Name}" - bottom="Copyright © 2000 Apache Software Foundation. All Rights Reserved." - /> + bottom="Copyright © 2000 Apache Software Foundation. All Rights Reserved."> + diff --git a/docs/index.html b/docs/index.html index e74a0cfdb..17d7e07f9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -23,7 +23,7 @@
  • Sam Ruby (rubys@us.ibm.com)
  • -

    Version 1.0.8.1 - 2000/06/28

    +

    Version 1.0.8.2 - 2000/07/12


    Table of Contents

    @@ -40,6 +40,7 @@
  • Optional Tasks
  • Build Events
  • Writing your own task
  • +
  • FAQ, DTD, external resources
  • License
  • Feedback
  • @@ -325,6 +326,9 @@ resolved before the task is executed.

    value-x the value of this attribute.

    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.

    Properties

    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.

    failonerror Stop the buildprocess if the command exits with a returncode other than 0. + all No @@ -3217,6 +3222,16 @@ public class MyVeryOwnTask extends Task { implementing class name to the default.properties file in the org.apache.tools.ant.taskdefs package. Then you can use it as if it were a built in task.


    +

    FAQ, DTD, external resources

    +

    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.

    Feedback

    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. *