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

Deprecated api used in gradle plugin #1773

Closed
c0nstexpr opened this issue Aug 1, 2023 · 9 comments
Closed

Deprecated api used in gradle plugin #1773

c0nstexpr opened this issue Aug 1, 2023 · 9 comments
Labels

Comments

@c0nstexpr
Copy link

related code

final JavaPluginConvention javaPluginConvention = project.getConvention().findPlugin(JavaPluginConvention.class);

log output

The Project.getConvention() method 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.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
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.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
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.2.1/userguide/upgrading_version_8.html#java_convention_deprecation

@nedtwigg nedtwigg added the bug label Aug 1, 2023
@Goooler
Copy link
Member

Goooler commented Aug 8, 2023

We noted it at #1618 (comment).

@nedtwigg
Copy link
Member

nedtwigg commented Aug 8, 2023

@c0nstexpr looks like you are using Gradle 8.2.1, which version of Spotless are you using?

@Goooler it seems to me like after we merged #1618, warnings like this shouldn't happen because it would take the other branch. Is there any chance Gradle is parsing the class files to look for API even if it isn't called?

@c0nstexpr
Copy link
Author

@c0nstexpr looks like you are using Gradle 8.2.1, which version of Spotless are you using?

@Goooler it seems to me like after we merged #1618, warnings like this shouldn't happen because it would take the other branch. Is there any chance Gradle is parsing the class files to look for API even if it isn't called?

I use the latest version Spotless. And I added org.gradle.warning.mode=all in my gradle properties

@Goooler
Copy link
Member

Goooler commented Aug 9, 2023

I don't see any warning related to Spotless after enabling org.gradle.warning.mode=all, see

Can you share your build scan?

@c0nstexpr
Copy link
Author

build scan means this one?

@Goooler
Copy link
Member

Goooler commented Aug 9, 2023

Yeah, but seems no The Project.getConvention() method has been deprecated. in your scan.

@c0nstexpr
Copy link
Author

c0nstexpr commented Aug 9, 2023

Yeah, but seems no The Project.getConvention() method has been deprecated. in your scan.

yes, I notice that. But I try again gradle sync, it just happened

Starting Gradle Daemon...
Gradle Daemon started in 1 s 345 ms
Task :buildSrc:generateExternalPluginSpecBuilders UP-TO-DATE
Task :buildSrc:extractPrecompiledScriptPluginPlugins UP-TO-DATE
Task :buildSrc:compilePluginsBlocks UP-TO-DATE
Task :buildSrc:generatePrecompiledScriptPluginAccessors UP-TO-DATE
Task :buildSrc:generateScriptPluginAdapters UP-TO-DATE
Task :buildSrc:pluginDescriptors UP-TO-DATE
Task :buildSrc:processResources UP-TO-DATE
Task :buildSrc:compileKotlin
Task :buildSrc:compileJava NO-SOURCE
Task :buildSrc:compileGroovy NO-SOURCE
Task :buildSrc:classes UP-TO-DATE
Task :buildSrc:jar UP-TO-DATE
Task :buildSrc:inspectClassesForKotlinIC

Configure project :core
Fabric Loom: 1.3.8
configuring fishology-core fabric mod project
The resolvable usage is already allowed on configuration ':core:clientRuntimeClasspath'. This behavior has been deprecated. This behavior is scheduled to be removed in Gradle 9.0. Remove the call to setCanBeResolved(true), it has no effect. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#redundant_configuration_usage_activation
at Fabric_common_gradle$6.execute(fabric-common.gradle.kts:51)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
The resolvable usage is already allowed on configuration ':core:testModClientRuntimeClasspath'. This behavior has been deprecated. This behavior is scheduled to be removed in Gradle 9.0. Remove the call to setCanBeResolved(true), it has no effect. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#redundant_configuration_usage_activation
at Fabric_common_gradle$7.execute(fabric-common.gradle.kts:60)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
remap jar archive path: D:\Documents\fishology\core\build\libs\fishology-core-0.0.1.jar

Configure project :interact
Fabric Loom: 1.3.8
configuring fishology-interact fabric mod project
The resolvable usage is already allowed on configuration ':interact:clientRuntimeClasspath'. This behavior has been deprecated. This behavior is scheduled to be removed in Gradle 9.0. Remove the call to setCanBeResolved(true), it has no effect. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#redundant_configuration_usage_activation
at Fabric_common_gradle$6.execute(fabric-common.gradle.kts:51)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
The resolvable usage is already allowed on configuration ':interact:testModClientRuntimeClasspath'. This behavior has been deprecated. This behavior is scheduled to be removed in Gradle 9.0. Remove the call to setCanBeResolved(true), it has no effect. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_8.html#redundant_configuration_usage_activation
at Fabric_common_gradle$7.execute(fabric-common.gradle.kts:60)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
remap jar archive path: D:\Documents\fishology\interact\build\libs\fishology-interact-0.0.1.jar

Task :prepareKotlinBuildScriptModel UP-TO-DATE
Task :interact:generateDLIConfig
Task :core:generateDLIConfig
Task :core:generateLog4jConfig
Task :interact:generateLog4jConfig
Task :core:generateRemapClasspath
Task :interact:generateRemapClasspath
Task :interact:configureLaunch
Task :core:configureLaunch
Task :interact:downloadAssets
Task :interact:configureClientLaunch
Task :interact:ideaSyncTask
Task :core:downloadAssets
Task :core:configureClientLaunch
Task :core:ideaSyncTask
The Project.getConvention() method 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.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
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.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
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.2.1/userguide/upgrading_version_8.html#java_convention_deprecation
Resolution of the configuration :core:detachedConfiguration1 was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. For more information, please refer to https://docs.gradle.org/8.2.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
Resolution of the configuration :interact:detachedConfiguration1 was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. For more information, please refer to https://docs.gradle.org/8.2.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
Resolution of the configuration :core:spotless865457264 was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. For more information, please refer to https://docs.gradle.org/8.2.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
Resolution of the configuration :core:spotless-1972429381 was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. For more information, please refer to https://docs.gradle.org/8.2.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
Resolution of the configuration :interact:spotless865457264 was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. For more information, please refer to https://docs.gradle.org/8.2.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
Resolution of the configuration :interact:spotless-1972429381 was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. For more information, please refer to https://docs.gradle.org/8.2.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.

BUILD SUCCESSFUL in 37s
20 actionable tasks: 12 executed, 8 up-to-date

@Goooler
Copy link
Member

Goooler commented Aug 9, 2023

They are the warning sources:

The Project.getConvention() method 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.2.1/userguide/upgrading_version_8.html#deprecated_access_to_conventions
	at org.gradle.api.internal.project.DefaultProject.getConvention(DefaultProject.java:593)
	at org.jetbrains.plugins.gradle.tooling.util.JavaPluginUtil.getJavaPluginConvention(JavaPluginUtil.java:13)
	at org.jetbrains.plugins.gradle.tooling.util.JavaPluginUtil.getSourceSetContainer(JavaPluginUtil.java:18)
...

full.txt

@nedtwigg
Copy link
Member

nedtwigg commented Aug 9, 2023

For anyone else who was slow like me, the stacktraces are coming from the IntelliJ sync plugin, not Spotless. Looks like we did cause this warning in the past, @Goooler fixed it, and it is still fixed. I'm happy for the discussion to continue, but I'm going to close the issue for now because I think we got to the bottom of it. Thanks for sharing the info @c0nstexpr, and thanks for fixing it and tracking this one down too @Goooler.

@nedtwigg nedtwigg closed this as completed Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants