gradle-print-coverage-plugin icon indicating copy to clipboard operation
gradle-print-coverage-plugin copied to clipboard

Gradle deprecation warning for Report.enabled

Open justfortherec opened this issue 3 years ago • 4 comments

When upgrading my local gradle setup to version 3.7 I noticed this warning:

The Report.enabled property has been deprecated. This is scheduled to be removed in Gradle 8.0. Please use the required property instead. See https://docs.gradle.org/7.2/dsl/org.gradle.api.reporting.Report.html#org.gradle.api.reporting.Report:enabled for more detail
s.
        at org.gradle.api.reporting.internal.SimpleReport.setEnabled(SimpleReport.java:108)
        at org.gradle.api.reporting.internal.TaskGeneratedSingleFileReport_Decorated.setEnabled(Unknown Source)
        at org.gradle.api.reporting.internal.TaskGeneratedSingleFileReport_Decorated.enabled(Unknown Source)
        at org.gradle.api.reporting.internal.TaskGeneratedSingleFileReport_Decorated$enabled.call(Unknown Source)
        at de.jansauer.printcoverage.PrintCoveragePlugin$_apply_closure1$_closure3.doCall(PrintCoveragePlugin.groovy:13)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)

[remaining stacktrace is omitted for brevity]

The culprit seems to be https://github.com/jansauer/gradle-print-coverage-plugin/blob/master/src/main/groovy/de/jansauer/printcoverage/PrintCoveragePlugin.groovy#L13

The proposed solution is to use required instead of enabled.

justfortherec avatar Sep 03 '21 11:09 justfortherec

Yes, the JaCoCo plugin also uses task/configuration avoidance now. This is an issue also in other places, see #18 for example. In this case, the Gradle version used for this plugin needs to be updated to at least 6.1 in order to have this new API available.

manuelprinz avatar Aug 13 '22 11:08 manuelprinz

P.S.: I also assume you mean version 7.3, right?

manuelprinz avatar Aug 13 '22 11:08 manuelprinz

I have to drop this plugin due to its incompatibility with Gradle 8.0, with the following error:

* What went wrong: |  
  | An exception occurred applying plugin request [id: 'org.gradle.jacoco'] |  
  | > Failed to apply plugin 'org.gradle.jacoco'. |  
  | > Could not create task ':backend:jacocoTestReport'. |  
  | > No signature of method: org.gradle.api.reporting.internal.TaskGeneratedSingleFileReport.enabled() is applicable for argument types: (Boolean) values: [true]

Build Scan

davinkevin avatar Feb 14 '23 20:02 davinkevin

There is a fix in #22

hosamaly avatar May 26 '24 15:05 hosamaly