In a multiplatform project, is there a way to conf...
# gradle
b
In a multiplatform project, is there a way to configure
kotlinOptions
from
subprojects
in the root build.gradle, and not have them be overwritten by module-specific configs? e.g., I have an MPP where the root project contains:
Copy code
subprojects {
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions.freeCompilerArgs += ['-Xprogressive']
    }
}
and I want that setting to be respected in each of the platform modules. Then, my JS build.gradle has:
Copy code
[compileKotlin2Js, compileTestKotlin2Js]*.configure {
    kotlinOptions {
        metaInfo = true
        sourceMap = true
        sourceMapEmbedSources = "always"
        moduleKind = 'umd'
        // freeCompilerArgs += ['-Xprogressive']
    }
}
If I leave that freeCompilerArgs line commented, it seems like the setting doesn't flow through to the JS compilation step, i.e. the entire
kotlinOptions
config in the JS subproject is being overwritten, and if
freeCompilerArgs
isn't present then they're not applied to the JS build.