-
Hello, I've implementated kotlinPoet into build.gradle.kts under protoc-gen-pbandk / lib as followed.
However, when I tried to import kotlinPoet into CodeGenerator.kt, Android Studio just failed to recognize it and underlined it with a red line. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @C7ABT. I've also considered using KotlinPoet for protoc-gen-pbandk. It would probably help make The reason your imports aren't working is because KotlinPoet is a Kotlin/JVM-only library. It is not a Kotlin Multiplatform (KMP) library. The reason that Anyways, if you wanted to experiment with KotlinPoet in |
Beta Was this translation helpful? Give feedback.
Hi @C7ABT. I've also considered using KotlinPoet for protoc-gen-pbandk. It would probably help make
CodeGenerator.kt
much more maintainable. What are you thinking of doing with it?The reason your imports aren't working is because KotlinPoet is a Kotlin/JVM-only library. It is not a Kotlin Multiplatform (KMP) library.
protoc-gen-pbandk/lib
is a KMP project and only KMP libraries can be used from itscommonMain
source set.The reason that
protoc-gen-pbandk/lib
is a KMP project is because when it was originally created there was a plan to eventually produce Kotlin/Native binaries ofprotoc-gen-pbandk
in addition to the current Kotlin/JVM jar file that we produce. The Kotlin/Native binaries …