api / org.gradle.api.artifacts / Configuration / fileCollection

fileCollection

abstract fun fileCollection(dependencySpec: Spec<in Dependency>): FileCollection

Resolves this configuration lazily. The resolve happens when the elements of the returned FileCollection get accessed the first time. This locates and downloads the files which make up this configuration. Only the resulting set of files belonging to the subset of dependencies specified by the dependencySpec is contained in the FileCollection.

Parameters

dependencySpec - The spec describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).

Return
The FileCollection with a subset of dependencies of this configuration.

abstract fun fileCollection(dependencySpecClosure: Closure<Any>): FileCollection

Takes a closure which gets coerced into a Spec. Behaves otherwise in the same way as #fileCollection(org.gradle.api.specs.Spec).

Parameters

dependencySpecClosure - The closure describing a filter applied to the all the dependencies of this configuration (including dependencies from extended configurations).

Return
The FileCollection with a subset of dependencies of this configuration.

abstract fun fileCollection(vararg dependencies: Dependency): FileCollection

Resolves this configuration lazily. The resolve happens when the elements of the returned FileCollection get accessed the first time. This locates and downloads the files which make up this configuration. Only the resulting set of files belonging to specified dependencies is contained in the FileCollection.

Parameters

dependencies - The dependencies for which the FileCollection should contain the files.

Return
The FileCollection with a subset of dependencies of this configuration.