Adam Brown
04/09/2023, 5:58 PMAdam S
04/09/2023, 6:01 PMAdam Brown
04/09/2023, 6:03 PMAdam Brown
04/09/2023, 6:06 PMJason Zhao
04/09/2023, 6:20 PMKotlin doesn't currently support sharing a source set for these combinations:
• Several JVM targets
• JVM + Android targets
• Several JS targets^ from the manual configuration section linked above I think this means that while you can share code between JVM and Android platforms, the "common" module between them doesn't support JVM-specific features and will only work with things in Kotlin's common library. I'm not sure about the details.
Jason Zhao
04/09/2023, 6:21 PMAdam Brown
04/09/2023, 6:21 PMAdam Brown
04/09/2023, 6:21 PMAdam Brown
04/09/2023, 6:22 PMjw
04/09/2023, 8:13 PMJeff Lockhart
04/09/2023, 8:32 PMcompileOnly
in the common JVM source set, and then add again as `implementation`/`api` in the jvm edge. This mostly works, except that the android source set may possibly prioritize the JVM dependency over its Android-specific dependency, resulting in IDE errors if there are similar but differing APIs between jvm and android.
@Sebastian Sellmair [JB] was looking for valid use cases for this, if you want to share more about your specific requirements. https://kotlinlang.slack.com/archives/C3PQML5NU/p1661339694375649?thread_ts=1661339694.375649&cid=C3PQML5NUAdam Brown
04/09/2023, 11:36 PM