From 01dc66b53abf3cd0fff384bf30f77dcc1e19f41f Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Wed, 17 Apr 2019 08:26:41 +0200 Subject: [PATCH] Temporary workaround: use teamcity.build.tempDir instead of java.io.tmpdir teamcity.build.tempDir is cleaned up between build executions, should be fixed soon on Teamcity side --- buildSrc/src/main/kotlin/tasks.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/tasks.kt b/buildSrc/src/main/kotlin/tasks.kt index f9ec6cb956c..86b95072ee3 100644 --- a/buildSrc/src/main/kotlin/tasks.kt +++ b/buildSrc/src/main/kotlin/tasks.kt @@ -98,9 +98,13 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}): environment("PROJECT_BUILD_DIR", buildDir) systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!) systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false") - System.getProperty("teamcity.build.tempDir")?.let { + + //Temporary workaround for "not enough space" on Teamcity agents: should be fixed soon on Teamcity side + val teamcity = rootProject.property("teamcity") as? Map<*, *> + (teamcity?.get("teamcity.build.tempDir") as? String)?.let { systemProperty("java.io.tmpdir", it) } + body() }