Skip to content

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

Merged
3flex merged 1 commit into
detekt:mainfrom
3flex:not-consumable
Jan 1, 2023
Merged

Use correct resolvable/consumable flags on detekt's configurations#5657
3flex merged 1 commit into
detekt:mainfrom
3flex:not-consumable

Conversation

@3flex

@3flex 3flex commented Jan 1, 2023

Copy link
Copy Markdown
Member

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