Currently, the Kotlin plugin adds the dependency org.jetbrains.kotlin:kotlin-stdlib:$version automatically to Kotlin modules.
This dependency is added in the configurations $DependenciesMetadata (e.g. implementationDependenciesMetadata, apiDependenciesMetadata) and not in implementation and api.
Running ./gradlew generateGradleLintReport with the rule all-dependency, fails on Kotlin modules which are not using directly standard library APIs.
The violations on those modules are the following:
Violation: Rule=unused-dependency P=1 Line=null Msg=[one or more classes in org.jetbrains.kotlin:kotlin-stdlib:1.8.0 are required by your code directly]
Violation: Rule=undeclared-dependency P=1 Line=null Msg=[one or more classes in org.jetbrains.kotlin:kotlin-stdlib:1.8.0 are required by your code directly]
Proposals which would probably fix this:
query the $DependenciesMetadata configs internally
expose an API in GradleLintExtension to exclude dependencies from all-dependency checks (e.g. gradleLint.skipDependencies = "org.jetbrains.kotlin:kotlin-stdlib")
Currently, the Kotlin plugin adds the dependency
org.jetbrains.kotlin:kotlin-stdlib:$version
automatically to Kotlin modules. This dependency is added in the configurations$DependenciesMetadata
(e.g.implementationDependenciesMetadata
,apiDependenciesMetadata
) and not inimplementation
andapi
. Running./gradlew generateGradleLintReport
with the ruleall-dependency
, fails on Kotlin modules which are not using directly standard library APIs.The violations on those modules are the following:
Proposals which would probably fix this:
$DependenciesMetadata
configs internallyGradleLintExtension
to exclude dependencies fromall-dependency
checks (e.g.gradleLint.skipDependencies = "org.jetbrains.kotlin:kotlin-stdlib"
)