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
Attributes 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, reprclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected 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.BaseFunctioncom.google.devtools.build.lib.syntax.EvalExceptionInterruptedExceptionpublic String toString()
toString in class com.google.devtools.build.lib.syntax.BaseFunctionpublic 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
SkylarkUserDefinedRulecom.google.devtools.build.lib.syntax.EvalExceptionpublic String getName()
getName in class com.google.devtools.build.lib.syntax.BaseFunctionpublic 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.SkylarkExportablepublic 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.SkylarkExportablecom.google.devtools.build.lib.syntax.EvalExceptionpublic com.google.common.collect.ImmutableMap<String,Attribute<?>> getAttrs()
public com.google.common.collect.ImmutableMap<String,ParamInfo<?>> getAllParamInfo()
Attributes provided to this instance