Do not depend on BaseFileObject type for incremental KAPT

This class does not exist in JDK9, so running incremental KAPT on
JDK9 fails. Because it is used only to get the name of the file,
this has been replaced with usage of the public JavaFileObject API.
This commit is contained in:
Ivan Gavrilovic
2019-09-23 16:49:09 +01:00
committed by Yan Zhulanow
parent aaa00b0f6f
commit 4da6675640
@@ -5,7 +5,6 @@
package org.jetbrains.kotlin.kapt3.base.javac
import com.sun.tools.javac.file.BaseFileObject
import com.sun.tools.javac.file.JavacFileManager
import com.sun.tools.javac.main.Option
import com.sun.tools.javac.util.Context
@@ -66,8 +65,7 @@ class KaptJavaFileManager(context: Context) : JavacFileManager(context, true, nu
return when (fileObject.toUri().scheme) {
"jar", "zip" -> false
else -> {
if (fileObject !is BaseFileObject) return false
val typeName = packageName?.let { "$it." } + fileObject.shortName.dropLast(".class".length)
val typeName = packageName?.let { "$it." } + File(fileObject.toUri()).name.dropLast(".class".length)
return typeToIgnore.contains(typeName)
}