Skip to content

Commit

Permalink
Remove references to Gradle-internal FileResolver
Browse files Browse the repository at this point in the history
It was already unused.
  • Loading branch information
ejona86 committed Aug 4, 2022
1 parent 519849d commit 335e6e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.file.ProjectLayout
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.logging.LogLevel
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.Provider
Expand Down Expand Up @@ -107,7 +106,6 @@ public abstract class GenerateProtoTask extends DefaultTask {
private ImmutableList<String> flavors
private String buildType
private boolean isTestVariant
private FileResolver fileResolver
private final Provider<Boolean> isAndroidProject = providerFactory.provider { Utils.isAndroidProject(project) }
private final Provider<Boolean> isTestProvider = providerFactory.provider {
if (Utils.isAndroidProject(project)) {
Expand Down Expand Up @@ -291,11 +289,6 @@ public abstract class GenerateProtoTask extends DefaultTask {
this.buildType = buildType
}

void setFileResolver(FileResolver fileResolver) {
checkInitializing()
this.fileResolver = fileResolver
}

@Internal("Inputs tracked in getSourceFiles()")
SourceSet getSourceSet() {
Preconditions.checkState(!isAndroidProject.get(),
Expand Down
10 changes: 0 additions & 10 deletions src/main/groovy/com/google/protobuf/gradle/ProtobufPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,11 @@ import org.gradle.api.attributes.LibraryElements
import org.gradle.api.attributes.Usage
import org.gradle.api.file.FileCollection
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.file.FileResolver
import org.gradle.api.plugins.AppliedPlugin
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.SourceSet
import org.gradle.util.GradleVersion

import javax.inject.Inject

/**
* The main class for the protobuf plugin.
*/
Expand All @@ -71,16 +68,10 @@ class ProtobufPlugin implements Plugin<Project> {
'kotlin',
]

private final FileResolver fileResolver
private Project project
private ProtobufExtension protobufExtension
private boolean wasApplied = false

@Inject
public ProtobufPlugin(FileResolver fileResolver) {
this.fileResolver = fileResolver
}

void apply(final Project project) {
if (GradleVersion.current() < GradleVersion.version("5.6")) {
throw new GradleException(
Expand Down Expand Up @@ -346,7 +337,6 @@ class ProtobufPlugin implements Plugin<Project> {
return project.tasks.create(generateProtoTaskName, GenerateProtoTask) {
description = "Compiles Proto source for '${sourceSetOrVariantName}'"
outputBaseDir = outDir
it.fileResolver = this.fileResolver
sourceSets.each { sourceSet ->
addSourceFiles(sourceSet.proto)
SourceDirectorySet protoSrcDirSet = sourceSet.proto
Expand Down

0 comments on commit 335e6e8

Please sign in to comment.