IntentionallyNonTransitiveDependency
annotation class IntentionallyNonTransitiveDependency(val description: String = "", val reason: ExemptionReason = ExemptionReason.OTHER)(source)
Exempts the annotated declaration, parameter, or type usage from Public types from non-transitive dependencies. On a class, it covers every nested declaration.
Apply it when the environment that loads the library has the dependency on its classpath. A Gradle plugin is the common case: it compiles against gradleApi() and runs inside Gradle. Name the environment in description.
To exempt every type of the dependency, declare it on the apiWatchdogExemptNonTransitive configuration instead (Exempting a dependency):
dependencies {
implementation("com.example:models:1.0.0")
apiWatchdogExemptNonTransitive("com.example:models")
}Content copied to clipboard
Parameters
description
Why the exemption is applied. Can be empty when reason is ExemptionReason.FOR_BACKWARDS_COMPATIBILITY, ExemptionReason.API_DESIGN, or ExemptionReason.FOR_DEPRECATION.