You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Frederic Lavigne <fr...@L2FProd.com> on 2000/08/03 19:26:15 UTC

Automatic loading of custom tasks

Hi,

I've been working with ant for several weeks now and I'm starting to hack it
to meet my needs.

When someone creates a new (useful) task, the task is added to the main ant
source code.
If the user wants to add its own task, he creates a taskdef in its build
file.

I added a new feature to ant that you might find useful.

When I create new tasks, I package them in a jar file with the given
structure (example)

customtask.jar
	-- meta-inf/manifest
	-- com/mydomain/MyVeryOwnTask.class
	-- com/mydomain/FtpTask.class
	-- com/mydomain/ftp/FtpClient.class

	the manifest content is:
		Name: com/mydomain/MyVeryOwnTask.class
		Ant-Task: True
		Ant-TaskName: mytask

		Name: com/mydomain/FtpTask.class
		Ant-Task: True
		Ant-TaskName: ftp

I put the customtask.jar in jakarta-ant/lib/addin

Then when I start the build, Ant looks in the addin directory for jar files
and manifest
and add  the tasks defined in these jars at runtime. In my buildfile, there
is no more taskdef task,
neither additional CLASSPATH settings (the patch uses the AntClassLoader to
load the classes
inside the jars).

Tell me if you are interested.

Best Regards,

Frederic Lavigne, fred@L2FProd.com
java software at http://www.L2FProd.com


Re: Automatic loading of custom tasks

Posted by "William G. Thompson, Jr." <wg...@softcom.com>.
Peter Donald wrote:
> 
> At 07:26  3/8/00 +0200, you wrote:
> >Tell me if you are interested.
> 
> Sounds good. There was lots of requests for this a while back and it would
> definetly make my life a hell of a lot easier :P
> 
> Send the patch !!! :P
> Cheers,
> 
Yes yes, send the patch, we'll use it locally right away! ;)

later.
Bill
-- 
Bill Thompson | geek
"I'd rather write programs to write programs than write programs" 
bill@softcom.com | t: 732 283 5900 | f: 732 283 5757
http://www.softcom.com | Making Video Interactive

Re: Automatic loading of custom tasks

Posted by Peter Donald <do...@mad.scientist.com>.
At 07:26  3/8/00 +0200, you wrote:
>Tell me if you are interested.

Sounds good. There was lots of requests for this a while back and it would
definetly make my life a hell of a lot easier :P

Send the patch !!! :P
Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*