Skip to content

Commit

Permalink
Cleanup left-overs of #719
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Jan 20, 2025
1 parent 2810499 commit 8ac7409
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/groovy/com/google/protobuf/gradle/ProtobufExtract.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import org.gradle.api.file.FileSystemLocation
import org.gradle.api.file.FileTree
import org.gradle.api.logging.Logger
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.ProviderFactory
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputDirectory
Expand Down Expand Up @@ -99,9 +98,6 @@ abstract class ProtobufExtract extends DefaultTask {
@Inject
protected abstract ObjectFactory getObjectFactory()

@Inject
protected abstract ProviderFactory getProviderFactory()

private ArchiveActionFacade instantiateArchiveActionFacade() {
if (GradleVersion.current() >= GradleVersion.version("6.0")) {
// Use object factory to instantiate as that will inject the necessary service.
Expand All @@ -114,14 +110,10 @@ abstract class ProtobufExtract extends DefaultTask {
boolean warningLogged = false
ArchiveActionFacade archiveFacade = this.archiveActionFacade
Logger logger = this.logger
// Provider.map seems broken for excluded tasks. Add inputFiles with all contents excluded for
// the dependency it provides, but then provide the files we actually care about in our own
// provider. https://github.com/google/protobuf-gradle-plugin/issues/550
PatternSet protoFilter = new PatternSet().include("**/*.proto")
return objectFactory.fileCollection()
.from(inputFiles.filter { false })
.from(
inputFiles.getElements().map { elements ->
PatternSet protoFilter = new PatternSet().include("**/*.proto")
Set<Object> protoInputs = [] as Set
for (FileSystemLocation e : elements) {
File file = e.asFile
Expand Down Expand Up @@ -151,7 +143,7 @@ abstract class ProtobufExtract extends DefaultTask {
|| file.path.endsWith('.tgz')) {
protoInputs.add(archiveFacade.tarTree(file.path).matching(protoFilter))
} else {
logger.debug "Skipping unsupported file type (${file.path});" +
logger.debug "Skipping unsupported file type (${file.path}); " +
"handles only jar, tar, tar.gz, tar.bz2 & tgz"
}
}
Expand Down

0 comments on commit 8ac7409

Please sign in to comment.