PR: 15454 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274351 13f79535-47bb-0310-9956-ffa450edef68master
@@ -196,6 +196,9 @@ Other changes: | |||||
* <concat> now supports filtering and can check timestamps before | * <concat> now supports filtering and can check timestamps before | ||||
overriding a file. Bugzilla Report 18166. | overriding a file. Bugzilla Report 18166. | ||||
* <junit> has a new attribute tempdir that controls the placement of | |||||
temporary files. Bugzilla Report 15454. | |||||
Changes from Ant 1.5.2 to Ant 1.5.3 | Changes from Ant 1.5.2 to Ant 1.5.3 | ||||
=================================== | =================================== | ||||
@@ -142,6 +142,13 @@ elements</a>).</p> | |||||
formatters receive the output.</td> | formatters receive the output.</td> | ||||
<td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">tempdir</td> | |||||
<td valign="top">Where Ant should place temporary files. | |||||
<em>Since Ant 1.6</em>.</td> | |||||
<td align="center" valign="top">No; default is the project's base | |||||
directory.</td> | |||||
</tr> | |||||
</table> | </table> | ||||
<p>By using the <code>errorproperty</code> and <code>failureproperty</code> | <p>By using the <code>errorproperty</code> and <code>failureproperty</code> | ||||
@@ -479,7 +486,7 @@ aborted. Results are collected in files named | |||||
<code>${reports.tests}</code>.</p> | <code>${reports.tests}</code>.</p> | ||||
<hr> | <hr> | ||||
<p align="center">Copyright © 2000-2002 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2000-2003 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
</html> | </html> |
@@ -174,6 +174,7 @@ public class JUnitTask extends Task { | |||||
private Path antRuntimeClasses = null; | private Path antRuntimeClasses = null; | ||||
private boolean showOutput = false; | private boolean showOutput = false; | ||||
private File tmpDir; | |||||
/** | /** | ||||
* If true, smartly filter the stack frames of | * If true, smartly filter the stack frames of | ||||
@@ -501,6 +502,15 @@ public class JUnitTask extends Task { | |||||
.setClassname("org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"); | .setClassname("org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner"); | ||||
} | } | ||||
/** | |||||
* Where Ant should place temporary files. | |||||
* | |||||
* @since Ant 1.6 | |||||
*/ | |||||
public void setTempdir(File tmpDir) { | |||||
this.tmpDir = tmpDir; | |||||
} | |||||
/** | /** | ||||
* Adds the jars or directories containing Ant, this task and | * Adds the jars or directories containing Ant, this task and | ||||
* JUnit to the classpath - this should make the forked JVM work | * JUnit to the classpath - this should make the forked JVM work | ||||
@@ -636,6 +646,7 @@ public class JUnitTask extends Task { | |||||
// forked test | // forked test | ||||
File propsFile = | File propsFile = | ||||
FileUtils.newFileUtils().createTempFile("junit", ".properties", | FileUtils.newFileUtils().createTempFile("junit", ".properties", | ||||
tmpDir != null ? tmpDir : | |||||
getProject().getBaseDir()); | getProject().getBaseDir()); | ||||
cmd.createArgument().setValue("propsfile=" | cmd.createArgument().setValue("propsfile=" | ||||
+ propsFile.getAbsolutePath()); | + propsFile.getAbsolutePath()); | ||||