Configuration

A Configuration represents a group of artifacts and their dependencies. Find more information about declaring dependencies to a configuration or about managing configurations in docs for ConfigurationContainer

Configuration is an instance of a FileCollection that contains all dependencies (see also getAllDependencies) but not artifacts. If you want to refer to the artifacts declared in this configuration please use getArtifacts or getAllArtifacts. Read more about declaring artifacts in the configuration in docs for org.gradle.api.artifacts.dsl.ArtifactHandler Please see the Declaring Dependencies User Manual chapter for more information.

Inheritors

Types

Link copied to clipboard
open class Namer : Namer<T>
A org.gradle.api.Namer namer for configurations that returns getName.
Link copied to clipboard
enum State
The states a configuration can be into.

Functions

Link copied to clipboard
abstract fun addToAntBuilder(builder: Any, nodeName: String): Any
abstract fun addToAntBuilder(builder: Any, nodeName: String, type: FileCollection.AntType)
Link copied to clipboard
abstract fun attributes(action: Action<in AttributeContainer>): SELF
Link copied to clipboard
abstract fun contains(file: File): Boolean
Link copied to clipboard
abstract fun copy(): Configuration
Creates a copy of this configuration that only contains the dependencies directly in this configuration (without contributions from superconfigurations).
abstract fun copy(dependencySpec: Closure): Configuration
Takes a closure which gets coerced into a Spec.
abstract fun copy(dependencySpec: Spec<in Dependency>): Configuration
Creates a copy of this configuration ignoring superconfigurations (see copy but filtering the dependencies using the specified dependency spec.
Link copied to clipboard
Creates a copy of this configuration that contains the dependencies directly in this configuration and those derived from superconfigurations.
abstract fun copyRecursive(dependencySpec: Closure): Configuration
Takes a closure which gets coerced into a Spec.
abstract fun copyRecursive(dependencySpec: Spec<in Dependency>): Configuration
Creates a copy of this configuration with dependencies from superconfigurations (see copyRecursive) but filtering the dependencies using the dependencySpec.
Link copied to clipboard
Execute the given action if the configuration has no defined dependencies when it first participates in dependency resolution.
Link copied to clipboard
Disables consistent resolution for this configuration.
Link copied to clipboard
abstract fun exclude(excludeProperties: Map<String, String>): Configuration
Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration.
Link copied to clipboard
fun Configuration.exclude(group: String? = null, module: String? = null): Configuration

Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration. You can also add exclude rules per-dependency. See ModuleDependency.exclude.

Link copied to clipboard
abstract fun extendsFrom(superConfigs: Array<Configuration>): Configuration
Adds the given configurations to the set of configuration which this configuration extends from.
Link copied to clipboard
abstract fun fileCollection(dependencySpecClosure: Closure): FileCollection
Takes a closure which gets coerced into a Spec.
abstract fun fileCollection(dependencies: Array<Dependency>): FileCollection
abstract fun fileCollection(dependencySpec: Spec<in Dependency>): FileCollection
Resolves this configuration lazily.
Link copied to clipboard
abstract fun files(dependencySpecClosure: Closure): Set<File>
Takes a closure which gets coerced into a Spec.
abstract fun files(dependencies: Array<Dependency>): Set<File>
abstract fun files(dependencySpec: Spec<in Dependency>): Set<File>
Resolves this configuration.
Link copied to clipboard
abstract fun filter(filterClosure: Closure): FileCollection
Link copied to clipboard
open fun forEach(action: Consumer<in T>)
Link copied to clipboard
Use the given collector as a source for dependencies and dependency constraints.
Link copied to clipboard
abstract fun getAll(): Set<Configuration>
Returns all the configurations belonging to the same configuration container as this configuration (including this configuration).
Link copied to clipboard
Returns the artifacts of this configuration including the artifacts of extended configurations.
Link copied to clipboard
Gets the complete set of declared dependencies including those contributed by superconfigurations.
Link copied to clipboard
Gets the complete set of dependency constraints including those contributed by superconfigurations.
Link copied to clipboard
Returns the artifacts of this configuration excluding the artifacts of extended configurations.
Link copied to clipboard
abstract fun getAsFileTree(): FileTree
Link copied to clipboard
abstract fun getAsPath(): String
Link copied to clipboard
Link copied to clipboard
Returns a TaskDependency object containing all required dependencies to build the local dependencies (e.g.
Link copied to clipboard
Gets the set of declared dependencies directly contained in this configuration (ignoring superconfigurations).
Link copied to clipboard
Gets the set of dependency constraints directly contained in this configuration (ignoring superconfigurations).
Link copied to clipboard
@Nullable
abstract fun getDescription(): String
Returns the description for this configuration.
Link copied to clipboard
Link copied to clipboard
Returns the exclude rules applied for resolving any dependency of this configuration.
Link copied to clipboard
Returns the names of the configurations which this configuration extends from.
Link copied to clipboard
abstract fun getFiles(): Set<File>
Link copied to clipboard
abstract fun getHierarchy(): Set<Configuration>
Gets an ordered set including this configuration and all superconfigurations recursively.
Link copied to clipboard
Returns the incoming dependencies of this configuration.
Link copied to clipboard
abstract fun getName(): String
Link copied to clipboard
Returns the outgoing ConfigurationPublications instance that advertises and allows configuring the artifacts and variants published by this configuration.
Link copied to clipboard
Returns the resolution strategy used by this configuration.
Link copied to clipboard
Resolves this configuration.
Link copied to clipboard
abstract fun getSingleFile(): File
Link copied to clipboard
Returns the state of the configuration.
Link copied to clipboard
abstract fun getTaskDependencyFromProjectDependency(useDependedOn: Boolean, taskName: String): TaskDependency
Returns a TaskDependency object containing dependencies on all tasks with the specified name from project dependencies related to this configuration or one of its super configurations.
Link copied to clipboard
abstract fun getUploadTaskName(): String
Returns the name of the task that upload the artifacts of this configuration to repositories declared by the user.
Link copied to clipboard
abstract fun isCanBeConsumed(): Boolean
Returns true if this configuration can be consumed from another project, or published.
Link copied to clipboard
Returns true if it is allowed to declare dependencies upon this configuration.
Link copied to clipboard
abstract fun isCanBeResolved(): Boolean
Returns true if it is allowed to query or resolve this configuration.
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract fun isTransitive(): Boolean
Returns the transitivity of this configuration.
Link copied to clipboard
abstract fun isVisible(): Boolean
Returns true if this is a visible configuration.
Link copied to clipboard
abstract fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun minus(collection: FileCollection): FileCollection
Link copied to clipboard
abstract fun outgoing(action: Action<in ConfigurationPublications>)
Configures the outgoing ConfigurationPublications instance that advertises and allows configuring the artifacts and variants published by this configuration.
Link copied to clipboard
abstract fun plus(collection: FileCollection): FileCollection
Link copied to clipboard
abstract fun resolutionStrategy(@DelegatesTo(value = ResolutionStrategy::class, strategy = 1) closure: Closure): Configuration
The resolution strategy provides extra details on how to resolve this configuration.
Link copied to clipboard
abstract fun resolve(): Set<File>
Resolves this configuration.
Link copied to clipboard
abstract fun setCanBeConsumed(allowed: Boolean)
Configures if a configuration can be consumed.
Link copied to clipboard
abstract fun setCanBeDeclared(allowed: Boolean)
Configures if a configuration can have dependencies declared upon it.
Link copied to clipboard
abstract fun setCanBeResolved(allowed: Boolean)
Configures if a configuration can be resolved.
Link copied to clipboard
abstract fun setDescription(@Nullable description: String): Configuration
Sets the description for this configuration.
Link copied to clipboard
abstract fun setExtendsFrom(superConfigs: Iterable<Configuration>): Configuration
Sets the configurations which this configuration extends from.
Link copied to clipboard
Sets the transitivity of this configuration.
Link copied to clipboard
abstract fun setVisible(visible: Boolean): Configuration
Sets the visibility of this configuration.
Link copied to clipboard
Tells that this configuration, when resolved, should resolve versions consistently from the resolution result of another resolvable configuration.
Link copied to clipboard
Link copied to clipboard
Execute the given action before the configuration first participates in dependency resolution.