Package org.gradle.api.artifacts
Interface ResolvableDependencies
- All Superinterfaces:
ArtifactView
,HasAttributes
A set of
Dependency
objects which can be resolved to a set of files. There are various methods on this type that you can use to get the result in different forms:
getFiles()
returns aFileCollection
that provides the result as a set ofFile
instances.getResolutionResult()
returns aResolutionResult
that provides information about the dependency graph.getArtifacts()
returns anArtifactCollection
that provides the files with additional metadata.
The dependencies are resolved once only, when the result is first requested. The result is reused and returned for subsequent calls. Once resolved, any mutation to the dependencies will result in an error.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.artifacts.ArtifactView
ArtifactView.ViewConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterResolve
(Closure action) Adds an action to be executed after the dependencies of this set have been resolved.void
afterResolve
(Action<? super ResolvableDependencies> action) Adds an action to be executed after the dependencies of this set have been resolved.artifactView
(Action<? super ArtifactView.ViewConfiguration> configAction) Returns a builder that can be used to define and access a filtered view of the resolved artifacts.void
beforeResolve
(Closure action) Adds an action to be executed before the dependencies in this set are resolved.void
beforeResolve
(Action<? super ResolvableDependencies> action) Adds an action to be executed before the dependencies in this set are resolved.Returns the resolved artifacts, performing the resolution if required.Returns the set of dependencies which will be resolved.getFiles()
Returns aFileCollection
which contains the resolved set of files.getName()
Returns the name of this set.getPath()
Returns the path of this set.Returns the resolved dependency graph, performing the resolution if required.Methods inherited from interface org.gradle.api.attributes.HasAttributes
getAttributes
-
Method Details
-
getName
String getName()Returns the name of this set.- Returns:
- The name. Never null.
-
getPath
String getPath()Returns the path of this set. This is a unique identifier for this set.- Returns:
- The path. Never null.
-
getFiles
FileCollection getFiles()Returns aFileCollection
which contains the resolved set of files. The returned value is lazy, so dependency resolution is not performed until the contents of the collection are queried.The
FileCollection
carries the task dependencies required to build the files in the result, and when used as a task input the files will be built before the task executes.- Specified by:
getFiles
in interfaceArtifactView
- Returns:
- The collection. Never null.
-
getDependencies
DependencySet getDependencies()Returns the set of dependencies which will be resolved.- Returns:
- the dependencies. Never null.
-
beforeResolve
Adds an action to be executed before the dependencies in this set are resolved.- Parameters:
action
- The action to execute.
-
beforeResolve
Adds an action to be executed before the dependencies in this set are resolved.- Parameters:
action
- The action to execute.
-
afterResolve
Adds an action to be executed after the dependencies of this set have been resolved.- Parameters:
action
- The action to execute.
-
afterResolve
Adds an action to be executed after the dependencies of this set have been resolved.- Parameters:
action
- The action to execute.
-
getResolutionResult
Returns the resolved dependency graph, performing the resolution if required. This will resolve the dependency graph but will not resolve or download the files.You should note that when resolution fails, the exceptions are included in the
ResolutionResult
returned from this method. This method will not throw these exceptions.- Returns:
- the resolution result
- Since:
- 1.3
-
getArtifacts
Returns the resolved artifacts, performing the resolution if required. This will resolve and download the files as required.- Specified by:
getArtifacts
in interfaceArtifactView
- Throws:
ResolveException
- On failure to resolve or download any artifact.- Since:
- 3.4
-
artifactView
Returns a builder that can be used to define and access a filtered view of the resolved artifacts.- Returns:
- A view over the artifacts resolved for this set of dependencies.
- Since:
- 3.4
-