Package org.gradle.api.artifacts
Schnittstelle ResolvableDependencies
- Alle Superschnittstellen:
ArtifactView,HasAttributes
The primary view of the results of resolving a
Configuration. Results can be obtained in several forms, each catering to different use cases:
getFiles()returns aFileCollectionthat provides the result as a set ofFileinstances.getResolutionResult()returns aResolutionResultthat provides information about the dependency graph without downloading artifacts.getArtifacts()returns anArtifactCollectionthat provides the files with additional metadata.-
artifactView(Action)provides several APIs, which can perform lenient artifact resolution, trigger artifact transforms, or filter artifacts. Furthermore, artifact views can be used to perform variant re-selection, allowing sources and javadoc artifacts to be selected from a graph, among other things.
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.
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.gradle.api.artifacts.ArtifactView
ArtifactView.ViewConfiguration -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidafterResolve(Closure action) Adds an action to be executed after the dependencies of this set have been resolved.voidafterResolve(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.voidbeforeResolve(Closure action) Adds an action to be executed before the dependencies in this set are resolved.voidbeforeResolve(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.Returns the set of dependency constraints which will be considered during resolution.getFiles()Returns aFileCollectionwhich 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 lazily.Von Schnittstelle geerbte Methoden org.gradle.api.attributes.HasAttributes
getAttributes
-
Methodendetails
-
getName
String getName()Returns the name of this set.- Gibt zurück:
- The name. Never null.
-
getPath
String getPath()Returns the path of this set. This is a unique identifier for this set.- Gibt zurück:
- The path. Never null.
-
getFiles
FileCollection getFiles()Returns aFileCollectionwhich 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
FileCollectioncarries 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.- Angegeben von:
getFilesin SchnittstelleArtifactView- Gibt zurück:
- The collection. Never null.
-
getDependencies
DependencySet getDependencies()Returns the set of dependencies which will be resolved.- Gibt zurück:
- the dependencies. Never null.
-
getDependencyConstraints
DependencyConstraintSet getDependencyConstraints()Returns the set of dependency constraints which will be considered during resolution.- Gibt zurück:
- the dependency constraints. Never null.
- Seit:
- 4.6
-
beforeResolve
Adds an action to be executed before the dependencies in this set are resolved.- Parameter:
action- The action to execute.
-
beforeResolve
Adds an action to be executed before the dependencies in this set are resolved.- Parameter:
action- The action to execute.
-
afterResolve
Adds an action to be executed after the dependencies of this set have been resolved.- Parameter:
action- The action to execute.
-
afterResolve
Adds an action to be executed after the dependencies of this set have been resolved.- Parameter:
action- The action to execute.
-
getResolutionResult
ResolutionResult getResolutionResult()Returns the resolved dependency graph, performing the resolution lazily.The lazy aspect depends on what is done with the returned
This will resolve the dependency graph but will not resolve or download the artifacts.ResolutionResult.You should note that when resolution fails, the exceptions are included in the
ResolutionResultreturned from this method. This method will not throw these exceptions.- Gibt zurück:
- the resolution result
- Seit:
- 1.3
-
getArtifacts
Returns the resolved artifacts, performing the resolution if required. This will resolve and download the files as required.- Angegeben von:
getArtifactsin SchnittstelleArtifactView- Löst aus:
ResolveException- On failure to resolve or download any artifact.- Seit:
- 3.4
-
artifactView
Returns a builder that can be used to define and access a filtered view of the resolved artifacts.- Gibt zurück:
- A view over the artifacts resolved for this set of dependencies.
- Seit:
- 3.4
-