Package com.facebook.buck.core.model
Class BuildTarget
- java.lang.Object
-
- com.facebook.buck.core.model.BuildTarget
-
- All Implemented Interfaces:
DependencyStack.Element
,DependencyStack.ProvidesElement
,Comparable<BuildTarget>
@ThreadSafe public class BuildTarget extends Object implements Comparable<BuildTarget>, DependencyStack.Element
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildTarget
assertUnflavored()
Verifies that this build target has no flavors.int
compareTo(BuildTarget that)
boolean
equals(Object o)
BaseName
getBaseName()
CanonicalCellName
getCell()
CellRelativePath
getCellRelativeBasePath()
String
getCellRelativeName()
If this build target is cell//third_party/java/guava:guava-latest, then this would return "//third_party/java/guava:guava-latest".String
getFlavorPostfix()
An empty string when there are no flavors, or hash followed by comma-separated flavors.FlavorSet
getFlavors()
protected String
getFlavorsAsString()
String
getFullyQualifiedName()
If this build target is cell//third_party/java/guava:guava-latest, then this would return "cell//third_party/java/guava:guava-latest".String
getShortName()
String
getShortNameAndFlavorPostfix()
If this build target were cell//third_party/java/guava:guava-latest, then this would return "guava-latest".TargetConfiguration
getTargetConfiguration()
UnconfiguredBuildTarget
getUnconfiguredBuildTarget()
UnflavoredBuildTarget
getUnflavoredBuildTarget()
int
hashCode()
boolean
isFlavored()
String
toString()
String
toStringWithConfiguration()
Target name and configuration.BuildTarget
withAppendedFlavors(Flavor... flavors)
BuildTarget
withAppendedFlavors(Set<Flavor> flavors)
BuildTarget
withFlavors(Flavor... flavors)
BuildTarget
withFlavors(Iterable<? extends Flavor> flavors)
BuildTarget
withoutFlavors()
A copy of this build target but without any flavors.BuildTarget
withoutFlavors(Flavor... flavors)
BuildTarget
withoutFlavors(Set<Flavor> flavors)
BuildTarget
withShortName(String shortName)
BuildTarget
withUnflavoredBuildTarget(UnflavoredBuildTarget target)
Keep flavors and configuration, replace everything else.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.facebook.buck.core.exceptions.DependencyStack.Element
getElement
-
-
-
-
Method Detail
-
getUnconfiguredBuildTarget
public UnconfiguredBuildTarget getUnconfiguredBuildTarget()
-
getUnflavoredBuildTarget
public UnflavoredBuildTarget getUnflavoredBuildTarget()
-
getFlavors
public FlavorSet getFlavors()
-
getTargetConfiguration
public TargetConfiguration getTargetConfiguration()
-
getCell
public CanonicalCellName getCell()
-
getBaseName
public BaseName getBaseName()
-
getCellRelativeBasePath
public CellRelativePath getCellRelativeBasePath()
-
getShortName
public String getShortName()
-
getShortNameAndFlavorPostfix
public String getShortNameAndFlavorPostfix()
If this build target were cell//third_party/java/guava:guava-latest, then this would return "guava-latest". Note that the flavor of the target is included here.
-
getFlavorPostfix
public String getFlavorPostfix()
An empty string when there are no flavors, or hash followed by comma-separated flavors.
-
getFlavorsAsString
protected String getFlavorsAsString()
-
getFullyQualifiedName
public String getFullyQualifiedName()
If this build target is cell//third_party/java/guava:guava-latest, then this would return "cell//third_party/java/guava:guava-latest".
-
getCellRelativeName
public String getCellRelativeName()
If this build target is cell//third_party/java/guava:guava-latest, then this would return "//third_party/java/guava:guava-latest".
-
isFlavored
public boolean isFlavored()
-
toString
public String toString()
- Overrides:
toString
in classObject
- Returns:
getFullyQualifiedName()
-
toStringWithConfiguration
public String toStringWithConfiguration()
Target name and configuration.
-
withShortName
public BuildTarget withShortName(String shortName)
-
assertUnflavored
public BuildTarget assertUnflavored()
Verifies that this build target has no flavors.- Returns:
- this build target
- Throws:
IllegalStateException
- if a build target has flavors
-
withoutFlavors
public BuildTarget withoutFlavors(Set<Flavor> flavors)
-
withoutFlavors
public BuildTarget withoutFlavors(Flavor... flavors)
-
withoutFlavors
public BuildTarget withoutFlavors()
A copy of this build target but without any flavors.
-
withFlavors
public BuildTarget withFlavors(Flavor... flavors)
-
withFlavors
public BuildTarget withFlavors(Iterable<? extends Flavor> flavors)
-
withAppendedFlavors
public BuildTarget withAppendedFlavors(Set<Flavor> flavors)
-
withAppendedFlavors
public BuildTarget withAppendedFlavors(Flavor... flavors)
-
withUnflavoredBuildTarget
public BuildTarget withUnflavoredBuildTarget(UnflavoredBuildTarget target)
Keep flavors and configuration, replace everything else.
-
compareTo
public int compareTo(BuildTarget that)
- Specified by:
compareTo
in interfaceComparable<BuildTarget>
-
-