Skip to content

Commit 9eadd40

Browse files
authored
Fix Gradle 8.11+ and typesafe project accessors (#6316)
1 parent baf9f89 commit 9eadd40

File tree

1 file changed

+3
-1
lines changed
  • libraries/apollo-gradle-plugin-external/src/main/kotlin/com/apollographql/apollo/gradle/internal

1 file changed

+3
-1
lines changed

libraries/apollo-gradle-plugin-external/src/main/kotlin/com/apollographql/apollo/gradle/internal/utils.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ internal fun List<InputFile>.isolate(): List<Any> = flatMap { listOf(it.normaliz
2828

2929

3030
internal fun ProjectDependency.getPathCompat(): String {
31-
val method = this::class.java.getDeclaredMethod("getPath")
31+
val method = this::class.java.methods.firstOrNull {
32+
it.name == "getPath" && it.parameters.isEmpty()
33+
}
3234
return if (method != null) {
3335
// Gradle 8.11+ path
3436
// See https://docs.gradle.org/8.11/userguide/upgrading_version_8.html#deprecate_get_dependency_project

0 commit comments

Comments
 (0)