I didn't see an answer (well, other than "it doesn't work") and am curious about this as well, from a compiler plugin standpoint. Plugins can detect the platform and disable themselves if it's not supported (either in the plugin itself or the gradle plugin), but I don't know of a way to specify it user side. There definitely should be one though. Someone (I will of no one else) should make an issue requesting it if no solution comes up.
The best workaround is probably to make your own gradle plugin (using
KotlinCompilerPluginSupportPlugin
) and set
isApplicable
properly. You could also experiment with including the plugin jar manually, although I'm not sure if you can set different compiler args per target.