Class BuiltInProviderInfo<T extends BuiltInProviderInfo<T>>

  • Type Parameters:
    T - the specific type of the BuiltInProviderInfo
    All Implemented Interfaces:
    ProviderInfo<T>, SkylarkProviderInfo, com.google.devtools.build.lib.skylarkinterface.SkylarkPrintable, com.google.devtools.build.lib.skylarkinterface.SkylarkValue, com.google.devtools.build.lib.syntax.ClassObject
    Direct Known Subclasses:
    DefaultInfo, DotnetLegacyToolchainInfo, DotnetLibraryProviderInfo, RunInfo, TestInfo

    public abstract class BuiltInProviderInfo<T extends BuiltInProviderInfo<T>>
    extends BuckStarlarkStructObject
    implements ProviderInfo<T>
    Represents a ProviderInfo that is defined in Java. The corresponding Provider is automatically generated from the this class.

    The specific provider implementation should use the ImmutableInfo annotation, and be an abstract class that contains only methods that act as accessors of the struct. The method name will be equivalent to the struct field name. The methods should only return Skylark compatible types.

    One additional public static method may be declared, named instantiateFromSkylark. This method can take skylark compatible values, and must return an instance of this BuiltInProviderInfo. The number of arguments to this method must match the names specified in ImmutableInfo, and is mostly used to convert types, ensure that structures are immutable, etc.

    An immutable implementation will be generated for the info.

    The BuiltInProviderInfo should have a public static field containing the BuiltInProvider for the class. That provider can be created with BuiltInProvider.of(ImmutableSomeClass.class.

    TODO(bobyf): support map/list/set types better