Class DependencyModifier

java.lang.Object
org.gradle.api.artifacts.dsl.DependencyModifier
Direct Known Subclasses:
PlatformDependencyModifiers.EnforcedPlatformDependencyModifier, PlatformDependencyModifiers.PlatformDependencyModifier, TestFixturesDependencyModifiers.TestFixturesDependencyModifier

@NonExtensible public abstract class DependencyModifier extends Object
A DependencyModifier defines how to modify a dependency inside a custom dependencies block to select a different variant.
Since:
8.0
API Note:
Gradle has specific extensions to make explicit calls to modify(...) unnecessary from the DSL.
  • For Groovy DSL, we create call(...) equivalents for all the modify(...) methods.
  • For Kotlin DSL, we create invoke(...) equivalents for all the modify(...) methods.
Implementation Requirements:
The only method that should be implemented is modifyImplementation(ModuleDependency). Other abstract methods are used to inject necessary services and should not be implemented.
Implementation Note:
All implementations of modify(...) delegate to modifyImplementation(ModuleDependency).

Changes to this interface may require changes to the extension module for Groovy DSL or extension functions for Kotlin DSL.

  • Constructor Details

    • DependencyModifier

      protected DependencyModifier()
      Creates a new instance.
      Since:
      8.4
  • Method Details