Browse Source

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
master
Stefan Bodewig 25 years ago
parent
commit
8953b25e9e
5 changed files with 37 additions and 8 deletions
  1. +2
    -2
      build.xml
  2. +16
    -1
      docs/index.html
  3. +1
    -1
      src/main/org/apache/tools/ant/IntrospectionHelper.java
  4. +4
    -0
      src/main/org/apache/tools/ant/Project.java
  5. +14
    -4
      src/main/org/apache/tools/ant/Task.java

+ 2
- 2
build.xml View File

@@ -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.">
</javadoc>
</target>

<!-- =================================================================== -->


+ 16
- 1
docs/index.html View File

@@ -23,7 +23,7 @@
<li>Sam Ruby (<a href="mailto:rubys@us.ibm.com">rubys@us.ibm.com</a>)</li>
</ul>

<p>Version 1.0.8.1 - 2000/06/28</p>
<p>Version 1.0.8.2 - 2000/07/12</p>

<hr>
<h2>Table of Contents</h2>
@@ -40,6 +40,7 @@
<li><a href="#optionaltasks">Optional Tasks</a>
<li><a href="#buildevents">Build Events</a>
<li><a href="#writingowntask">Writing your own task</a></li>
<li><a href="#faq">FAQ, DTD, external resources</a>
<li><a href="#license">License</a></li>
<li><a href="#feedback">Feedback</a></li>
</ul>
@@ -325,6 +326,9 @@ resolved before the task is executed.</p>
value-x the value of this attribute.</p>
<p>There is a set of <a href="#tasks">built in tasks</a>, but it is also very
easy to <a href="#writingowntask">write your own</a>.</p>
<p>All tasks share a <code>taskname</code> attribute. The value of
this attribute will be used in the logging messages generated by
Ant.</p>
<h3>Properties</h3>
<p>A project can have a set of properties. These might be set in the buildfile
by the <a href="#property">property task</a>, or might be set outside Ant. A
@@ -2100,6 +2104,7 @@ instead.</p>
<td valign="top">failonerror</td>
<td valign="top">Stop the buildprocess if the command exits with a
returncode other than 0.</td>
<td align="center" valign="top">all</td>
<td align="center" valign="top">No</td>
</tr>
</table>
@@ -3217,6 +3222,16 @@ public class MyVeryOwnTask extends Task {
implementing class name to the <code>default.properties</code> file in the <code>org.apache.tools.ant.taskdefs</code>
package. Then you can use it as if it were a built in task.</p>
<hr>
<h2><a name="faq">FAQ, DTD, external resources</a></h2>
<p>There is an online FAQ for Ant at <a
href="http://jakarta.apache.org/jyve-faq/Turbine/screen/DisplayTopics/action/SetAll/project_id/2/faq_id/16">jakarta.apache.org</a>. This
FAQ is interactive, which means you can ask and answer questions
online.</p>
<p>One of the questions poping up quite often is "Is there a DTD for
buildfiles?". Please refer to the FAQ for an answer.</p>
<p>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.</p>
<h2><a name="feedback">Feedback</a></h2>
<p>To provide feedback on this software, please subscribe to the Ant Development
Mail List <a href="mailto:(ant-dev-subscribe@jakarta.apache.org">(ant-dev-subscribe@jakarta.apache.org</a>)</p>


+ 1
- 1
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -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;
}


+ 4
- 0
src/main/org/apache/tools/ant/Project.java View File

@@ -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;


+ 14
- 4
src/main/org/apache/tools/ant/Task.java View File

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


Loading…
Cancel
Save