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

code coverage generation failing when using gradle plugin 8.0.3 #204

Closed MuthuVignesh91 closed 5 months ago

MuthuVignesh91 commented 6 months ago

When trying to generate scoverage.xml the task is failing

command: ./gradlew reportScoverage

Error: `./gradlew reportScoverage

Task :cap-gds:extractIncludeScoverageProto FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1s 31 actionable tasks: 5 executed, 26 up-to-date `

maiflai commented 5 months ago

It seems that the upstream scoverage scalac plugin 2.0.8 is not published for the newer scala compiler version 2.13.12.

Please configure your build to use a version that has been published? I think that 2.1.1 is the current release version.

https://repo.maven.apache.org/maven2/org/scoverage/scalac-scoverage-plugin_2.13.12/maven-metadata.xml

scoverage.scoverageVersion = '2.1.1'
MuthuVignesh91 commented 5 months ago

@maiflai, it worked when added the scoverage.scoverageVersion as part of the configuration. But isn't it supposed to be working by default?

maiflai commented 5 months ago

Sorry, I'm not sure that benefit outweighs cost.

If you are upgrading your scala compiler version then currently the upstream scoverage scala compiler plugin version also needs to change, but this doesn't require that I publish a new version of this plugin because the gradle plugin is (generally) forward-compatible.

I think you still have to change your build regardless, whether or not I publish a new version of this plugin.

The change is either

...
    id 'org.scoverage' version '8.0.X+1'
...

or

scoverage.scoverageVersion = '2.1.X+1'

I think the second is more explicit as to the exact change involved.

You might consider asking the upstream maintainers to publish old versions for new scalac versions, and then neither you nor I would need to change anything related to scoverage?

Stu,

MuthuVignesh91 commented 5 months ago

Noted with tanks. This issue can be clsoed