policeman-tools / forbidden-apis

Policeman's Forbidden API Checker
Apache License 2.0
339 stars 34 forks source link

compatibility with Gradle 9.x #245

Closed sdavids closed 8 months ago

sdavids commented 8 months ago
> Task :forbiddenApisMain
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation
The org.gradle.api.plugins.Convention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#deprecated_access_to_conventions

gradle/libs.versions.toml

[plugins]
forbiddenapis = "de.thetaphi.forbiddenapis:3.6"
uschindler commented 8 months ago

No idea where this class is referenced. It's just standard plugin code.

https://github.com/policeman-tools/forbidden-apis/blob/6a4204546e7e56001ec96ef1c7477d975ab26e56/src/main/groovy/de/thetaphi/forbiddenapis/gradle/ForbiddenApisPlugin.groovy

sdavids commented 8 months ago

https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#java_convention_deprecation

https://github.com/policeman-tools/forbidden-apis/blob/6a4204546e7e56001ec96ef1c7477d975ab26e56/src/main/groovy/de/thetaphi/forbiddenapis/gradle/ForbiddenApisPlugin.groovy#L50-L51

You might want to check all project.XXX usages.

uschindler commented 8 months ago

I am not sure if I have an idea how to fix this. So it could be that I won't have time to fix this for next version coming out with Java 22 next week.

Uwe

uschindler commented 8 months ago

I will delay changes to after the Java 22 compatibility release. Sorry. I don't feel this is too urgent.

uschindler commented 8 months ago

Hi, I fixed the problem in this PR: #247

sdavids commented 8 months ago

Will verify with 3.7.

uschindler commented 8 months ago

Thanks! I did this already with Jenkins: https://jenkins.thetaphi.de/job/Forbidden-APIs-testonly-GradleLatest-Linux/119/console

uschindler commented 8 months ago

In addition I also changed the code to fetch sourceSets directly from Java extension, if available (after Gradle 7.1). Tis should make it future proof. Normally there should also be a warning poping up, but it isn't.

uschindler commented 8 months ago

See 068b0ca72b4bdc5054467e8f1b5a36c8b98694bf

uschindler commented 8 months ago

Forbiddenapis v3.7 was released a minute ago.

sdavids commented 8 months ago

verified with v3.7