KT-9003 FileNotFoundException when Kapt is unable to find corresponding annotations.txt
#KT-9003 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
01b2d02196
commit
69038ba6c0
+7
-9
@@ -81,16 +81,14 @@ public abstract class AnnotationProcessorWrapper(
|
||||
return
|
||||
}
|
||||
|
||||
val annotationsFile = processingEnv.getOptions().get(KAPT_ANNOTATION_OPTION)
|
||||
if (annotationsFile != null) {
|
||||
try {
|
||||
kotlinAnnotationsProvider = FileKotlinAnnotationProvider(File(annotationsFile))
|
||||
}
|
||||
catch (e: IOException) {
|
||||
kotlinAnnotationsProvider = EmptyKotlinAnnotationsProvider()
|
||||
}
|
||||
val annotationsFilePath = processingEnv.getOptions().get(KAPT_ANNOTATION_OPTION)
|
||||
val annotationsFile = if (annotationsFilePath != null) File(annotationsFilePath) else null
|
||||
kotlinAnnotationsProvider = if (annotationsFile != null && annotationsFile.exists()) {
|
||||
FileKotlinAnnotationProvider(annotationsFile)
|
||||
}
|
||||
else {
|
||||
EmptyKotlinAnnotationsProvider()
|
||||
}
|
||||
else kotlinAnnotationsProvider = EmptyKotlinAnnotationsProvider()
|
||||
|
||||
processor.init(processingEnv)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user