Skip to content

Commit d5e42e3

Browse files
Clear jar cache with daemon
1 parent 69e8cf6 commit d5e42e3

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ interface CompileService : Remote {
136136
operationsTracer: RemoteOperationsTracer?
137137
): CallResult<Int>
138138

139+
@Throws(RemoteException::class)
140+
fun clearJarCache()
141+
139142
@Throws(RemoteException::class)
140143
fun leaseReplSession(
141144
aliveFlagPath: String?,

compiler/daemon/src/org/jetbrains/kotlin/daemon/CompileServiceImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ class CompileServiceImpl(
680680
}
681681
}
682682

683-
private fun clearJarCache() {
683+
override fun clearJarCache() {
684684
ZipHandler.clearFileAccessorCache()
685685
(KotlinCoreEnvironment.applicationEnvironment?.jarFileSystem as? CoreJarFileSystem)?.clearHandlersCache()
686686
}

libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerRunner.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
142142
super.compileWithDaemon(compilerClassName, argsArray, environment)
143143
}
144144
exitCode?.let {
145+
withDaemon(environment, retryOnConnectionError = true) { daemon, sessionId ->
146+
daemon.clearJarCache()
147+
}
145148
logFinish(DAEMON_EXECUTION_STRATEGY)
146149
}
147150
return exitCode

0 commit comments

Comments
 (0)