Lee Wallen wrote:
Is it possible to use a user defined variable in the
nant build file?
My goal is to set the MailLogger.success.subject and
MailLogger.failure.subject using the base target name
used...whether it was the default target, or a target
specified on the command line.
It seems like the way to do this is to use a variable.
A property doesn't appear to work, because the
MailLogger.*.subject value is set when the file is
loaded, so a global property would be read before the
property could potentially be reset to have the
appropriate target name.
Have you tried this? I haven't, but I don't agree with your analysis.
There's nothing in the documentation that suggests the "value is set
when the file [aside: which file do you mean] is loaded." And so what?
If you're talking about global properties set in the nant.exe.config
file, there's no reason they have to be set readonly, so they can be
overwritten to have the appropriate target. If you're setting it
yourself on the command line, the answer is don't do that. As long as
you don't make the property readonly, you should be able to reset it
before the mail is sent.
I gave up on MailLogger because it sends everything, and the output log
is generally much too long to bother putting into email. I build a
summary myself and send that, using the <mail> task inside targets
specified with nant.onsuccess and nant.onfailure. That email can just
link to the full log file - or actually files, as it's better to keep
the NUnit and NCover output separate..
Gary
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users