Checkstyle plugin still generates xml report with disabled option

plugins {
    id 'java'
    id 'checkstyle'
}

repositories {
    jcenter()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

tasks.withType(Checkstyle) {
    reports {
        xml.enabled false
        html.enabled true
    }
}

Gradle Version: 2.14
Operating System: Windows 10
Didn’t tried other Gradle versions.

FTR, this behavior is present since 2.10 in which support for the HTML report was introduced.

The HTML report is the result of an XSLT transformation of the XML one.
That’s why the XML file is generated.

But you are right, when xml.enabled = false the XML report should not be part of the outputs in build/reports/checkstyle. Maybe we should put it in build/tmp/checkstyle instead.

I filled GRADLE-3490 to track this and added a corresponding integration test.
That’s a good candidate for a pull-request if you have the time.