Interface DependencyCollector


  • @Incubating
    @NonExtensible
    public interface DependencyCollector
    A DependencyCollector is used as part of a dependencies block in the DSL. A collector implements a single dependency scope and exposes the declared dependencies on getDependencies().
    Since:
    8.6
    API Note:
    Gradle has specific extensions to make explicit calls to add(...) unnecessary from the DSL.
    • For Groovy DSL, we create call(...) equivalents for all the add(...) methods.
    • For Kotlin DSL, we create invoke(...) equivalents for all the add(...) methods.
    Implementation Requirements:
    This interface should not be implemented by end users or plugins.
    Implementation Note:
    Changes to this interface may require changes to the extension module for Groovy DSL or extension functions for Kotlin DSL.
    • Method Detail

      • add

        void add​(Dependency dependency)
        Add a dependency.
        Parameters:
        dependency - dependency to add
        Since:
        8.6
      • add

        <D extends Dependency> void add​(D dependency,
                                        Action<? super D> configuration)
        Add a dependency and configure it.
        Parameters:
        dependency - dependency to add
        configuration - an action to configure the dependency
        Since:
        8.6
      • add

        void add​(Provider<? extends Dependency> dependency)
        Add a dependency.
        Parameters:
        dependency - dependency to add
        Since:
        8.6
      • add

        <D extends Dependency> void add​(Provider<? extends D> dependency,
                                        Action<? super D> configuration)
        Add a dependency and configure it.
        Parameters:
        dependency - dependency to add
        configuration - an action to configure the dependency
        Since:
        8.6
      • addConstraint

        void addConstraint​(DependencyConstraint dependencyConstraint)
        Add a dependency constraint.
        Parameters:
        dependencyConstraint - dependency constraint to add
        Since:
        8.7
      • addConstraint

        void addConstraint​(DependencyConstraint dependencyConstraint,
                           Action<? super DependencyConstraint> configuration)
        Add a dependency constraint and configure it.
        Parameters:
        dependencyConstraint - dependency constraint to add
        configuration - an action to configure the dependency constraint
        Since:
        8.7
      • addConstraint

        void addConstraint​(Provider<? extends DependencyConstraint> dependencyConstraint)
        Add a dependency constraint, using a Provider to lazily create the constraint.
        Parameters:
        dependencyConstraint - dependency constraint to add
        Since:
        8.7
      • addConstraint

        void addConstraint​(Provider<? extends DependencyConstraint> dependencyConstraint,
                           Action<? super DependencyConstraint> configuration)
        Add a dependency constraint and configure it, using a Provider to lazily create the constraint.
        Parameters:
        dependencyConstraint - dependency constraint to add
        configuration - an action to configure the dependency constraint
        Since:
        8.7
      • bundle

        <D extends Dependency> void bundle​(java.lang.Iterable<? extends D> bundle)
        Add a bundle.
        Parameters:
        bundle - the bundle to add
        Since:
        8.6
      • bundle

        <D extends Dependency> void bundle​(java.lang.Iterable<? extends D> bundle,
                                           Action<? super D> configuration)
        Add a bundle and configure them.
        Parameters:
        bundle - the bundle to add
        configuration - an action to configure each dependency in the bundle
        Since:
        8.6
      • bundle

        <D extends Dependency> void bundle​(Provider<? extends java.lang.Iterable<? extends D>> bundle)
        Add a bundle.
        Parameters:
        bundle - the bundle to add
        Since:
        8.6
      • bundle

        <D extends Dependency> void bundle​(Provider<? extends java.lang.Iterable<? extends D>> bundle,
                                           Action<? super D> configuration)
        Add a bundle and configure them.
        Parameters:
        bundle - the bundle to add
        configuration - an action to configure each dependency in the bundle
        Since:
        8.6
      • bundle

        <D extends Dependency> void bundle​(ProviderConvertible<? extends java.lang.Iterable<? extends D>> bundle)
        Add a bundle.
        Parameters:
        bundle - the bundle to add
        Since:
        8.6
      • bundle

        <D extends Dependency> void bundle​(ProviderConvertible<? extends java.lang.Iterable<? extends D>> bundle,
                                           Action<? super D> configuration)
        Add a bundle and configure them.
        Parameters:
        bundle - the bundle to add
        configuration - an action to configure each dependency in the bundle
        Since:
        8.6
      • getDependencies

        Provider<java.util.Set<Dependency>> getDependencies()
        Returns all dependencies declared on this collector.
        Since:
        8.6
      • getDependencyConstraints

        Provider<java.util.Set<DependencyConstraint>> getDependencyConstraints()
        Returns all dependency constraints declared on this collector.
        Since:
        8.7