scoverage / gradle-scoverage

A plugin to enable the use of Scoverage in a gradle Scala project
Apache License 2.0
53 stars 38 forks source link

More lazy configuration #177

Open mwos-sl opened 2 years ago

mwos-sl commented 2 years ago

Currently many things are initiated during configuration lifecycle phase. As a result applying the plugin extends configuration time of a whole project, which is a big deal for big projects with hundreds of modules.

Instead, as much as possible rsources should be calculated during task execution (e.g. in doFirst block). Example: ScoverageRunner is created always, even if none of scoverage tasks are invoked from the command line: https://github.com/scoverage/gradle-scoverage/blob/master/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L83

mwos-sl commented 2 years ago

Same thing for:

def checker = new CoverageChecker(project.logger)

it could be easily moved to doLast { ... }