bmuschko / gradle-clover-plugin

Gradle plugin for generating a code coverage report using Clover
Apache License 2.0
74 stars 49 forks source link

Can't get console output for coverage #148

Closed cherrymar closed 4 years ago

cherrymar commented 4 years ago

Hi,

I'm trying to get console output for the coverage. The html version seems to work fine, but even though I have set xml to true, it doesn't show anything in my console/terminal. I'm trying to get console output so that I can enable the coverage badge on gitlab. What should I do? Any suggestions on how to debug this? I'm wondering if somehow it can't find the xml file? The logger.info output shows up fine. Thank you.

This is what my clover.gradle file looks like


apply plugin: 'com.bmuschko.clover'

dependencies { clover 'org.openclover:clover:4.2.0' }

// clover settings: https://github.com/bmuschko/gradle-clover-plugin clover { excludes = [ '*/configuration/', '**/Constants.java' ]

testIncludes = ['**/*Test*.java']

targetPercentage = '45%'

report {
    html = true
    pdf = false
    xml = true
    columns {
        coveredStatements format: 'longbar', min: '40'
        coveredBranches format: 'longbar', min: '40'
        coveredMethods format: 'longbar', min: '40'
        totalPercentageCovered format: '%', scope: 'package'
    }
}

}

test.finalizedBy(project.tasks.cloverGenerateReport) logger.info('DONE Configuring Clover Plugin')

Alex-Vol-SV commented 4 years ago

The console output was added to the plugin in the latest versions, you did not specify which version of the Clover plugin you are using.

You must be using 2.2.4 or later version of the Clover plugin to have the Console Coverage messages when using XML reports.

Alex-Vol-SV commented 4 years ago

Closing as I assume you are now able to use the 2.2.4 or later versions which introduced the Console Coverage messages when using XML reports.