Class DependencyModifier

    • Constructor Detail

      • DependencyModifier

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

      • getDependencyFactory

        @Inject
        protected abstract DependencyFactory getDependencyFactory()
        A dependency factory is used to convert supported dependency notations into Dependency instances.
        Returns:
        a dependency factory
        See Also:
        DependencyFactory
        Implementation Requirements:
        Do not implement this method. Gradle generates the implementation automatically.
      • modify

        public final <D extends ModuleDependency> D modify​(D dependency)
        Takes a given ModuleDependency and modifies the dependency to select the variant of the given module. Dependency resolution may fail if the given module does not have a compatible variant.

        The dependency will be copied, so the original dependency will not be modified.

        Type Parameters:
        D - the type of the ModuleDependency
        Parameters:
        dependency - the dependency to modify
        Returns:
        the modified dependency
      • modifyImplementation

        protected abstract void modifyImplementation​(ModuleDependency dependency)
        Modify the given dependency.
        Parameters:
        dependency - the dependency to modify
        Since:
        8.4
        Implementation Requirements:
        This method must be implemented.