From 5d6d8d5cf4ced033dbc2bcef78309030a6072f04 Mon Sep 17 00:00:00 2001 From: Xavier Hanin Date: Wed, 25 Jan 2006 15:31:22 +0000 Subject: [PATCH] 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 --- src/java/fr/jayasoft/ivy/ant/IvyReport.java | 19 +++++++++++++------ src/java/fr/jayasoft/ivy/ant/ivy.properties | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/java/fr/jayasoft/ivy/ant/IvyReport.java b/src/java/fr/jayasoft/ivy/ant/IvyReport.java index c2969831..d10908b2 100644 --- a/src/java/fr/jayasoft/ivy/ant/IvyReport.java +++ b/src/java/fr/jayasoft/ivy/ant/IvyReport.java @@ -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; + } diff --git a/src/java/fr/jayasoft/ivy/ant/ivy.properties b/src/java/fr/jayasoft/ivy/ant/ivy.properties index 90f18d5d..0bd39830 100644 --- a/src/java/fr/jayasoft/ivy/ant/ivy.properties +++ b/src/java/fr/jayasoft/ivy/ant/ivy.properties @@ -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 \ No newline at end of file