dependency-analysis-gradle-plugin
dependency-analysis-gradle-plugin copied to clipboard
Gradle deprecation warning: Antlr plugin
Plugin version 1.4.0
Gradle version 7.4.2
Describe the bug
Running buildHealth on my project leads to the following deprecation warning in the explodeCodeSourceMain and explodeCodeSourceTest tasks:
> Task :subproj:explodeCodeSourceMain
Execution optimizations have been disabled for task ':subproj:explodeCodeSourceMain' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/home/project/subproj/build/generated-src/antlr/main'. Reason: Task ':subproj:explodeCodeSourceMain' uses this output of task ':subproj:generateGrammarSource' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Gradle detected a problem with the following location: '/home/project/subproj/build/generated-src/antlr/main'. Reason: Task ':subproj:explodeCodeSourceMain' uses this output of task ':subproj:generateGrammarSource' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. Execution optimizations are disabled to ensure correctness. See https://docs.gradle.org/7.4.2/userguide/more_about_tasks.html#sec:up_to_date_checks for more details.
To Reproduce
I guess the issue is because I'm using the antlr built-in Gradle plugin:
plugins {
id 'antlr'
}
It should be simple enough to reproduce the issue by just adding the plugin to the build-script. If you have troubles reproducing, I'll try creating a repo.
Expected behavior No deprecation warning
Thanks for the issue.
I just saw a new one (using Gradle 7.5.1):
> Task :subproj:explodeJarMain
Build service 'inMemoryCache' is being used by task ':subproj:explodeJarMain' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5.1/userguide/upgrading_version_7.html#undeclared_build_service_usage
I see a similar one for findInlineMembers and findDeclaredProcs.
I just saw a new one (using Gradle 7.5.1):
> Task :subproj:explodeJarMain Build service 'inMemoryCache' is being used by task ':subproj:explodeJarMain' without the corresponding declaration via 'Task#usesService'. This will fail with an error in Gradle 8.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: https://docs.gradle.org/7.5.1/userguide/upgrading_version_7.html#undeclared_build_service_usageI see a similar one for
findInlineMembersandfindDeclaredProcs.
Could you file this as a separate issue, please?
Sure, here you go. :)
A workaround for this:
// Workaround for https://github.com/gradle/gradle/issues/25885
// Technically it should be `explodeCodeSourceMain dependsOn generateGrammarSource` and
// `explodeCodeSourceTest dependsOn generateTestGrammarSource`, but this module is so
// small it isn't worth fine-tuning it.
tasks.withType(com.autonomousapps.tasks.CodeSourceExploderTask) {
dependsOn('generateGrammarSource', 'generateTestGrammarSource')
}