Package org.gradle.api.artifacts
Interface ArtifactSelectionDetails
-
public interface ArtifactSelectionDetails
Details about artifact dependency substitution: this class gives access to the original dependency requested artifacts, if any, and gives the opportunity to replace the original requested artifacts with other artifacts. This can typically be used whenever you need to substitute a dependency with uses a classifier to a non-classified dependency, or the other way around.- Since:
- 6.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<DependencyArtifactSelector>
getRequestedSelectors()
Returns the list of requested artifacts for the dependencyboolean
hasSelectors()
Returns true if the dependency has requested a special artifact (either classifier, type or extension)void
selectArtifact(java.lang.String type, java.lang.String extension, java.lang.String classifier)
Adds an artifact to substitute.void
selectArtifact(DependencyArtifactSelector selector)
Adds an artifact to substitute.void
withoutArtifactSelectors()
Removes all artifact selectors, if any.
-
-
-
Method Detail
-
hasSelectors
boolean hasSelectors()
Returns true if the dependency has requested a special artifact (either classifier, type or extension)
-
getRequestedSelectors
java.util.List<DependencyArtifactSelector> getRequestedSelectors()
Returns the list of requested artifacts for the dependency
-
withoutArtifactSelectors
void withoutArtifactSelectors()
Removes all artifact selectors, if any.
-
selectArtifact
void selectArtifact(java.lang.String type, @Nullable java.lang.String extension, @Nullable java.lang.String classifier)
Adds an artifact to substitute. The first time this method is called, the original artifacts are replaced with the artifact defined by this method call. If you wish to add artifacts to the original query, you need to callgetRequestedSelectors()
and add them usingselectArtifact(DependencyArtifactSelector)
.- Parameters:
type
- the type of the artifact being queriedextension
- the extension, defaults to the typeclassifier
- the classifier, defaults to null (no classifier)
-
selectArtifact
void selectArtifact(DependencyArtifactSelector selector)
Adds an artifact to substitute. This method is a convenience to re-register artifacts requested by the original dependency. In most cases, the appropriate method to call isselectArtifact(String, String, String)
-
-