public class SkylarkDescriptionArg extends Object implements SkylarkDescriptionArgBuilder, BuildRuleArg
DEFAULT_TARGET_PLATFORM_PARAM_NAME
Constructor and Description |
---|
SkylarkDescriptionArg(SkylarkUserDefinedRule rule)
Create an instance of
SkylarkDescriptionArg |
Modifier and Type | Method and Description |
---|---|
void |
build()
'Build' the
SkylarkDescriptionArg . |
com.google.common.collect.ImmutableMap<String,ParamInfo<?>> |
getAllParamInfo() |
com.google.common.collect.ImmutableList<UnconfiguredBuildTarget> |
getCompatibleWith()
A list of
config_setting a target is compatible with. |
com.google.common.collect.ImmutableSortedSet<String> |
getContacts() |
Optional<UnconfiguredBuildTarget> |
getDefaultTargetPlatform()
The name of build target default "new" platform: it is used when a platform is not specified
either globally or in a target which used this target as a dependency.
|
com.google.devtools.build.lib.syntax.BaseFunction |
getImplementation() |
com.google.common.collect.ImmutableSortedSet<String> |
getLabels() |
com.google.common.collect.ImmutableSet<SourcePath> |
getLicenses() |
String |
getName()
Each rule has a name
|
Object |
getPostCoercionValue(String attr)
Get an attribute's value after it was set in
SkylarkDescriptionArgBuilder.setPostCoercionValue(String, Object) |
SkylarkUserDefinedRule |
getRule()
Get the
SkylarkDescriptionArg that has information about parameters and the user's
implementation function |
void |
setPostCoercionValue(String attr,
Object value)
Set the value for a specific attribute after it has been successfully coerced/type checked.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
labelsContainsAnyOf
public SkylarkDescriptionArg(SkylarkUserDefinedRule rule)
SkylarkDescriptionArg
rule
- the rule that should be used to determine acceptable attributes for a target, and
to provide access to the user's implementation functionpublic void setPostCoercionValue(String attr, Object value)
SkylarkDescriptionArgBuilder
SkylarkUserDefinedRule
setPostCoercionValue
in interface SkylarkDescriptionArgBuilder
attr
- The attribute to set the value forvalue
- The value to set. Must not be null.public Object getPostCoercionValue(String attr)
SkylarkDescriptionArgBuilder
SkylarkDescriptionArgBuilder.setPostCoercionValue(String, Object)
It is an error to get an attribute that has not been set.
getPostCoercionValue
in interface SkylarkDescriptionArgBuilder
attr
- The attribute to get the value forpublic void build()
SkylarkDescriptionArg
. After this has been called, setPostCoercionValue(String, Object)
may not be called.public SkylarkUserDefinedRule getRule()
SkylarkDescriptionArg
that has information about parameters and the user's
implementation functionpublic String getName()
ConstructorArg
getName
in interface ConstructorArg
public Optional<UnconfiguredBuildTarget> getDefaultTargetPlatform()
BuildRuleArg
The value is a build target, but we specify it as string, because this function is not actually called, but the attr is fetched by name from the raw (unconfigured) target node.
getDefaultTargetPlatform
in interface BuildRuleArg
public com.google.common.collect.ImmutableMap<String,ParamInfo<?>> getAllParamInfo()
public com.google.devtools.build.lib.syntax.BaseFunction getImplementation()
public com.google.common.collect.ImmutableSet<SourcePath> getLicenses()
getLicenses
in interface BuildRuleArg
public com.google.common.collect.ImmutableSortedSet<String> getLabels()
getLabels
in interface BuildRuleArg
public com.google.common.collect.ImmutableSortedSet<String> getContacts()
public com.google.common.collect.ImmutableList<UnconfiguredBuildTarget> getCompatibleWith()
BuildRuleArg
config_setting
a target is compatible with.getCompatibleWith
in interface BuildRuleArg