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

Fix deprecation warning "Internal API constructor TaskReportContainer(Class<T>, Task) has been deprecated" #36

Closed
aaschmid opened this issue Apr 17, 2019 · 1 comment
Assignees
Milestone

Comments

@aaschmid
Copy link
Owner

Gradle v5.1 provides a new constructor org.gradle.api.reporting.internal.TaskReportContainer#TaskReportContainer(java.lang.Class<? extends T>, org.gradle.api.Task, org.gradle.api.internal.CollectionCallbackActionDecorator) which should be used in favor of old org.gradle.api.reporting.internal.TaskReportContainer#TaskReportContainer(java.lang.Class<? extends T>, org.gradle.api.Task).

Solution: Use the super(SingleFileReport.class, task, CollectionCallbackActionDecorator.NOOP) in de.aaschmid.gradle.plugins.cpd.internal.CpdReportsImpl#CpdReportsImpl.

Challenges: This required to update the supported version to at least Gradle 5.1. As the logic is within the constructor we cannot do a version distinction here using GradleVersion.current().compareTo(...)

Another possibility to fix at least the depreaction warning is using DeprecationLogger#whileDisabled

@aaschmid aaschmid self-assigned this Apr 17, 2019
@aaschmid aaschmid added this to the next version milestone Apr 17, 2019
@aaschmid aaschmid modified the milestones: v1.4, next version Apr 21, 2019
aaschmid added a commit that referenced this issue Nov 1, 2019
easily possible as Gradle minimal version is now 5.6
@aaschmid aaschmid closed this as completed Nov 1, 2019
@aaschmid aaschmid reopened this Nov 1, 2019
@aaschmid
Copy link
Owner Author

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

No branches or pull requests

1 participant