public class KnownUserDefinedRuleTypes extends Object implements KnownRuleTypes
SkylarkUserDefinedRule
instances. The lifetime of this object
is currently global per cell, however in the future we may handle invoking the parse pipeline
multiple times concurrently differently.Constructor and Description |
---|
KnownUserDefinedRuleTypes() |
Modifier and Type | Method and Description |
---|---|
void |
addRule(SkylarkUserDefinedRule rule)
Adds a rule to the internal cache
|
RuleDescriptor<?> |
getDescriptorByName(String name)
Get rule type, constructor arg and description object for by rule name.
|
SkylarkUserDefinedRule |
getRule(String rawBuckTypeIdentifier)
Get a rule based on its name
|
void |
invalidateExtension(com.google.devtools.build.lib.cmdline.Label extension)
Invalidates all rules found in a specific extension file
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescriptorByNameChecked
public void addRule(SkylarkUserDefinedRule rule)
NOTE: This can only be called on a rule that has been exported
rule
- The rule to cache@Nullable public SkylarkUserDefinedRule getRule(String rawBuckTypeIdentifier)
rawBuckTypeIdentifier
- The name of the rule from `buck.type` in the parser, or SkylarkUserDefinedRule.getName()
)null
if not foundpublic void invalidateExtension(com.google.devtools.build.lib.cmdline.Label extension)
public RuleDescriptor<?> getDescriptorByName(String name)
KnownRuleTypes
getDescriptorByName
in interface KnownRuleTypes