ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Keim" <gk...@bea.com>
Subject Re: Running optional tasks
Date Thu, 12 Apr 2001 00:17:24 GMT
See docs\manual\develop.html

It says there:
----------------------------------------------------------
Adding your task to the system is rather simple too:

Make sure the class that implements your task is in the classpath when
starting Ant.
Add a <taskdef> element to your project. This actually adds your task to the
system.

Use your task in the rest of the buildfile.

Example

<?xml version="1.0"?>

<project name="OwnTaskExample" default="main" basedir=".">
  <taskdef name="mytask" classname="com.mydomain.MyVeryOwnTask"/>

  <target name="main">
    <mytask message="Hello World! MyVeryOwnTask works!"/>
  </target>
</project>

Another way to add a task (more permanently), is to add the task name and
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.
----------------------------------------------------------

I'm trying to do it the permanent way but I'm not having any success.
--
Gary

----- Original Message -----
From: <Eric.Hardesty@Bull.com>
To: <ant-user@jakarta.apache.org>
Sent: Wednesday, April 11, 2001 5:08 PM
Subject: Running optional tasks


> I downloaded Pvcs source compiled and put it into optional.jar, which is
in
> %ANT_HOME%\lib.
> When I try to use <pvcs  /> I get
>         Could not create task of type: pvcs. Common solutions are to use
taskdef
>         to declare your task, or, if this is an optional task , to put the
>         optional.jar in the lib directory of your ant installation
(ANT_HOME).
>
> What am I doing wrong?
>
> Eric
>
>


Mime
View raw message