Skip to content
New issue

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

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

Already on GitHub? # to your account

Undeclared build service deprecation when enabling stable configuration cache #108

Closed
ciscoo opened this issue Feb 2, 2024 · 2 comments
Closed

Comments

@ciscoo
Copy link

ciscoo commented Feb 2, 2024

With stable configuration cache enabled in settings:

enableFeaturePreview("STABLE_CONFIGURATION_CACHE")

The following warning gets logged with --warning-mode all:

Task :documentation:gitPublishReset
Build service 'git-publish-main-grgit' is being used by task ':documentation:gitPublishReset' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.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/8.6-rc-2/userguide/upgrading_version_7.html#undeclared_build_service_usage

Task :documentation:gitPublishCopy

Task :documentation:gitPublishCommit
Build service 'git-publish-main-grgit' is being used by task ':documentation:gitPublishCommit' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.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/8.6-rc-2/userguide/upgrading_version_7.html#undeclared_build_service_usage

Task :documentation:gitPublishPush
Build service 'git-publish-main-grgit' is being used by task ':documentation:gitPublishPush' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.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/8.6-rc-2/userguide/upgrading_version_7.html#undeclared_build_service_usage

@ciscoo
Copy link
Author

ciscoo commented Feb 3, 2024

Workaround:

tasks {
    val mainGrgitService = gradle.sharedServices.registrations["git-publish-main-grgit"].service
    gitPublishReset {
        usesService(mainGrgitService)
    }
    gitPublishCommit {
        usesService(mainGrgitService)
    }
    gitPublishPush {
        usesService(mainGrgitService)
    }
}

But this only works for the main publication. Custom publications would have to do the same for their own tasks.

@ajoberstar
Copy link
Owner

Hopefully 4.2.2 should take care of that. Thanks for reporting it!

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

No branches or pull requests

2 participants