public class UserDefinedRuleNames extends Object
buck.type
attribute on targets of user defined rules.Modifier and Type | Method and Description |
---|---|
static Pair<com.google.devtools.build.lib.cmdline.Label,String> |
fromIdentifier(String identifier)
Parses the extension label and the rule name from an identifier
|
static String |
getIdentifier(com.google.devtools.build.lib.cmdline.Label extensionLabel,
String exportedName)
Creates an identifier that can be used in
buck.type in the parser |
static com.google.devtools.build.lib.syntax.SkylarkImport |
importFromIdentifier(String identifier)
Convert a 'buck.type' string into a SkylarkImport object
|
static boolean |
isUserDefinedRuleIdentifier(String identifier)
Determines whether the given identifier is for a user defined rule
|
public static String getIdentifier(com.google.devtools.build.lib.cmdline.Label extensionLabel, String exportedName)
buck.type
in the parserextensionLabel
- the label of the extension file that this rule was defined inexportedName
- the name of the rule in the extension filecell//package:extension.bzl:extension_name
public static boolean isUserDefinedRuleIdentifier(String identifier)
identifier
- the identifier from buck.type
@Nullable public static Pair<com.google.devtools.build.lib.cmdline.Label,String> fromIdentifier(String identifier)
identifier
- the identifier from buck.type
null
is returned.@Nullable public static com.google.devtools.build.lib.syntax.SkylarkImport importFromIdentifier(String identifier)
identifier
- the result from buck.typeSkylarkImport
object if identifier
is parsable as a UDR identifier,
else null