IMPROVE: generate xml report using ivy:report task (IVY-143)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ivy/trunk@484127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Xavier Hanin 2006-01-20 15:45:18 +00:00
parent 658ad63ff2
commit 1fab0220a1
2 changed files with 33 additions and 1 deletions

View File

@ -12,6 +12,7 @@
- NEW: overwrite attribute in the publish task now let force overwrite of read only files (IVY-83)
- NEW: add a conflict manager ("strict") making build fail when a diamond conflict is found (thanks to Christer Jonsson) (IVY-118)
- IMPROVE: generate xml report using ivy:report task (IVY-143)
- IMPROVE: possibility to configure ivy so that special revisions are not queried as fixed one at all (IVY-139)
- IMPROVE: better url querying management (IVY-138) (thanks to Bernard Niset)
- IMPROVE: do not add resolver info in ivy files in cache so that they can be safely used as usual ivy files in a repository (IVY-137)

View File

@ -25,6 +25,8 @@ public class IvyReport extends IvyTask {
private String _conf;
private File _cache;
private boolean _graph = true;
private boolean _xml = false;
private boolean _xsl = true;
private String _xslFile;
private String _outputpattern;
@ -120,7 +122,12 @@ public class IvyReport extends IvyTask {
try {
String[] confs = splitConfs(_conf);
for (int i = 0; i < confs.length; i++) {
genreport(ivy, _cache, _organisation, _module, confs[i]);
if (_xsl) {
genreport(ivy, _cache, _organisation, _module, confs[i]);
}
if (_xml) {
genxml(ivy, _cache, _organisation, _module, confs[i]);
}
if (_graph) {
gengraph(ivy, _cache, _organisation, _module, confs[i]);
}
@ -130,6 +137,18 @@ public class IvyReport extends IvyTask {
}
}
private void genxml(Ivy ivy, File cache, String organisation, String module, String conf) throws IOException {
File xml = new File(cache, XmlReportOutputter.getReportFileName(new ModuleId(organisation, module), conf));
File out;
if (_todir != null) {
out = new File(_todir, xml.getName());
} else {
out = new File(xml.getName());
}
FileUtil.copy(xml, out, null);
}
private void genreport(Ivy ivy, File cache, String organisation, String module, String conf) throws IOException {
// first process the report with xslt
XSLTProcess xslt = new XSLTProcess();
@ -205,6 +224,18 @@ public class IvyReport extends IvyTask {
FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report-graph.xsl"), style, null);
return style.getAbsolutePath();
}
protected boolean isXml() {
return _xml;
}
protected void setXml(boolean xml) {
_xml = xml;
}
protected boolean isXsl() {
return _xsl;
}
protected void setXsl(boolean xsl) {
_xsl = xsl;
}