Search in sources :

Example 76 with SourceSet

use of org.gradle.api.tasks.SourceSet in project gradle by gradle.

the class CodeNarcPlugin method configureForSourceSet.

@Override
protected void configureForSourceSet(final SourceSet sourceSet, CodeNarc task) {
    task.setDescription("Run CodeNarc analysis for " + sourceSet.getName() + " classes");
    SourceDirectorySet groovySourceSet = sourceSet.getExtensions().getByType(GroovySourceDirectorySet.class);
    task.setSource(groovySourceSet.matching(filter -> filter.include("**/*.groovy")));
}
Also used : SourceDirectorySet(org.gradle.api.file.SourceDirectorySet) SerializableLambdas.action(org.gradle.api.internal.lambdas.SerializableLambdas.action) ConventionMapping(org.gradle.api.internal.ConventionMapping) File(java.io.File) SourceSet(org.gradle.api.tasks.SourceSet) Configuration(org.gradle.api.artifacts.Configuration) ProviderFactory(org.gradle.api.provider.ProviderFactory) Provider(org.gradle.api.provider.Provider) ProjectLayout(org.gradle.api.file.ProjectLayout) GroovyBasePlugin(org.gradle.api.plugins.GroovyBasePlugin) GroovySourceDirectorySet(org.gradle.api.tasks.GroovySourceDirectorySet) RegularFile(org.gradle.api.file.RegularFile) AbstractCodeQualityPlugin(org.gradle.api.plugins.quality.internal.AbstractCodeQualityPlugin) Plugin(org.gradle.api.Plugin) SourceDirectorySet(org.gradle.api.file.SourceDirectorySet) GroovySourceDirectorySet(org.gradle.api.tasks.GroovySourceDirectorySet)

Aggregations

SourceSet (org.gradle.api.tasks.SourceSet)76 File (java.io.File)34 SourceSetContainer (org.gradle.api.tasks.SourceSetContainer)31 Configuration (org.gradle.api.artifacts.Configuration)26 Project (org.gradle.api.Project)24 ConfigurationContainer (org.gradle.api.artifacts.ConfigurationContainer)23 Task (org.gradle.api.Task)18 List (java.util.List)17 JavaPluginConvention (org.gradle.api.plugins.JavaPluginConvention)17 JavaPlugin (org.gradle.api.plugins.JavaPlugin)16 JavaPluginExtension (org.gradle.api.plugins.JavaPluginExtension)16 JavaCompile (org.gradle.api.tasks.compile.JavaCompile)16 Plugin (org.gradle.api.Plugin)15 FileCollection (org.gradle.api.file.FileCollection)15 Action (org.gradle.api.Action)14 TaskProvider (org.gradle.api.tasks.TaskProvider)14 Set (java.util.Set)13 Jar (org.gradle.api.tasks.bundling.Jar)13 Collections (java.util.Collections)12 Collectors (java.util.stream.Collectors)12