public abstract class SourceAttribute extends Attribute<SourcePath>
Using this attribute will automatically add source files that are build targets as dependencies.
Constructor and Description |
---|
SourceAttribute() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getDoc()
The docstring to use for this attribute
|
abstract boolean |
getMandatory()
Whether this attribute is mandatory or not
|
PostCoercionTransform<RuleAnalysisContext,Artifact> |
getPostCoercionTransform() |
abstract Object |
getPreCoercionDefaultValue()
The default value to use if no value is provided.
|
TypeCoercer<?,SourcePath> |
getTypeCoercer()
The type coercer to use to convert raw values from the parser into something usable internally.
|
static SourceAttribute |
of(Object preCoercionDefaultValue,
String doc,
boolean mandatory) |
void |
repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer) |
getAttribute, getGenericType, getValue, validateCoercedValue, validateProvidersPresent, validateValueInList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public abstract Object getPreCoercionDefaultValue()
Attribute
This will be validated against Attribute.getTypeCoercer()
, so may return a value whose type
does not match CoercedType
(e.g. a list of strings, rather than a list of SourcePath
)
getPreCoercionDefaultValue
in class Attribute<SourcePath>
public abstract String getDoc()
Attribute
getDoc
in class Attribute<SourcePath>
public abstract boolean getMandatory()
Attribute
getMandatory
in class Attribute<SourcePath>
public void repr(com.google.devtools.build.lib.skylarkinterface.SkylarkPrinter printer)
public TypeCoercer<?,SourcePath> getTypeCoercer()
Attribute
getTypeCoercer
in class Attribute<SourcePath>
public PostCoercionTransform<RuleAnalysisContext,Artifact> getPostCoercionTransform()
getPostCoercionTransform
in class Attribute<SourcePath>
public static SourceAttribute of(Object preCoercionDefaultValue, String doc, boolean mandatory)