github.com/stackb/rules_proto@v0.0.0-20240221195024-5428336c51f1/rules/providers.bzl (about)

     1  """providers.bzl
     2  """
     3  
     4  ProtoPluginInfo = provider(
     5      "ProtoPluginInfo provides metadata about how a protoc plugin should be run",
     6      fields = {
     7          "name": "The proto plugin name",
     8          "label": "The proto plugin label",
     9          "options": "A list of options to pass to the compiler for this plugin",
    10          "tool": "The plugin binary executable",
    11          "tool_target": "The plugin tool target attr",
    12          "use_built_in_shell_environment": "Whether the tool should use the built in shell environment or not",
    13          "protoc_plugin_name": "The name used for the plugin binary on the protoc command line. Useful for targeting built-in plugins. Uses plugin name when not set",
    14          "exclusions": "Exclusion filters to apply when generating outputs with this plugin. Used to prevent generating files that are included in the protobuf library, for example. Can exclude either by proto name prefix or by proto folder prefix",
    15          "mods": "awk expressions to apply to the output files",
    16          "data": "Additional files required for running the plugin",
    17          "out": "The format for the --x_out argument.  Defaults to to {BIN_DIR}",
    18          "supplementary_proto_deps": "Additional proto dependencies whose descriptors/files should be included in all protoc invocations",
    19          "deps": "The list of workspace dependencies for this plugin",
    20      },
    21  )
    22  
    23  ProtoCompileInfo = provider(
    24      "ProtoCompileInfo provides downstream rules with the outputs of proto_compile",
    25      fields = {
    26          "label": "The proto_compile rule label",
    27          "outputs": "The output files from the rule",
    28      },
    29  )
    30  
    31  ProtoDependencyInfo = provider(
    32      "Provider for a single external dependency",
    33      fields = {
    34          "buildFile": "The build_file of this dependency",
    35          "buildFileContent": "The build_file_content of this dependency",
    36          "buildFileProtoMode": "The build_file_proto_mode of this dependency",
    37          "deps": "The list of deps of this dependency  list<ProtoDependencyInfo>",
    38          "executable": "The executable attribute for 'http_file'",
    39          "importpath": "The proto dependency importpath string",
    40          "label": "The proto dependency label string",
    41          "name": "The proto dependency name (should correspond to the workspace name",
    42          "path": "The path attribute for 'local_repository'",
    43          "repositoryRule": "The name of the repository rule that instantiates this dependency",
    44          "sha256": "The sha256 attribute for 'http_archive'",
    45          "stripPrefix": "The strip_prefix attribute for 'http_archive'",
    46          "symlinkNodeModules": "The symlink_node_modules attribute for 'npm_install'",
    47          "frozenLockfile": "The frozed_lockfile attribute for 'yarn_install'",
    48          "sum": "The proto dependency sum string",
    49          "urls": "The urls string list",
    50          "version": "The version string",
    51          "workspaceSnippet": "The workspaceSnippet string list",
    52          "yarnLock": "The yarn lock file",
    53          "packageJson": "The package.json file",
    54          "packageLockJson": "The package lock json file",
    55          "patches": "The patches argument to http_archive",
    56          "patchArgs": "The patch_args argument to http_archive",
    57      },
    58  )
    59  
    60  ProtoRepositoryInfo = provider(
    61      "Provider for a proto_repository rule",
    62      fields = {
    63          "commit": "The repository commit attr value",
    64          "tag": "The proto_repository tag attr value",
    65          "vcs": "The proto_repository vcs attr value",
    66          "urls": "The proto_repository urls attr value",
    67          "sha256": "The proto_repository sha256 attr value",
    68          "strip_prefix": "The proto_repository strip_prefix attr value",
    69          "source_host": "The proto_repository source_host attr value",
    70          "source_owner": "The proto_repository source_owner attr value",
    71          "source_repo": "The proto_repository source_repo attr value",
    72          "source_prefix": "The proto_repository source_prefix attr value",
    73          "source_commit": "The proto_repository source_commit attr value",
    74      },
    75  )