public class SkylarkUserDefinedRule
extends com.google.devtools.build.lib.syntax.BaseFunction
implements com.google.devtools.build.lib.packages.SkylarkExportable
BaseFunction
that is returned by `rule()`. Accepts user-specified parameters, and
adds invocations to the parse context. Type checking is done with coercion later; it is not
checked in this class.Modifier and Type | Method and Description |
---|---|
protected Object |
call(Object[] args,
com.google.devtools.build.lib.syntax.FuncallExpression ast,
com.google.devtools.build.lib.syntax.Environment env) |
void |
export(com.google.devtools.build.lib.cmdline.Label extensionLabel,
String exportedName) |
com.google.common.collect.ImmutableMap<String,ParamInfo<?>> |
getAllParamInfo()
Get ParamInfo objects for all of the
Attribute s provided to this instance |
com.google.common.collect.ImmutableMap<String,Attribute<?>> |
getAttrs()
The attributes that this function accepts
|
String |
getExportedName()
Get the exported name of the function within an extension file.
|
Set<String> |
getHiddenImplicitAttributes() |
com.google.devtools.build.lib.cmdline.Label |
getLabel()
Get the string representation of the label of extension file.
|
String |
getName()
Ensure that we only get our name after this function has been exported
|
boolean |
isExported() |
static SkylarkUserDefinedRule |
of(com.google.devtools.build.lib.events.Location location,
com.google.devtools.build.lib.syntax.BaseFunction implementation,
com.google.common.collect.ImmutableMap<String,Attribute<?>> implicitAttributes,
Set<String> hiddenImplicitAttributes,
Map<String,AttributeHolder> attrs,
boolean inferRunInfo,
boolean test)
Create an instance of
SkylarkUserDefinedRule |
boolean |
shouldBeTestRule()
Whether this rule is expected to be a test rule or not
|
boolean |
shouldInferRunInfo()
Whether RunInfo should be inferred for this rule
|
String |
toString()
Override the built-in signature printer, as it prints out '*' unconditionally if all arguments
are kwargs
|
call, callWithArgArray, canonicalizeArguments, configure, configure, getArgArraySize, getEnforcedArgumentTypes, getFullName, getLocation, getObjectType, getObjectTypeString, getOrCreateChildEnvironment, getParamDoc, getShortSignature, getSignature, hasSelfArgument, isConfigured, isImmutable, printTypeString, processArguments, repr
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected Object call(Object[] args, @Nullable com.google.devtools.build.lib.syntax.FuncallExpression ast, com.google.devtools.build.lib.syntax.Environment env) throws com.google.devtools.build.lib.syntax.EvalException, InterruptedException
call
in class com.google.devtools.build.lib.syntax.BaseFunction
com.google.devtools.build.lib.syntax.EvalException
InterruptedException
public String toString()
toString
in class com.google.devtools.build.lib.syntax.BaseFunction
public static SkylarkUserDefinedRule of(com.google.devtools.build.lib.events.Location location, com.google.devtools.build.lib.syntax.BaseFunction implementation, com.google.common.collect.ImmutableMap<String,Attribute<?>> implicitAttributes, Set<String> hiddenImplicitAttributes, Map<String,AttributeHolder> attrs, boolean inferRunInfo, boolean test) throws com.google.devtools.build.lib.syntax.EvalException
SkylarkUserDefinedRule
com.google.devtools.build.lib.syntax.EvalException
public String getName()
getName
in class com.google.devtools.build.lib.syntax.BaseFunction
public com.google.devtools.build.lib.cmdline.Label getLabel()
export(Label, String)
public String getExportedName()
export(Label, String)
public boolean shouldInferRunInfo()
public boolean shouldBeTestRule()
public boolean isExported()
isExported
in interface com.google.devtools.build.lib.packages.SkylarkExportable
public void export(com.google.devtools.build.lib.cmdline.Label extensionLabel, String exportedName) throws com.google.devtools.build.lib.syntax.EvalException
export
in interface com.google.devtools.build.lib.packages.SkylarkExportable
com.google.devtools.build.lib.syntax.EvalException
public com.google.common.collect.ImmutableMap<String,Attribute<?>> getAttrs()
public com.google.common.collect.ImmutableMap<String,ParamInfo<?>> getAllParamInfo()
Attribute
s provided to this instance