set java temp dir to TeamCity' one (which clears automatically)

This commit is contained in:
Alexey Kudravtsev
2015-12-02 13:38:33 +03:00
parent 0dd1b35172
commit ff1ed0c368
2 changed files with 9 additions and 7 deletions
+4 -7
View File
@@ -26,12 +26,6 @@ target(compile: "Compile project") {
fileset(dir: "$home/bin", includes: "*.hprof")
}
def countTemp = new File(p("java.io.tmpdir")).list().length
print ("Deleting tmp dir "+p("java.io.tmpdir") + " ("+countTemp+" files)")
ant.delete(failonerror: false) {
fileset(dir: p("java.io.tmpdir"), includes: "*")
}
loadProject()
prepareOutputFolder()
@@ -74,10 +68,13 @@ target('run_tests': 'Run java tests') {
"idea.test.patterns",
"idea.fast.only",
"idea.coverage.enabled.build",
"teamcity.build.tempDir",
"teamcity.tests.recentlyFailedTests.file"
].each { pass(jvmArgs, it) }
def tempDir = p("teamcity.build.tempDir", p("java.io.tmpdir"))
jvmArgs << "-Djava.io.tmpdir=${tempDir}"
jvmArgs << "-Dteamcity.build.tempDir=${tempDir}"
System.getProperties().entrySet().each {
if (it.key.startsWith("pass.")) {
def trimmed = it.key.substring("pass.".length());
@@ -15,10 +15,12 @@
*/
import com.intellij.TestAll;
import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.testFramework.TestRunnerUtil;
import junit.framework.TestCase;
import javax.swing.*;
import java.io.File;
import java.nio.charset.Charset;
import java.util.List;
@@ -71,6 +73,9 @@ public class _FirstInSuiteTest extends TestCase {
// force platform JNA load
Class.forName("com.sun.jna.Native");
String tempDirectory = FileUtilRt.getTempDirectory();
System.out.println("FileUtil.getTempDirectory() = " + tempDirectory + " ("+new File(tempDirectory).list().length+" files)");
}
// performance tests