From a80bf81236c82d38fb8c0cb53198792fc59654e2 Mon Sep 17 00:00:00 2001 From: yifeizhuang Date: Fri, 7 Jul 2023 15:15:37 -0700 Subject: [PATCH] stop using configuration Configuration#fileCollection(Dependency...), soon to be deprecated (#716) The files(Dependency...) method filters the contents of the configuration to only include files from the provided dependencies and it's transitive dependencies. Since there is only one dependency in the configuration, using this method is unnecessary. --- .../groovy/com/google/protobuf/gradle/ToolsLocator.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/com/google/protobuf/gradle/ToolsLocator.groovy b/src/main/groovy/com/google/protobuf/gradle/ToolsLocator.groovy index e3b5627a..de70447a 100644 --- a/src/main/groovy/com/google/protobuf/gradle/ToolsLocator.groovy +++ b/src/main/groovy/com/google/protobuf/gradle/ToolsLocator.groovy @@ -33,7 +33,6 @@ import groovy.transform.CompileStatic import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.Project import org.gradle.api.artifacts.Configuration -import org.gradle.api.artifacts.Dependency /** * Holds locations of all external executables, i.e., protoc and plugins. @@ -108,7 +107,7 @@ class ToolsLocator { classifier:classifier ?: osdetector.classifier, ext:extension ?: 'exe', ] - Dependency dep = project.dependencies.add(config.name, notation) - locator.resolve(config.fileCollection(dep), "$groupId:$artifact:$version".toString()) + project.dependencies.add(config.name, notation) + locator.resolve(config, "$groupId:$artifact:$version".toString()) } }