Shan
09/25/2020, 5:53 AMbuildSrc
folder can no longer access the Gradle api. For example:
//directory: buildsrc/src/main/kotlin/Util.kt
import org.gradle.api.*
fun Project.foo() = doBar()
Project
comes up as unresolved. I recently updated to Kotlin 1.4.10 and Gradle 6.6.1, and this is a multi-module project. The `buildSrc`'s build.gradle.kts
file is as it's always been, no changes:
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}
Any idea what might have caused this, and how I might resolve it? When I try to access project.foo()
from a separate module's build.gradle.kts
file, it hits me with a:
Overload resolution ambiguity. All these functions match.
error, and then when I try to go to the declaration it wants me to choose between the actual file that it's declared in (buildSrc/src/main/kotlin/Util.kt
), and the decompiled java class file.
I suspect some change was made in Gradle 6.6.1 with buildSrc dependencies or something but cannot for the life of me figure out what that might be that could be causing this. I've tried explicitly adding the gradleApi()
dependency as well, but no dice. Any help would be appreciated!no
09/25/2020, 12:39 PM