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

Commit

Permalink
Merge pull request #109 from tasomaniac/ignore-kotlin-in-java-tools
Browse files Browse the repository at this point in the history
Exclude kotlin files by default on java code quality tools.
  • Loading branch information
rock3r committed Jul 9, 2018
2 parents 75de67e + ee34ef0 commit 569f13e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Expand Up @@ -83,7 +83,10 @@ abstract class CodeQualityConfigurator<T extends SourceTask, E extends CodeQuali
protected abstract void configureAndroidVariant(variant)

protected void configureJavaProject() {
project.tasks.withType(taskClass) { task -> sourceFilter.applyTo(task) }
project.tasks.withType(taskClass) { task ->
sourceFilter.applyTo(task)
task.exclude '**/*.kt'
}
}

protected abstract Class<T> getTaskClass()
Expand Down
Expand Up @@ -59,6 +59,7 @@ class CheckstyleConfigurator extends CodeQualityConfigurator<Checkstyle, Checkst
description = "Run Checkstyle analysis for ${sourceSet.name} classes"
source = sourceSet.java.srcDirs
classpath = files("$buildDir/intermediates/classes/")
exclude '**/*.kt'
}
}
sourceFilter.applyTo(task)
Expand Down
Expand Up @@ -64,6 +64,7 @@ class FindbugsConfigurator extends CodeQualityConfigurator<FindBugs, FindBugsExt
description = "Run FindBugs analysis for ${variant.name} classes"
source = androidSourceDirs
classpath = variant.javaCompile.classpath
exclude '**/*.kt'
}
sourceFilter.applyTo(task)
task.conventionMapping.map("classes") {
Expand All @@ -90,6 +91,7 @@ class FindbugsConfigurator extends CodeQualityConfigurator<FindBugs, FindBugsExt
List<String> includes = createIncludePatterns(task.source, sourceDirs)
getJavaClasses(sourceSet, includes)
})
task.exclude '**/*.kt'
}
}
}
Expand Down
Expand Up @@ -62,6 +62,7 @@ class PmdConfigurator extends CodeQualityConfigurator<Pmd, PmdExtension> {
task.with {
description = "Run PMD analysis for ${sourceSet.name} classes"
source = sourceSet.java.srcDirs
exclude '**/*.kt'
}
}
sourceFilter.applyTo(task)
Expand Down

0 comments on commit 569f13e

Please sign in to comment.