Josh Friend
07/09/2025, 2:08 PMOpt-in requirement marker XXX is unresolved
warnings? You apparently can't add opt-in args after dependency resolution because freeCompilerArgs is frozen so it makes convention plugins quite annoying because you have to either @OptIn
everywhere in source, or deal with hundreds of useless build warnings if you opt in with your conventions plugins.tapchicoma
07/09/2025, 2:15 PMJosh Friend
07/09/2025, 2:18 PMJosh Friend
07/09/2025, 2:26 PMconfigurations.configureEach { c ->
if (c.isCanBeResolved) {
c.dependencies.whenObjectAdded {
if (it is ExternalDependency) {
if (it.group == "androidx.compose.animation") {
tasks.withType(KotlinCompilationTask::class.java).configureEach { task ->
// We only want to apply this compiler arg for modules that use compose
with(task.compilerOptions.freeCompilerArgs) {
add("-opt-in=androidx.compose.animation.ExperimentalAnimationApi")
add("-opt-in=androidx.compose.animation.ExperimentalSharedTransitionApi")
}
}
}
if (it.group == "kotlinx.coroutines") {
tasks.withType(KotlinCompilationTask::class.java).configureEach { task ->
// We only want to apply this compiler arg for modules that use compose
with(task.compilerOptions.freeCompilerArgs) {
add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi")
add("-opt-in=kotlinx.coroutines.FlowPreview")
}
}
}
}
}
}
}
tapchicoma
07/09/2025, 2:31 PMJosh Friend
07/09/2025, 2:53 PM-Xsuppress-warning=DEPRECATION
does nothing