Conversation
Gradle 9.8.0-milestone-2 deprecates Configuration.setVisible(boolean) (scheduled for removal in Gradle 11). The plugin set visible = false on three internal configurations (protobufToolsLocator_*, the per-source-set protobuf configuration, and compileProtoPath). The visible property no longer has any meaningful effect on the build, so the calls can be dropped without changing behaviour on any supported Gradle version. This unblocks consumers that run with warning-mode=fail (e.g. Elasticsearch), where the deprecation is a hard build failure.
1 task
Per review feedback on the equivalent nmcp change (GradleUp/nmcp#271), keep the visible=false behaviour on Gradle versions where it still matters and only skip it on Gradle 9.8+ where Configuration.setVisible(boolean) is deprecated and inert. This avoids the deprecation warning on 9.8+ while preserving original behaviour on older Gradle versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Gradle 9.8.0-milestone-2 deprecates
Configuration.setVisible(boolean)(scheduled for removal in Gradle 11). The protobuf-gradle-plugin setsvisible = falseon three internal configurations, so any build that treats deprecations as errors (org.gradle.warning.mode=fail) fails as soon as the plugin is applied:See the Gradle 9.8 upgrade guide:
#deprecate-visible-property.Fix
Guard the
visible = falsecalls behind a Gradle version check on the three internal configurations:protobufToolsLocator_*(ToolsLocator)protobufconfiguration (ProtobufPlugin)compileProtoPath(ProtobufPlugin)On Gradle 9.8+ the
visibleproperty is deprecated and inert, so it is skipped to stay warning-clean. On older Gradle versions the originalvisible = falsebehaviour is preserved, keeping these internal configurations out of certain reports/publications.Context
Surfaced while testing Gradle 9.8.0-milestone-2 against Elasticsearch, which runs with
org.gradle.warning.mode=fail. The deprecation was a hard build blocker for projects such as:x-pack:plugin:otel-datathat apply this plugin.