make report file name prettier

git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@432860 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Bodewig 2006-08-19 18:56:24 +00:00
parent 77d58419c4
commit 11115b90e6
1 changed files with 8 additions and 2 deletions

View File

@ -33,6 +33,7 @@ import org.apache.tools.ant.Project;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.taskdefs.LogOutputStream;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.TeeOutputStream;
/**
@ -178,13 +179,18 @@ public class PlainAntUnitListener extends ProjectComponent
}
if (logTo.getValue().equals(SendLogTo.FILE)
|| logTo.getValue().equals(SendLogTo.BOTH)) {
buildFile = FileUtils.getFileUtils()
.removeLeadingPath(getProject().getBaseDir(),
new File(buildFile));
if (buildFile.length() > 0
&& buildFile.charAt(0) == File.separatorChar) {
buildFile = buildFile.substring(1);
}
String fileName =
buildFile.replace(File.separatorChar, '.') + ".txt";
String fileName = "TEST-" +
buildFile.replace(File.separatorChar, '.').replace(':', '.')
+ ".txt";
File file = toDir == null
? getProject().resolveFile(fileName)
: new File(toDir, fileName);