Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Use Simple FileTree/FileCollection instead of ConfigurableFileTree
Browse files Browse the repository at this point in the history
We were never dependant on that particular class and it seems like applying other plugins change the implementation class.

Fixes #199
  • Loading branch information
tasomaniac committed Nov 8, 2019
1 parent 239a29e commit 92dd64b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package com.novoda.staticanalysis.internal.findbugs

import com.novoda.staticanalysis.Violations
import com.novoda.staticanalysis.internal.CodeQualityConfigurator
import com.novoda.staticanalysis.internal.CollectViolationsTask
import org.gradle.api.Action
import org.gradle.api.DomainObjectSet
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.file.ConfigurableFileTree
import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileTree
import org.gradle.api.plugins.quality.FindBugs
import org.gradle.api.plugins.quality.FindBugsExtension
import org.gradle.api.tasks.SourceSet
Expand Down Expand Up @@ -99,7 +98,7 @@ class FindbugsConfigurator extends CodeQualityConfigurator<FindBugs, FindBugsExt
}

private FileCollection getAndroidClasses(javaCompile, List<String> includes) {
includes.isEmpty() ? project.files() : project.fileTree(javaCompile.destinationDir).include(includes) as ConfigurableFileTree
includes.isEmpty() ? project.files() : project.fileTree(javaCompile.destinationDir).include(includes) as FileCollection
}

@Override
Expand Down Expand Up @@ -140,10 +139,10 @@ class FindbugsConfigurator extends CodeQualityConfigurator<FindBugs, FindBugsExt
}

private FileCollection createClassesTreeFrom(SourceSet sourceSet, List<String> includes) {
return sourceSet.output.classesDirs.inject(null) { ConfigurableFileTree cumulativeTree, File classesDir ->
return sourceSet.output.classesDirs.inject(null) { FileTree cumulativeTree, File classesDir ->
def tree = project.fileTree(classesDir)
.builtBy(sourceSet.output)
.include(includes) as ConfigurableFileTree
.include(includes) as FileCollection
cumulativeTree?.plus(tree) ?: tree
}
}
Expand Down

0 comments on commit 92dd64b

Please sign in to comment.