ansman/kotshi

Kotlin 1.5 borked

Arneball opened this issue · 3 comments

I tried bumping kotlin version to 1.5.10 and it blows up in kotlinpoet.
I forked and bumped kotlinpoet to 1.8.0 and it worked, so I guess it is not overly complicated.

However, a new warning appeared:

Deprecation warning: converting xxx.BaseResp.OtherResponse to TypeName. Conversion of TypeMirror and TypeElement is deprecated in KotlinPoet, use kotlin-metadata APIs instead.
Deprecation warning: converting xxx.BaseAction.FormAction to TypeName. Conversion of TypeMirror and TypeElement is deprecated in KotlinPoet, use kotlin-metadata APIs instead.
Caused by: com.sun.tools.javac.processing.AnnotationProcessingError: java.lang.IllegalStateException: Could not parse metadata! This should only happen if you're using Kotlin <1.1.
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:992)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:896)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1222)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1334)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1258)
        ... 37 more
Caused by: java.lang.IllegalStateException: Could not parse metadata! This should only happen if you're using Kotlin <1.1.
        at com.squareup.kotlinpoet.metadata.KotlinPoetMetadata.readKotlinClassMetadata(KotlinPoetMetadata.kt:83)
        at com.squareup.kotlinpoet.metadata.KotlinPoetMetadata.toImmutableKmClass(KotlinPoetMetadata.kt:113)
        at se.ansman.kotshi.AdaptersProcessingStep.process(AdaptersProcessingStep.kt:57)
        at se.ansman.kotshi.KotshiProcessor.process(KotshiProcessor.kt:96)
        at se.ansman.kotshi.KotshiProcessor.process(KotshiProcessor.kt:78)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90)
        at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:166)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:980)
        ... 41 more

I have a fix half implemented but I was blocked on some other things. I'll check if I can fix it now that 1.5 is released

This has been released as 2.5.0