I have a project with multiple subprojects that use the kotlin-multiplatform plugin or the kotlin-js plugin and I want to use the experimental unsigned types in all of them.
So far I've tried this, which doesn't work:
subprojects {
    tasks.withType<KotlinCompile>().all {
        kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalUnsignedTypes"
    }
    extensions.findByType<KotlinMultiplatformExtension>()?.sourceSets {
        all {
            languageSettings.useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
        }
    }
}
Is there a way to add the kotlin compiler arg -Xopt-in=kotlin.ExperimentalUnsignedTypes to all subprojects in Gradle?
 
     
    