how can i configure the multiplatform plugin once ...
# multiplatform
l
how can i configure the multiplatform plugin once (lets say to enforce the
explicitApiWarning
and have it applied for all my multiplatform modules? I currently have applied it on my root build.grade but it is causing other problems (eg. scratch files not working). Is there another way of doing it?
l
How were you doing it in the root module? I believe you can use
subprojects
a
You can try something like this in the root build.gradle.kts file: subprojects { plugins.withType<org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper> { configure<org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension> { // for strict mode explicitApi() } } } See https://github.com/orbit-mvi/orbit-mvi/blob/main/build.gradle.kts as a more complete example
l
thanks Matthew, that worked perfectly! Louis, I was applying the plugin in the root and declaring the kotlin block, which then had to declare a target because its mandatory to have one, and that enforced and caused other problems