ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulo Gaspar" <>
Subject My SendMailTask as-is (WAS: modifying optional task code / <mimemail>)
Date Fri, 08 Jun 2001 20:29:49 GMT
Sorry about the slow reaction but I am now busy with something completely

I just took a look at Steve's MimeMail task and it is quite similar to mine.
PROs and CONs I can guess at a first look:
 - Steve's MimeMail is possibly more similar to the standard mail task, to
   which I did not pay enough attention (although I took a look at it);

 - My "SendMailTask" extends MatchingTask and, that way, can use the usual
   fileset functionality from Ant.

This is a slight modification of a test task I made (and yes, it worked):

  <taskdef name="mymail" classname="SendMailTask"/>

  <mymail from=""
      subject="This mail was sent from java..."
      ...and there should be a couple of files
      attached to it.

I am still interested in merging the best of these 2 tasks, but the problem
is priority related. When I made my previous posting this was the top one
thing to do. But since then, this one got postponed and I got other

Keep in mind that this is just something I hacked in an afternoon just after
discovering that Ant is good for exports too (it runs other code from the
command line, selects files, zips them, deletes them) but missed the file
sending bit.

This means that:
 - It seems to work well;
 - But I knew almost nothing about Ant before that day (only messed with
   making a build.xml for myself for the 1st time that morning);
 - And it is my first mail sending code (a nice tutorial from Sun helped
   a lot).

Steve's mail code looks a lot like mine.. and since it works, maybe that
part is OK. However, I still have some doubts on the fileset usage, that I
just copied from another task. I am not sure if excluding files in the
fileset definition and less trivial stuff like that will work correctly.

Anyway, I got a lot for free and the least I can do is to give back what I
have. I hope this can help someone and I am sorry and don't have the time
right know to improve it a bit. I still hope to get back at it.

I will make time for any questions, but I will be offline until Sunday.

Have fun,
Paulo Gaspar

> -----Original Message-----
> From: Erik Hatcher []
> Sent: Thursday, June 07, 2001 5:18 AM
> To: ant-dev
> Subject: modifying optional task code / <mimemail>
> I am in the process of modifying one of Ant's optional tasks (<junit> and
> <junitreport> specifically).   I, incorrectly I'm guessing,
> compiled the two
> classes I modified ( and and
> modified my classpath to have their directory ahead of
> optional.jar in hopes
> they'd get picked up from there.   Ant actually pulled them from
> optional.jar instead.   I haven't dug deep enough into Ant's internals to
> really understand how this is happening, but could someone explain to me
> (point me to the code if possible) how/why this happens?
> Also, is there a way I can keep the standard release build of ant.jar and
> optional.jar in the lib directory and still override some of
> optional.jar's
> classes?
> I'm writing an article (for IBM's developerWorks) on Ant/JUnit integration
> and how to automate running unit tests and having the testing
> report (thanks
> to Stephane's cool <junitreport> tag).   Since my code modifications
> probably won't be committed before I submit the article, I want to explain
> how to get my enhancements working prior to their integration into an
> official Ant build.   The way I've done it is to simply run bootstrap.bat
> and replace my previous ant.jar and optional.jar files with the
> newly built
> ones.   It would be nicer if I could do something easier than having folks
> build ant.jar and optional.jar themselves if at all possible.
> I'm also using the <mimemail> task to e-mail the HTML reports but I'm sure
> since its not already an existing optional task that I can get by with
> <taskdef>'ing for my article.   Steve Loughran - any objections to me
> providing your task with my article?  (I will definitely give the
> disclaimer
> that it will probably be modified but e-mailing attachments will
> most likely
> be available as an Ant task in the near future with the same or similar
> syntax - but until then that this piece could be used with <taskdef>).
> Thanks for all your help.
>     Erik

View raw message