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

Report on specific module in a multi-module project without normal compilation fails #112

Closed eyalroth closed 5 years ago

eyalroth commented 5 years ago

If one attempts to reportScoverage on a specific module in a multi-module project without normal compilation, the compilation will fail in case this specific module depends on another module in the project.

For instance, in a multi-module project, a module depends on common, trying to run the following will fail in compilation: gradle :a:reportScoverage -x compileScala

The culprit is in the code which is supposed to make sure that the scoverage compilation output directory will be build/classes/scala/main instead of build/classes/scala/scoverage when normal compilation is omitted.

It only does this when the reportScoverage task is in the graph of that module; in the aforementioned example, the plugin will fail to detect that the (scoverage) compilation of the common module needs to adjust its output directory since the :common:reportScoverage task is not in the task graph.

Mrfaisa6 commented 2 years ago

https://github.com/scoverage/gradle-scoverage/issues/112#issue-491488878