Package org.gradle.api.artifacts.dsl
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 theadd(...)methods.
- For Kotlin DSL, we create invoke(...)equivalents for all theadd(...)methods.
 
- For Groovy DSL, we create 
- 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 DSLorextension functions for Kotlin DSL.
- 
Method SummaryModifier and TypeMethodDescription<D extends Dependency>
 voidAdd a dependency and configure it.voidadd(CharSequence dependencyNotation) Add a dependency.voidadd(CharSequence dependencyNotation, Action<? super ExternalModuleDependency> configuration) Add a dependency and configure it.voidadd(Dependency dependency) Add a dependency.voidadd(FileCollection files) Add a dependency.voidadd(FileCollection files, Action<? super FileCollectionDependency> configuration) Add a dependency and configure it.<D extends Dependency>
 voidAdd a dependency and configure it.voidadd(Provider<? extends Dependency> dependency) Add a dependency.voidadd(ProviderConvertible<? extends MinimalExternalModuleDependency> externalModule) Add a dependency.voidadd(ProviderConvertible<? extends MinimalExternalModuleDependency> externalModule, Action<? super ExternalModuleDependency> configuration) Add a dependency and configure it.voidaddConstraint(DependencyConstraint dependencyConstraint) Add a dependency constraint.voidaddConstraint(DependencyConstraint dependencyConstraint, Action<? super DependencyConstraint> configuration) Add a dependency constraint and configure it.voidaddConstraint(Provider<? extends DependencyConstraint> dependencyConstraint) Add a dependency constraint, using aProviderto lazily create the constraint.voidaddConstraint(Provider<? extends DependencyConstraint> dependencyConstraint, Action<? super DependencyConstraint> configuration) Add a dependency constraint and configure it, using aProviderto lazily create the constraint.<D extends Dependency>
 voidAdd a bundle.<D extends Dependency>
 voidAdd a bundle and configure them.<D extends Dependency>
 voidAdd a bundle.<D extends Dependency>
 voidAdd a bundle and configure them.<D extends Dependency>
 voidbundle(ProviderConvertible<? extends Iterable<? extends D>> bundle) Add a bundle.<D extends Dependency>
 voidbundle(ProviderConvertible<? extends Iterable<? extends D>> bundle, Action<? super D> configuration) Add a bundle and configure them.Returns all dependencies declared on this collector.Returns all dependency constraints declared on this collector.
- 
Method Details- 
addAdd a dependency.- Parameters:
- dependencyNotation- dependency to add
- Since:
- 8.6
- See Also:
 
- 
addAdd a dependency and configure it.- Parameters:
- dependencyNotation- dependency to add
- configuration- an action to configure the dependency
- Since:
- 8.6
- See Also:
 
- 
addAdd a dependency.- Parameters:
- files- files to add as a dependency
- Since:
- 8.6
- See Also:
 
- 
addAdd a dependency and configure it.- Parameters:
- files- files to add as a dependency
- configuration- an action to configure the dependency
- Since:
- 8.6
- See Also:
 
- 
addAdd a dependency.- Parameters:
- externalModule- external module to add as a dependency
- Since:
- 8.6
 
- 
add@Incubating void add(ProviderConvertible<? extends MinimalExternalModuleDependency> externalModule, Action<? super ExternalModuleDependency> configuration) Add a dependency and configure it.- Parameters:
- externalModule- external module to add as a dependency
- configuration- an action to configure the dependency
- Since:
- 8.6
 
- 
addAdd a dependency.- Parameters:
- dependency- dependency to add
- Since:
- 8.6
 
- 
addAdd a dependency and configure it.- Parameters:
- dependency- dependency to add
- configuration- an action to configure the dependency
- Since:
- 8.6
 
- 
addAdd a dependency.- Parameters:
- dependency- dependency to add
- Since:
- 8.6
 
- 
addAdd a dependency and configure it.- Parameters:
- dependency- dependency to add
- configuration- an action to configure the dependency
- Since:
- 8.6
 
- 
addConstraintAdd a dependency constraint.- Parameters:
- dependencyConstraint- dependency constraint to add
- Since:
- 8.7
 
- 
addConstraintvoid 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
 
- 
addConstraintAdd a dependency constraint, using aProviderto lazily create the constraint.- Parameters:
- dependencyConstraint- dependency constraint to add
- Since:
- 8.7
 
- 
addConstraintvoid addConstraint(Provider<? extends DependencyConstraint> dependencyConstraint, Action<? super DependencyConstraint> configuration) Add a dependency constraint and configure it, using aProviderto lazily create the constraint.- Parameters:
- dependencyConstraint- dependency constraint to add
- configuration- an action to configure the dependency constraint
- Since:
- 8.7
 
- 
bundleAdd a bundle.- Parameters:
- bundle- the bundle to add
- Since:
- 8.6
 
- 
bundle@Incubating <D extends Dependency> void bundle(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
 
- 
bundleAdd a bundle.- Parameters:
- bundle- the bundle to add
- Since:
- 8.6
 
- 
bundle@Incubating <D extends Dependency> void bundle(Provider<? extends 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@Incubating <D extends Dependency> void bundle(ProviderConvertible<? extends Iterable<? extends D>> bundle) Add a bundle.- Parameters:
- bundle- the bundle to add
- Since:
- 8.6
 
- 
bundle@Incubating <D extends Dependency> void bundle(ProviderConvertible<? extends 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
 
- 
getDependenciesProvider<Set<Dependency>> getDependencies()Returns all dependencies declared on this collector.- Since:
- 8.6
 
- 
getDependencyConstraintsProvider<Set<DependencyConstraint>> getDependencyConstraints()Returns all dependency constraints declared on this collector.- Since:
- 8.7
 
 
-