loading...

re: Grails and Sonarqube VIEW POST

TOP OF THREAD FULL DISCUSSION
re: hi thx for the article, it was very helpful. what's in your cloverXtraConfig.groovy & AbortIfNotCoverage.groovy files . Cheers !
 

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 -> annotation.classNode.name 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

code of conduct - report abuse