Skip to content

Unable to import a module in commonMain #197

Answered by garyp
C7ABT asked this question in Q&A
Discussion options

You must be logged in to vote

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 its commonMain 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 of protoc-gen-pbandk in addition to the current Kotlin/JVM jar file that we produce. The Kotlin/Native binaries …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@C7ABT
Comment options

@C7ABT
Comment options

Answer selected by C7ABT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #196 on December 08, 2021 15:23.