Clear jar cache with daemon

This commit is contained in:
Alexey Tsvetkov
2016-12-19 08:26:00 +03:00
parent 69e8cf6a25
commit d5e42e3271
3 changed files with 7 additions and 1 deletions
@@ -136,6 +136,9 @@ interface CompileService : Remote {
operationsTracer: RemoteOperationsTracer?
): CallResult<Int>
@Throws(RemoteException::class)
fun clearJarCache()
@Throws(RemoteException::class)
fun leaseReplSession(
aliveFlagPath: String?,
@@ -680,7 +680,7 @@ class CompileServiceImpl(
}
}
private fun clearJarCache() {
override fun clearJarCache() {
ZipHandler.clearFileAccessorCache()
(KotlinCoreEnvironment.applicationEnvironment?.jarFileSystem as? CoreJarFileSystem)?.clearHandlersCache()
}
@@ -142,6 +142,9 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
super.compileWithDaemon(compilerClassName, argsArray, environment)
}
exitCode?.let {
withDaemon(environment, retryOnConnectionError = true) { daemon, sessionId ->
daemon.clearJarCache()
}
logFinish(DAEMON_EXECUTION_STRATEGY)
}
return exitCode