Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle deprecation warning for Report.enabled #17

Open
justfortherec opened this issue Sep 3, 2021 · 4 comments
Open

Gradle deprecation warning for Report.enabled #17

justfortherec opened this issue Sep 3, 2021 · 4 comments

Comments

@justfortherec
Copy link

justfortherec commented Sep 3, 2021

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.

@manuelprinz
Copy link

manuelprinz commented Aug 13, 2022

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
Copy link

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

@davinkevin
Copy link

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

@hosamaly
Copy link

There is a fix in #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants