From 8a2d430f7b24c6a58548a826db7e4b74a844277e Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 24 May 2023 12:26:01 -0700 Subject: [PATCH] Use minus for filtering instead of filter with a predicate. --- .../kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt b/src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt index fe1cf7ce..46c69304 100644 --- a/src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt +++ b/src/main/kotlin/build/buf/gradle/ProtobufGradlePluginSupport.kt @@ -108,11 +108,7 @@ private fun Task.allProtoDirs(): List = (project.srcProtoDirs() + extractProtoDirs()).filter { project.anyProtos(it) } internal fun Project.srcProtoDirs() = - (the().flatMap { it.protoDirs(this) } + androidSrcProtoDirs()).filter { - !extractProtoDirs().contains( - it - ) - } + (the().flatMap { it.protoDirs(this) } + androidSrcProtoDirs()).minus(extractProtoDirs()) private fun Project.androidSrcProtoDirs() = extensions.findByName("android")