I'm sure there are other incompatible changes from Ant 1.4.1 to 1.5 that would make checking the required Ant version within Ant impossible. A coworker that tried to do that failed the same problem described here (but not because of <mail>).
And usually, the main build server (the one that sends build emails usually) is setup correctly, so a plain exit with an error message would be enough of a warning to explain one's not using the correct version of Ant. No need to mail anything to everyone. Just the build admin needs to know. I see this check as more something for every developer which might have played with Ant already and possibly has several versions installed. But I could be wrong. --DD -----Original Message----- From: Diane Holt [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 10:46 AM To: Ant Users List Subject: RE: Checking the version of Ant --- Dominique Devienne <[EMAIL PROTECTED]> wrote: > One easy solution would be to substitute the normal Ant main class > (org.apache.tools.ant.Main) by your own Main class, which loads the > org/apache/tools/ant/version.txt resource properties file [...] > and check the VERSION and DATE Java properties. Wouldn't it be easier still to just use a listener that sends mail, rather than relying on the <mail> task? Since you're sending mail about mismatched versions, presumably you also want to send build-results mail when the versions do match and things run. The other alternative would be to use the <mimemail> task. It's deprecated for 1.5, but not gone, and you'll only see the DEPRECATED output if you actually run it (ie., when the versions don't match). As a last resort, you could have two separate targets, one that runs 1.5's <mail> and one that runs 1.4.1's <mimemail>, depending on what $VERSION is set to (which would require you pull in version.txt -- but you really should do that in any case). Out of curiosity -- assuming this check is done before anything gets run, what set of files would you have at that point to send anyway? Diane ===== ([EMAIL PROTECTED]) __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>