Class Build.Rule

    • Field Detail

      • RULE_CLASS_FIELD_NUMBER

        public static final int RULE_CLASS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RULE_INPUT_FIELD_NUMBER

        public static final int RULE_INPUT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • RULE_OUTPUT_FIELD_NUMBER

        public static final int RULE_OUTPUT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DEFAULT_SETTING_FIELD_NUMBER

        public static final int DEFAULT_SETTING_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DEPRECATED_PUBLIC_BY_DEFAULT_FIELD_NUMBER

        public static final int DEPRECATED_PUBLIC_BY_DEFAULT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DEPRECATED_IS_SKYLARK_FIELD_NUMBER

        public static final int DEPRECATED_IS_SKYLARK_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SKYLARK_ENVIRONMENT_HASH_CODE_FIELD_NUMBER

        public static final int SKYLARK_ENVIRONMENT_HASH_CODE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • INSTANTIATION_STACK_FIELD_NUMBER

        public static final int INSTANTIATION_STACK_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DEFINITION_STACK_FIELD_NUMBER

        public static final int DEFINITION_STACK_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • hasName

        public boolean hasName()
         The name of the rule (formatted as an absolute label, e.g. //foo/bar:baz).
         
        required string name = 1;
        Specified by:
        hasName in interface Build.RuleOrBuilder
        Returns:
        Whether the name field is set.
      • getName

        public java.lang.String getName()
         The name of the rule (formatted as an absolute label, e.g. //foo/bar:baz).
         
        required string name = 1;
        Specified by:
        getName in interface Build.RuleOrBuilder
        Returns:
        The name.
      • getNameBytes

        public ByteString getNameBytes()
         The name of the rule (formatted as an absolute label, e.g. //foo/bar:baz).
         
        required string name = 1;
        Specified by:
        getNameBytes in interface Build.RuleOrBuilder
        Returns:
        The bytes for name.
      • hasRuleClass

        public boolean hasRuleClass()
         The rule class (e.g., java_library)
         
        required string rule_class = 2;
        Specified by:
        hasRuleClass in interface Build.RuleOrBuilder
        Returns:
        Whether the ruleClass field is set.
      • getRuleClass

        public java.lang.String getRuleClass()
         The rule class (e.g., java_library)
         
        required string rule_class = 2;
        Specified by:
        getRuleClass in interface Build.RuleOrBuilder
        Returns:
        The ruleClass.
      • hasLocation

        public boolean hasLocation()
         The BUILD file and line number of the location (formatted as
         <absolute_path>:<line_number>:<column_number>) in the rule's package's
         BUILD file where the rule instance was instantiated. The line number will
         be that of a rule invocation or macro call (that in turn invoked a
         rule). See
         https://docs.bazel.build/versions/main/skylark/macros.html#macro-creation
         
        optional string location = 3;
        Specified by:
        hasLocation in interface Build.RuleOrBuilder
        Returns:
        Whether the location field is set.
      • getLocation

        public java.lang.String getLocation()
         The BUILD file and line number of the location (formatted as
         <absolute_path>:<line_number>:<column_number>) in the rule's package's
         BUILD file where the rule instance was instantiated. The line number will
         be that of a rule invocation or macro call (that in turn invoked a
         rule). See
         https://docs.bazel.build/versions/main/skylark/macros.html#macro-creation
         
        optional string location = 3;
        Specified by:
        getLocation in interface Build.RuleOrBuilder
        Returns:
        The location.
      • getLocationBytes

        public ByteString getLocationBytes()
         The BUILD file and line number of the location (formatted as
         <absolute_path>:<line_number>:<column_number>) in the rule's package's
         BUILD file where the rule instance was instantiated. The line number will
         be that of a rule invocation or macro call (that in turn invoked a
         rule). See
         https://docs.bazel.build/versions/main/skylark/macros.html#macro-creation
         
        optional string location = 3;
        Specified by:
        getLocationBytes in interface Build.RuleOrBuilder
        Returns:
        The bytes for location.
      • getAttributeCount

        public int getAttributeCount()
         All of the attributes that describe the rule.
         
        repeated .blaze_query.Attribute attribute = 4;
        Specified by:
        getAttributeCount in interface Build.RuleOrBuilder
      • getRuleInputList

        public ProtocolStringList getRuleInputList()
         All of the inputs to the rule (formatted as absolute labels). These are
         predecessors in the dependency graph.
         
        repeated string rule_input = 5;
        Specified by:
        getRuleInputList in interface Build.RuleOrBuilder
        Returns:
        A list containing the ruleInput.
      • getRuleInputCount

        public int getRuleInputCount()
         All of the inputs to the rule (formatted as absolute labels). These are
         predecessors in the dependency graph.
         
        repeated string rule_input = 5;
        Specified by:
        getRuleInputCount in interface Build.RuleOrBuilder
        Returns:
        The count of ruleInput.
      • getRuleInput

        public java.lang.String getRuleInput​(int index)
         All of the inputs to the rule (formatted as absolute labels). These are
         predecessors in the dependency graph.
         
        repeated string rule_input = 5;
        Specified by:
        getRuleInput in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The ruleInput at the given index.
      • getRuleInputBytes

        public ByteString getRuleInputBytes​(int index)
         All of the inputs to the rule (formatted as absolute labels). These are
         predecessors in the dependency graph.
         
        repeated string rule_input = 5;
        Specified by:
        getRuleInputBytes in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the ruleInput at the given index.
      • getRuleOutputList

        public ProtocolStringList getRuleOutputList()
         All of the outputs of the rule (formatted as absolute labels). These are
         successors in the dependency graph.
         
        repeated string rule_output = 6;
        Specified by:
        getRuleOutputList in interface Build.RuleOrBuilder
        Returns:
        A list containing the ruleOutput.
      • getRuleOutputCount

        public int getRuleOutputCount()
         All of the outputs of the rule (formatted as absolute labels). These are
         successors in the dependency graph.
         
        repeated string rule_output = 6;
        Specified by:
        getRuleOutputCount in interface Build.RuleOrBuilder
        Returns:
        The count of ruleOutput.
      • getRuleOutput

        public java.lang.String getRuleOutput​(int index)
         All of the outputs of the rule (formatted as absolute labels). These are
         successors in the dependency graph.
         
        repeated string rule_output = 6;
        Specified by:
        getRuleOutput in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The ruleOutput at the given index.
      • getRuleOutputBytes

        public ByteString getRuleOutputBytes​(int index)
         All of the outputs of the rule (formatted as absolute labels). These are
         successors in the dependency graph.
         
        repeated string rule_output = 6;
        Specified by:
        getRuleOutputBytes in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the ruleOutput at the given index.
      • getDefaultSettingList

        public ProtocolStringList getDefaultSettingList()
         The set of all "features" inherited from the rule's package declaration.
         
        repeated string default_setting = 7;
        Specified by:
        getDefaultSettingList in interface Build.RuleOrBuilder
        Returns:
        A list containing the defaultSetting.
      • getDefaultSettingCount

        public int getDefaultSettingCount()
         The set of all "features" inherited from the rule's package declaration.
         
        repeated string default_setting = 7;
        Specified by:
        getDefaultSettingCount in interface Build.RuleOrBuilder
        Returns:
        The count of defaultSetting.
      • getDefaultSetting

        public java.lang.String getDefaultSetting​(int index)
         The set of all "features" inherited from the rule's package declaration.
         
        repeated string default_setting = 7;
        Specified by:
        getDefaultSetting in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The defaultSetting at the given index.
      • getDefaultSettingBytes

        public ByteString getDefaultSettingBytes​(int index)
         The set of all "features" inherited from the rule's package declaration.
         
        repeated string default_setting = 7;
        Specified by:
        getDefaultSettingBytes in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the defaultSetting at the given index.
      • hasDEPRECATEDPublicByDefault

        public boolean hasDEPRECATEDPublicByDefault()
         The rule's class's public by default value.
         
        optional bool DEPRECATED_public_by_default = 9;
        Specified by:
        hasDEPRECATEDPublicByDefault in interface Build.RuleOrBuilder
        Returns:
        Whether the dEPRECATEDPublicByDefault field is set.
      • getDEPRECATEDPublicByDefault

        public boolean getDEPRECATEDPublicByDefault()
         The rule's class's public by default value.
         
        optional bool DEPRECATED_public_by_default = 9;
        Specified by:
        getDEPRECATEDPublicByDefault in interface Build.RuleOrBuilder
        Returns:
        The dEPRECATEDPublicByDefault.
      • hasDEPRECATEDIsSkylark

        public boolean hasDEPRECATEDIsSkylark()
        optional bool DEPRECATED_is_skylark = 10;
        Specified by:
        hasDEPRECATEDIsSkylark in interface Build.RuleOrBuilder
        Returns:
        Whether the dEPRECATEDIsSkylark field is set.
      • getDEPRECATEDIsSkylark

        public boolean getDEPRECATEDIsSkylark()
        optional bool DEPRECATED_is_skylark = 10;
        Specified by:
        getDEPRECATEDIsSkylark in interface Build.RuleOrBuilder
        Returns:
        The dEPRECATEDIsSkylark.
      • hasSkylarkEnvironmentHashCode

        public boolean hasSkylarkEnvironmentHashCode()
         Hash encapsulating the behavior of this Starlark rule. Any change to this
         rule's definition that could change its behavior will be reflected here.
         
        optional string skylark_environment_hash_code = 12;
        Specified by:
        hasSkylarkEnvironmentHashCode in interface Build.RuleOrBuilder
        Returns:
        Whether the skylarkEnvironmentHashCode field is set.
      • getSkylarkEnvironmentHashCode

        public java.lang.String getSkylarkEnvironmentHashCode()
         Hash encapsulating the behavior of this Starlark rule. Any change to this
         rule's definition that could change its behavior will be reflected here.
         
        optional string skylark_environment_hash_code = 12;
        Specified by:
        getSkylarkEnvironmentHashCode in interface Build.RuleOrBuilder
        Returns:
        The skylarkEnvironmentHashCode.
      • getSkylarkEnvironmentHashCodeBytes

        public ByteString getSkylarkEnvironmentHashCodeBytes()
         Hash encapsulating the behavior of this Starlark rule. Any change to this
         rule's definition that could change its behavior will be reflected here.
         
        optional string skylark_environment_hash_code = 12;
        Specified by:
        getSkylarkEnvironmentHashCodeBytes in interface Build.RuleOrBuilder
        Returns:
        The bytes for skylarkEnvironmentHashCode.
      • getInstantiationStackList

        public ProtocolStringList getInstantiationStackList()
         The Starlark call stack at the moment the rule was instantiated.
         Each entry has the form "file:line:col: function".
         The outermost stack frame ("<toplevel>", the BUILD file) appears first;
         the frame for the rule function itself is omitted.
         The file name may be relative to package's source root directory.
         Requires --proto:instantiation_stack=true.
         
        repeated string instantiation_stack = 13;
        Specified by:
        getInstantiationStackList in interface Build.RuleOrBuilder
        Returns:
        A list containing the instantiationStack.
      • getInstantiationStackCount

        public int getInstantiationStackCount()
         The Starlark call stack at the moment the rule was instantiated.
         Each entry has the form "file:line:col: function".
         The outermost stack frame ("<toplevel>", the BUILD file) appears first;
         the frame for the rule function itself is omitted.
         The file name may be relative to package's source root directory.
         Requires --proto:instantiation_stack=true.
         
        repeated string instantiation_stack = 13;
        Specified by:
        getInstantiationStackCount in interface Build.RuleOrBuilder
        Returns:
        The count of instantiationStack.
      • getInstantiationStack

        public java.lang.String getInstantiationStack​(int index)
         The Starlark call stack at the moment the rule was instantiated.
         Each entry has the form "file:line:col: function".
         The outermost stack frame ("<toplevel>", the BUILD file) appears first;
         the frame for the rule function itself is omitted.
         The file name may be relative to package's source root directory.
         Requires --proto:instantiation_stack=true.
         
        repeated string instantiation_stack = 13;
        Specified by:
        getInstantiationStack in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The instantiationStack at the given index.
      • getInstantiationStackBytes

        public ByteString getInstantiationStackBytes​(int index)
         The Starlark call stack at the moment the rule was instantiated.
         Each entry has the form "file:line:col: function".
         The outermost stack frame ("<toplevel>", the BUILD file) appears first;
         the frame for the rule function itself is omitted.
         The file name may be relative to package's source root directory.
         Requires --proto:instantiation_stack=true.
         
        repeated string instantiation_stack = 13;
        Specified by:
        getInstantiationStackBytes in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the instantiationStack at the given index.
      • getDefinitionStackList

        public ProtocolStringList getDefinitionStackList()
         The Starlark call stack for the definition of the rule class of this
         particular rule instance. If empty, either populating the field was not
         enabled on the command line with the --proto:definition_stack flag or the
         rule is a native one.
         
        repeated string definition_stack = 14;
        Specified by:
        getDefinitionStackList in interface Build.RuleOrBuilder
        Returns:
        A list containing the definitionStack.
      • getDefinitionStackCount

        public int getDefinitionStackCount()
         The Starlark call stack for the definition of the rule class of this
         particular rule instance. If empty, either populating the field was not
         enabled on the command line with the --proto:definition_stack flag or the
         rule is a native one.
         
        repeated string definition_stack = 14;
        Specified by:
        getDefinitionStackCount in interface Build.RuleOrBuilder
        Returns:
        The count of definitionStack.
      • getDefinitionStack

        public java.lang.String getDefinitionStack​(int index)
         The Starlark call stack for the definition of the rule class of this
         particular rule instance. If empty, either populating the field was not
         enabled on the command line with the --proto:definition_stack flag or the
         rule is a native one.
         
        repeated string definition_stack = 14;
        Specified by:
        getDefinitionStack in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The definitionStack at the given index.
      • getDefinitionStackBytes

        public ByteString getDefinitionStackBytes​(int index)
         The Starlark call stack for the definition of the rule class of this
         particular rule instance. If empty, either populating the field was not
         enabled on the command line with the --proto:definition_stack flag or the
         rule is a native one.
         
        repeated string definition_stack = 14;
        Specified by:
        getDefinitionStackBytes in interface Build.RuleOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the definitionStack at the given index.
      • getSerializedSize

        public int getSerializedSize()
        Description copied from interface: MessageLite
        Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that. If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will be smaller than the actual number of bytes required and might be negative.
        Specified by:
        getSerializedSize in interface MessageLite
        Overrides:
        getSerializedSize in class GeneratedMessageV3
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from interface: Message
        Compares the specified object with this message for equality. Returns true if the given object is a message of the same type (as defined by getDescriptorForType()) and has identical values for all of its fields. Subclasses must implement this; inheriting Object.equals() is incorrect.
        Specified by:
        equals in interface Message
        Overrides:
        equals in class AbstractMessage
        Parameters:
        obj - object to be compared for equality with this message
        Returns:
        true if the specified object is equal to this message
      • hashCode

        public int hashCode()
        Description copied from interface: Message
        Returns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting Object.hashCode() is incorrect.
        Specified by:
        hashCode in interface Message
        Overrides:
        hashCode in class AbstractMessage
        Returns:
        the hash code value for this message
        See Also:
        Map.hashCode()
      • parseFrom

        public static Build.Rule parseFrom​(java.io.InputStream input)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static Build.Rule parseFrom​(java.io.InputStream input,
                                           ExtensionRegistryLite extensionRegistry)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static Build.Rule parseDelimitedFrom​(java.io.InputStream input)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static Build.Rule parseDelimitedFrom​(java.io.InputStream input,
                                                    ExtensionRegistryLite extensionRegistry)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static Build.Rule parseFrom​(CodedInputStream input)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getDefaultInstance

        public static Build.Rule getDefaultInstance()
      • getDefaultInstanceForType

        public Build.Rule getDefaultInstanceForType()
        Description copied from interface: MessageLiteOrBuilder
        Get an instance of the type with no fields set. Because no fields are set, all getters for singular fields will return default values and repeated fields will appear empty. This may or may not be a singleton. This differs from the getDefaultInstance() method of generated message classes in that this method is an abstract method of the MessageLite interface whereas getDefaultInstance() is a static method of a specific class. They return the same thing.
        Specified by:
        getDefaultInstanceForType in interface MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface MessageOrBuilder