Kapt: Analyze sources again if the received analysis result is 'RetryWithAdditionalJavaRoots'. ->

Add additional Java roots to Java source roots and clear diagnostic messages before the next analysis round.
(cherry picked from commit 17ad807)
This commit is contained in:
Yan Zhulanow
2016-06-21 21:19:14 +03:00
committed by Yan Zhulanow
parent 884e653490
commit 84d62f37eb
12 changed files with 93 additions and 27 deletions
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.analyzer
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.types.ErrorUtils
import java.io.File
open class AnalysisResult protected constructor(
val bindingContext: BindingContext,
@@ -58,6 +59,12 @@ open class AnalysisResult protected constructor(
}
private class Error(bindingContext: BindingContext, val exception: Throwable) : AnalysisResult(bindingContext, ErrorUtils.getErrorModule())
class RetryWithAdditionalJavaRoots(
bindingContext: BindingContext,
moduleDescriptor: ModuleDescriptor,
val additionalJavaRoots: List<File>
) : AnalysisResult(bindingContext, moduleDescriptor)
companion object {
val EMPTY: AnalysisResult = success(BindingContext.EMPTY, ErrorUtils.getErrorModule())
@@ -122,6 +122,10 @@ public class CompilerConfiguration {
this.readOnly = readOnly;
}
}
public boolean isReadOnly() {
return readOnly;
}
@NotNull
private static <T> T unmodifiable(@NotNull T object) {