ArtifactView
, HasAttributes
public interface ResolvableDependencies extends ArtifactView
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 a FileCollection
that provides the result as a set of File
instances.getResolutionResult()
returns a ResolutionResult
that provides information about the dependency graph.getArtifacts()
returns an ArtifactCollection
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.
ArtifactView.ViewConfiguration
Modifier and Type | Method | Description |
---|---|---|
void |
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 |
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.
|
ArtifactCollection |
getArtifacts() |
Returns the resolved artifacts, performing the resolution if required.
|
DependencySet |
getDependencies() |
Returns the set of dependencies which will be resolved.
|
DependencyConstraintSet |
getDependencyConstraints() |
Returns the set of dependency constraints which will be considered during resolution.
|
FileCollection |
getFiles() |
Returns a
FileCollection which contains the resolved set of files. |
String |
getName() |
Returns the name of this set.
|
String |
getPath() |
Returns the path of this set.
|
ResolutionResult |
getResolutionResult() |
Returns the resolved dependency graph, performing the resolution if required.
|
getAttributes
String getName()
String getPath()
FileCollection getFiles()
FileCollection
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.
getFiles
in interface ArtifactView
DependencySet getDependencies()
@Incubating DependencyConstraintSet getDependencyConstraints()
void beforeResolve(Action<? super ResolvableDependencies> action)
action
- The action to execute.void beforeResolve(Closure action)
action
- The action to execute.void afterResolve(Action<? super ResolvableDependencies> action)
action
- The action to execute.void afterResolve(Closure action)
action
- The action to execute.ResolutionResult getResolutionResult()
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.
ArtifactCollection getArtifacts() throws ResolveException
getArtifacts
in interface ArtifactView
ResolveException
- On failure to resolve or download any artifact.ArtifactView artifactView(Action<? super ArtifactView.ViewConfiguration> configAction)