Hi all - is there a way to only enable new explici...
# android
x
Hi all - is there a way to only enable new explicit api mode for main src set? currently it seems to be applied for all the src sets - even tests
b
I'm not sure, but instead of using
Copy code
kotlin {
    explicitApi()
}
you can configure it via KotlinCompile task:
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    // filter test tasks here
    kotlinOptions {
        freeCompilerArgs += ["-Xexplicit-api=strict"]
    }
}
so you will be able to filter test tasks
x
Thanks for your reply. Is there a way to actually filter tasks from test tasks? 🤔
p
Did that actually work for you? To me android studio 7 still shows the warnings on test classes