Hello, any idea how to apply `explicitApi` to main...
# gradle
m
Hello, any idea how to apply
explicitApi
to main only (but not for test) using
freeCompilerArgs
?
It’s in internal plugin, but same approach can be applied to build.gradle
m
Thank you! this seems to be working. However, not sure why Intellij doesn’t pick up the flag, and not show errors or warnings!
i
Idea works for me, high lighting errors in main, and not in test
m
I am doing something wrong then!
My build.gradle.kts is very simple though!
Copy code
plugins {
    kotlin("jvm")
    id("java-library")
}

group = Library.group
version = Library.version

dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
    testImplementation(kotlin("test-junit"))
}


tasks.named<KotlinCompile>("compileKotlin") { // for main source set only
    kotlinOptions {
        freeCompilerArgs += listOf("-Xexplicit-api=strict")
    }
}
i
Yea, LGTM
🙏 1