user9093584
user9093584

Reputation: 3

How to ignore some class path from gradle scoverage coverage reports?

how testScoverage task can be configured in Gradle Scoverage to exclude some class from test coverage. In sbt scoverage that can be achieved by adding in settings coverageExcludedPackages := ";Reverse.*;.AuthService.;models\.data\..* How to achieve same in gradle scoverage

Upvotes: 0

Views: 1257

Answers (1)

M.Ricciuti
M.Ricciuti

Reputation: 12086

It's not described in this plugin documentation, but this plugin exposes a Gradle extension named scoverage of type ScoverageExtension that you can use to configure the plugin, see available properties in the extension source code.

You could configure excluded packages as follow, for example:

scoverage{
    excludedPackages = ["Reverse.*",".AuthService." , "models.data"]
      // TODO : configure patterns correctly, this is only a dummy example
}

Note: I did not test this plugin myself, but looking at the source code, this is how it's supposed to work.

Upvotes: 3

Related Questions