views:

30

answers:

2

Grails coberatura plugin is doing code coverage on BuildConfig.groovy. I have tried all these configurations on BuildConfiguration to exclude BuildConfiguration from code coverage have tried all these.

coverage {
    exclusions = [
        '*/BuildConfig*',
        'BuildConfig*',
        "BuildConfig*",
        'BuildConfig',
        'BuildConfig*'
    ]
}
A: 

'**/BuildConfig*' works.

The excludes list uses the same pattern matching rules as ant. To match any path prefix, use the double star; a single star only matches one directory deep.

ataylor
+3  A: 

try this to exclude most of the unneeded files

coverageExcludes = [
        "**/*BootStrap*",
        "Config*",
        "**/conf/**",
        "**/*DataSource*",
        "**/*resources*",
        "**/*UrlMappings*",
        "**/*Tests*",
        "**/grails/test/**",
        "**/org/codehaus/groovy/grails/**",
        "**/PreInit*",
        "*GrailsPlugin*"
]
Aaron Saunders