apply plugin: 'com.android.application'
apply plugin: 'android-checkstyle'
checkstyle {
toolVersion = '7.6'
}
tasks.withType(Checkstyle) {
ignoreFailures = true
showViolations = false
source 'src/main', 'src/release', 'src/debug'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
reports {
xml.enabled true
xml {
destination "${project.buildDir.absolutePath}/reports/checkstyle/checkstyle-report.xml" // this is okay
}
html.enabled true
html {
destination "${project.buildDir.absolutePath}/reports/checkstyle/checkstyle-report.html"
}
}
classpath = files()
configFile = file("config/checkstyle/checkstyle.xml")
configProperties.lineWidth = 120
}
5:53 PM Gradle build finished in 7s 43ms
5:53 PM Gradle code metrics: collection error >> file element is not part of the project in checkstyle report : /Volumes/Workspace/HelixTrails/src/HelixAndroid/app/build/reports/checkstyle/checkstyle-report.xml
5:53 PM Android-Gradle metric plugin: report collection failed : Checkstyle
5:53 PM Android-Gradle metric plugin: result collection failed```
I'm using AndroidStudio 3.0.1
Gradle v4.6
AndroidGradlePlugin v3.0.0
I also tried to change:
```apply plugin: 'android-checkstyle'```
to:
```apply plugin: 'checkstyle'```
And it gets even worst. The checkstyle tasks are not even created.