@@ -15,21 +15,23 @@ class CompilerClassPath(private val config: CompilerConfiguration) : Closeable {
15
15
compiler.updateConfiguration(config)
16
16
}
17
17
18
- private fun refresh () {
18
+ private fun refresh (updateBuildScriptClassPath : Boolean = true ) {
19
19
// TODO: Fetch class path and build script class path concurrently (and asynchronously)
20
20
val resolver = defaultClassPathResolver(workspaceRoots)
21
- val newClassPath = resolver.classpathOrEmpty
22
- val newBuildScriptClassPath = resolver.buildScriptClasspathOrEmpty
23
21
var refreshCompiler = false
24
22
23
+ val newClassPath = resolver.classpathOrEmpty
25
24
if (newClassPath != classPath) {
26
25
syncClassPath(classPath, newClassPath)
27
26
refreshCompiler = true
28
27
}
29
28
30
- if (newBuildScriptClassPath != buildScriptClassPath) {
31
- syncClassPath(buildScriptClassPath, newBuildScriptClassPath)
32
- refreshCompiler = true
29
+ if (updateBuildScriptClassPath) {
30
+ val newBuildScriptClassPath = resolver.buildScriptClasspathOrEmpty
31
+ if (newBuildScriptClassPath != buildScriptClassPath) {
32
+ syncClassPath(buildScriptClassPath, newBuildScriptClassPath)
33
+ refreshCompiler = true
34
+ }
33
35
}
34
36
35
37
if (refreshCompiler) {
@@ -81,7 +83,7 @@ class CompilerClassPath(private val config: CompilerConfiguration) : Closeable {
81
83
fun changedOnDisk (file : Path ) {
82
84
val name = file.fileName.toString()
83
85
if (name == " pom.xml" || name == " build.gradle" || name == " build.gradle.kts" )
84
- refresh()
86
+ refresh(updateBuildScriptClassPath = false )
85
87
}
86
88
87
89
override fun close () {
0 commit comments