How to make Gradle build produce HTML test report instead of XML default?

smeeb picture smeeb · Sep 21, 2014 · Viewed 35.5k times · Source

Currently I build my Gradle app by running gradle clean build. This exercises JUnit tests and produces XML test results in my project under build/test-results. I would like to configure my build.gradle file to produce HTML test results (instead of the XML default). Is this possible, if so, how?

Answer

Peter Niederwieser picture Peter Niederwieser · Sep 21, 2014
test {
    reports {
        junitXml.enabled = false
        html.enabled = true
    }               
}

To figure this out on your own, start from Test in the Gradle Build Language Reference, then drill down into (the type for) reports.