:wave: Hi everyone! I implemented a <basic Kotlin ...
# compiler
d
👋 Hi everyone! I implemented a basic Kotlin compiler plugin using K2 that checks class instantiations and prints a warning on the build output log if a class of type
com.names.inspector.Dog
is defined with a name ending in a specific suffix. The attached images illustrate its behavior. The plugin works correctly on JVM but fails with iOS targets. When running the task
compileKotlinIosArm64
, it fails with an error
java.lang.NoClassDefFoundError: com/names/inspector/Dog
indicating that a class defined in a
commonMain
sourceSet is not recognized properly, even though it is exported correctly for each iOS target. Could you please help me understand why this plugin fails for iOS targets?
r
For native targets you need to shadow everything (but the compiler and stdlib). You can just use a single artifact with everything shadowed, it works fine for the non native compiler.
d
Thank you Ryan, I'll go that way