public abstract class DependencySpec extends java.lang.Object implements PrettyPrintable
| Modifier | Constructor and Description |
|---|---|
protected |
DependencySpec(java.lang.String pConfiguration)
Create a new
DependencySpec. |
| Modifier and Type | Method and Description |
|---|---|
void |
addArtifact(ArtifactSpec pArtifactSpec)
Add an artifact specification to this dependency.
|
void |
addArtifact(java.lang.String pName,
java.lang.String pType,
java.lang.String pExtension,
java.lang.String pClassifier,
java.lang.String pUrl)
Add an artifact specification to this dependency.
|
void |
addExclusion(ExclusionSpec pExclusionSpec)
Add an exclusion specification to this dependency.
|
void |
addExclusion(java.lang.String pGroup,
java.lang.String pModule)
Add an exclusion specification to this dependency.
|
abstract boolean |
addTo(org.gradle.api.Project pProject)
Add this dependency to a project.
|
void |
forEachArtifact(java.util.function.Consumer<? super ArtifactSpec> pAction)
Perform an action for each artifact specification.
|
void |
forEachExclusion(java.util.function.Consumer<? super ExclusionSpec> pAction)
Perform an action for each exclusion specification.
|
java.lang.String |
getConfiguration() |
int |
getNumArtifacts()
Get the number of artifact specifications added to this instance.
|
int |
getNumExclusions()
Get the number of exclusion specifications added to this instance.
|
protected boolean |
hasNonDefaultAttribute()
Check if this dependency has at least one attribute with a non-default value.
|
boolean |
isTransitive() |
static void |
prettyPrintDependencies(GradlePrettyPrinter pPrinter,
java.util.Collection<? extends DependencySpec> pDependencies)
Pretty print a collection of dependency specifications.
|
protected void |
printClosureBody(GradlePrettyPrinter pPrinter)
Pretty print the body of a closure that sets the values of the dependency's non-default
attributes.
|
void |
setConfiguration(java.lang.String pConfiguration) |
void |
setTransitive(boolean pTransitive) |
void |
setValues(DependencySpec pValues)
Set the values in this instance by copying them from another
DependencySpec. |
abstract java.lang.String |
toDependencyNotation()
Get the string notation for this dependency.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprettyPrint, quoteprotected DependencySpec(java.lang.String pConfiguration)
DependencySpec.pConfiguration - The name of the dependency's configuration.java.lang.NullPointerException - if pConfiguration is null.public java.lang.String getConfiguration()
public void setConfiguration(java.lang.String pConfiguration)
public boolean isTransitive()
public void setTransitive(boolean pTransitive)
public int getNumExclusions()
public void forEachExclusion(java.util.function.Consumer<? super ExclusionSpec> pAction)
pAction - The action to apply to the exclusion specifications.java.lang.NullPointerException - if pAction is null.public void addExclusion(ExclusionSpec pExclusionSpec)
pExclusionSpec - The specification to add.public void addExclusion(java.lang.String pGroup,
java.lang.String pModule)
pGroup - The exclusion's group.pModule - The exclusion's module.public int getNumArtifacts()
public void forEachArtifact(java.util.function.Consumer<? super ArtifactSpec> pAction)
pAction - The action to apply to the artifact specifications.java.lang.NullPointerException - if pAction is null.public void addArtifact(ArtifactSpec pArtifactSpec)
pArtifactSpec - The specification to add.public void addArtifact(java.lang.String pName,
java.lang.String pType,
java.lang.String pExtension,
java.lang.String pClassifier,
java.lang.String pUrl)
pName - The name of the artifact.pType - The artifact's type. Normally the same value as the extension, e.g.
"jar".pExtension - The artifact's extension. Normally the same value as the type.pClassifier - The artifact's classifier.pUrl - The URL under which the artifact can be retrieved.java.lang.NullPointerException - if pName is null.public void setValues(DependencySpec pValues)
DependencySpec.pValues - The values to copy into this instance.java.lang.NullPointerException - if pValues is null.public abstract java.lang.String toDependencyNotation()
public abstract boolean addTo(org.gradle.api.Project pProject)
pProject - The project to add this dependency to.java.lang.NullPointerException - if pProject is null.public static void prettyPrintDependencies(GradlePrettyPrinter pPrinter, java.util.Collection<? extends DependencySpec> pDependencies)
pPrinter - The printer to print with.pDependencies - The dependencies to print.java.lang.NullPointerException - if any of the parameters is null.protected boolean hasNonDefaultAttribute()
protected void printClosureBody(GradlePrettyPrinter pPrinter)
pPrinter - The printer to print with.java.lang.NullPointerException - if pPrinter is null.