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

Use correct resolvable/consumable flags on detekt's configurations #5657

Merged
merged 1 commit into from
Jan 1, 2023

Conversation

3flex
Copy link
Member

@3flex 3flex commented Jan 1, 2023

Both flags have a default value of true, but as a plugin author, you should always determine the right values for those flags, or you might accidentally introduce resolution errors.

Source: https://docs.gradle.org/7.6/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs

This was uncovered when messages like these were seen in the logs when detekt was run with Gradle's --info logging level:

The configuration :detekt-tooling:detekt is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :detekt-tooling:detekt is both consumable and declarable. This combination is incorrect, only one of these flags should be set.
The configuration :detekt-tooling:detektPlugins is both resolvable and consumable. This is considered a legacy configuration and it will eventually only be possible to be one of these.
The configuration :detekt-tooling:detektPlugins is both consumable and declarable. This combination is incorrect, only one of these flags should be set.

The messages disappear as expected when setting isCanBeConsumed = false. These configurations only need to be resolved so they can be used on the classpath when detekt tasks run, they do not need to be consumable.

Both flags have a default value of true, but as a plugin author, you should
always determine the right values for those flags, or you might
accidentally introduce resolution errors.

Source: https://docs.gradle.org/7.6/userguide/declaring_dependencies.html#sec:resolvable-consumable-configs
@github-actions github-actions bot added the gradle label Jan 1, 2023
@3flex 3flex enabled auto-merge (squash) January 1, 2023 04:17
@3flex 3flex added this to the 1.23.0 milestone Jan 1, 2023
@3flex 3flex merged commit 25b560f into detekt:main Jan 1, 2023
@3flex 3flex deleted the not-consumable branch January 1, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants