https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

Emil Kantis

11/24/2021, 10:51 PM
Is it possible to use
org.jetbrains:annotations
from commonMain? I can’t seem to get it to work.. Assuming the dependency is only available for JVM, is there any way to add annotations for jvm target? 🤔
i

itnoles

11/24/2021, 11:03 PM
if it is only available for JVM, you can't use it in commonMain
e

ephemient

11/25/2021, 12:59 AM
you can define your own
expect annotation class
mirroring the JVM-only annotations, with
actual typealias
in
jvmMain
, and either stub
actual annotation class
on other platforms or
@OptionalExpectation
on expectation
e

Emil Kantis

11/25/2021, 8:04 AM
Thanks a lot@ephemient 🙌
Didn’t work out.. found this now https://youtrack.jetbrains.com/issue/KTIJ-16340 😢