use output pattern for both xsl and xml generation

git-svn-id: https://svn.apache.org/repos/asf/incubator/ivy/trunk@484177 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Xavier Hanin 2006-01-25 15:31:22 +00:00
parent ed940129bf
commit 5d6d8d5cf4
2 changed files with 14 additions and 7 deletions

View File

@ -29,6 +29,7 @@ public class IvyReport extends IvyTask {
private boolean _xsl = true;
private String _xslFile;
private String _outputpattern;
private String _xslext = "html";
public File getTodir() {
return _todir;
@ -110,7 +111,7 @@ public class IvyReport extends IvyTask {
_todir.mkdirs();
}
if (_outputpattern == null) {
_outputpattern = "[organisation]-[module]-[conf].html";
_outputpattern = "[organisation]-[module]-[conf].[ext]";
}
if (_todir != null && _todir.exists() && !_todir.isDirectory()) {
@ -145,9 +146,9 @@ public class IvyReport extends IvyTask {
File out;
if (_todir != null) {
out = new File(_todir, xml.getName());
out = new File(_todir, IvyPatternHelper.substitute(_outputpattern, organisation, module, "", "", "", "xml", conf));
} else {
out = new File("./"+xml.getName());
out = new File(IvyPatternHelper.substitute(_outputpattern, organisation, module, "", "", "", "xml", conf));
}
FileUtil.copy(xml, out, null);
@ -160,9 +161,9 @@ public class IvyReport extends IvyTask {
xslt.setIn(new File(cache, XmlReportOutputter.getReportFileName(new ModuleId(organisation, module), conf)));
File out;
if (_todir != null) {
out = new File(_todir, IvyPatternHelper.substitute(_outputpattern, organisation, module, "", "", "", "", conf));
out = new File(_todir, IvyPatternHelper.substitute(_outputpattern, organisation, module, "", "", "", _xslext, conf));
} else {
out = new File(IvyPatternHelper.substitute(_outputpattern, organisation, module, "", "", "", "", conf));
out = new File(IvyPatternHelper.substitute(_outputpattern, organisation, module, "", "", "", _xslext, conf));
}
if (out.getParentFile() != null && !out.getParentFile().exists()) {
out.getParentFile().mkdirs();
@ -176,7 +177,7 @@ public class IvyReport extends IvyTask {
param.setExpression(_conf);
param = xslt.createParam();
param.setName("extension");
param.setExpression("html");
param.setExpression(_xslext);
xslt.execute();
// then copy the css if required
@ -241,6 +242,12 @@ public class IvyReport extends IvyTask {
public void setXsl(boolean xsl) {
_xsl = xsl;
}
public String getXslext() {
return _xslext;
}
public void setXslext(String xslext) {
_xslext = xslext;
}

View File

@ -15,6 +15,6 @@ ivy.retrieve.pattern = ${ivy.lib.dir}/[artifact]-[revision].[ext]
ivy.deliver.ivy.pattern = ${ivy.distrib.dir}/[type]s/[artifact]-[revision].[ext]
ivy.publish.src.artifacts.pattern = ${ivy.distrib.dir}/[type]s/[artifact]-[revision].[ext]
ivy.report.output.pattern = [organisation]-[module]-[conf].html
ivy.report.output.pattern = [organisation]-[module]-[conf].[ext]
ivy.buildlist.ivyfilepath = ivy.xml