|
@@ -185,10 +185,14 @@ public class XmlLogger implements BuildListener { |
|
|
buildElement.element.appendChild(stacktrace); |
|
|
buildElement.element.appendChild(stacktrace); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String outFilename = event.getProject().getProperty("XmlLogger.file"); |
|
|
|
|
|
|
|
|
String outFilename = event.getProject().getProperty("XmlLogger.file"); |
|
|
if (outFilename == null) { |
|
|
if (outFilename == null) { |
|
|
outFilename = "log.xml"; |
|
|
outFilename = "log.xml"; |
|
|
} |
|
|
} |
|
|
|
|
|
String xslUri=event.getProject().getProperty("ant.XmlLogger.stylesheet.uri"); |
|
|
|
|
|
if(xslUri==null) { |
|
|
|
|
|
xslUri="log.xsl"; |
|
|
|
|
|
} |
|
|
Writer out = null; |
|
|
Writer out = null; |
|
|
try { |
|
|
try { |
|
|
// specify output in UTF8 otherwise accented characters will blow |
|
|
// specify output in UTF8 otherwise accented characters will blow |
|
@@ -196,7 +200,9 @@ public class XmlLogger implements BuildListener { |
|
|
FileOutputStream fos = new FileOutputStream(outFilename); |
|
|
FileOutputStream fos = new FileOutputStream(outFilename); |
|
|
out = new OutputStreamWriter(fos, "UTF8"); |
|
|
out = new OutputStreamWriter(fos, "UTF8"); |
|
|
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); |
|
|
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"); |
|
|
out.write("<?xml-stylesheet type=\"text/xsl\" href=\"log.xsl\"?>\n\n"); |
|
|
|
|
|
|
|
|
if(xslUri.length()>0) { |
|
|
|
|
|
out.write("<?xml-stylesheet type=\"text/xsl\" href=\""+xslUri+"\"?>\n\n"); |
|
|
|
|
|
} |
|
|
(new DOMElementWriter()).write(buildElement.element, out, 0, "\t"); |
|
|
(new DOMElementWriter()).write(buildElement.element, out, 0, "\t"); |
|
|
out.flush(); |
|
|
out.flush(); |
|
|
} catch(IOException exc) { |
|
|
} catch(IOException exc) { |
|
|