DEV Community


Discussion on: Grails and Sonarqube

ukbarr profile image

hi thx for the article, it was very helpful.

what's in your cloverXtraConfig.groovy & AbortIfNotCoverage.groovy files .

Cheers !

jagedn profile image
Jorge Eψ=Ĥψ Author

true, I forgotten them

I use cloverXtraConfig.groovy to remove CompileStatic and TypeChecked annotations:

withConfig(configuration) {
    inline(phase: 'CONVERSION') { source, context, classNode ->
        source.ast.unit.classes.each { clazz ->
            clazz.annotations.removeAll { annotation -> in ['CompileStatic', 'TypeChecked'] }

and in AbortIfNoCoverage.groovy I parse the final xml to calculate the average cobertura and if it's under a limit throw a exception to abort the pipeline

Forem Open with the Forem app