From ceba0661bcf905d78a21119d2cc971c6b403a3da Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 27 Jan 2017 19:49:43 +0100 Subject: [PATCH] Move daemon session flag files to daemon discovery dir by default + minor fixes: - Move flag files from the temp dir, because right now JPS cleans temp dir on each build start. Should fix KT-15707, also may affect KT-15562. - change compiler runner to allow the fix above - Fix flag file name filtering - Fix ifAlive handling on the new compile method in the daemon. Original commit: 7c0cdf90cf3114b220fb362cb5630299e1ecad98 --- .../kotlin/compilerRunner/JpsKotlinCompilerRunner.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt index a557b301749..22f2f111759 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt @@ -206,10 +206,10 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner() { val libPath = CompilerRunnerUtil.getLibPath(environment.kotlinPaths, environment.messageCollector) val compilerPath = File(libPath, "kotlin-compiler.jar") val compilerId = CompilerId.makeCompilerId(compilerPath) - val flagFile = File.createTempFile("kotlin-compiler-jps-session-", "-is-running").apply { - deleteOnExit() - } - jpsDaemonConnection = newDaemonConnection(compilerId, flagFile, environment) + // TODO: pass daemon options to newDaemonConnection + val daemonOptions = configureDaemonOptions() + val flagFile = makeAutodeletingFlagFile("compiler-jps-session-", File(daemonOptions.runFilesPathOrDefault)) + jpsDaemonConnection = newDaemonConnection(compilerId, flagFile, environment, daemonOptions) } return jpsDaemonConnection!! }