@@ -7,6 +7,7 @@ import org.gradle.api.GradleException
7
7
import org.gradle.api.JavaVersion
8
8
import org.gradle.api.file.ConfigurableFileCollection
9
9
import org.gradle.api.file.FileCollection
10
+ import org.gradle.api.file.FileTree
10
11
import org.gradle.api.file.FileTreeElement
11
12
import org.gradle.api.file.FileType
12
13
import org.gradle.api.file.ProjectLayout
@@ -119,15 +120,29 @@ abstract class BaseKtLintCheckTask @Inject constructor(
119
120
.from({ sourceFiles.asFileTree.matching(patternFilterable) })
120
121
121
122
/* *
122
- * Sets the source from this task.
123
+ * Sets the source for this task from a given file tree.
124
+ *
125
+ * Filters from configuration will be applied
123
126
*
124
127
* @param source given source objects will be evaluated as per [org.gradle.api.Project.file].
125
128
*/
126
- fun setSource (source : Any ): BaseKtLintCheckTask {
127
- sourceFiles = objectFactory.fileCollection().from(source)
129
+ fun setSource (source : FileTree ): BaseKtLintCheckTask {
130
+ sourceFiles = objectFactory
131
+ .fileCollection()
132
+ .from({ source.matching(patternFilterable) })
128
133
return this
129
134
}
130
135
136
+ /* *
137
+ * Sets the source for this task from a given file collection.
138
+ *
139
+ * Filters from configuration will be applied
140
+ *
141
+ * @param source given source objects will be evaluated as per [org.gradle.api.Project.file].
142
+ */
143
+ fun setSource (source : FileCollection ): BaseKtLintCheckTask =
144
+ setSource(source.asFileTree)
145
+
131
146
/* *
132
147
* Adds some source to this task.
133
148
*
0 commit comments