github.com/prysmaticlabs/prysm@v1.4.4/proto/eth/v1alpha1/BUILD.bazel (about)

     1  ##############################################################################
     2  # Common
     3  ##############################################################################
     4  
     5  load("@rules_proto//proto:defs.bzl", "proto_library")
     6  
     7  ##############################################################################
     8  # Go
     9  ##############################################################################
    10  # gazelle:ignore
    11  load("@io_bazel_rules_go//go:def.bzl", "go_library")
    12  load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
    13  load("//proto:ssz_proto_library.bzl", "ssz_proto_files")
    14  load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
    15  
    16  ##############################################################################
    17  # OpenAPI (Swagger) V2
    18  ##############################################################################
    19  load("@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2:defs.bzl", "protoc_gen_openapiv2")
    20  
    21  proto_library(
    22      name = "proto",
    23      srcs = [
    24          "attestation.proto",
    25          "beacon_block.proto",
    26          "beacon_chain.proto",
    27          "node.proto",
    28          "validator.proto",
    29  #        ":generated_swagger_proto",
    30      ],
    31      visibility = ["//visibility:public"],
    32      deps = [
    33          "//proto/eth/ext:proto",
    34          "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto",
    35          "@com_google_protobuf//:any_proto",
    36          "@com_google_protobuf//:descriptor_proto",
    37          "@com_google_protobuf//:empty_proto",
    38          "@com_google_protobuf//:timestamp_proto",
    39          "@go_googleapis//google/api:annotations_proto",
    40      ],
    41  )
    42  
    43  ##############################################################################
    44  # Go
    45  ##############################################################################
    46  ssz_gen_marshal(
    47      name = "ssz_generated_files",
    48      go_proto = ":go_proto",
    49      includes = [
    50          "@com_github_prysmaticlabs_eth2_types//:go_default_library",
    51      ],
    52      objs = [
    53          "AggregateAttestationAndProof",
    54          "Attestation",
    55          "AttestationData",
    56          "AttesterSlashing",
    57          "BeaconBlock",
    58          "BeaconBlockHeader",
    59          "Checkpoint",
    60          "Deposit",
    61          "Eth1Data",
    62          "IndexedAttestation",
    63          "ProposerSlashing",
    64          "SignedAggregateAttestationAndProof",
    65          "SignedBeaconBlock",
    66          "SignedBeaconBlockHeader",
    67          "SignedVoluntaryExit",
    68          "Validator",
    69          "VoluntaryExit",
    70          "ContributionAndProof",
    71          "SignedContributionAndProof",
    72      ],
    73  )
    74  
    75  go_proto_library(
    76      name = "go_proto",
    77      compilers = [
    78          "@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",
    79      ],
    80      importpath = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1",
    81      proto = ":proto",
    82      visibility = ["//visibility:public"],
    83      deps = [
    84          "//proto/eth/ext:go_default_library",
    85          "@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
    86          "@com_github_golang_protobuf//proto:go_default_library",
    87          "@io_bazel_rules_go//proto/wkt:empty_go_proto",
    88          "@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
    89          "@org_golang_google_protobuf//types/known/timestamppb:go_default_library",
    90          "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
    91          "@com_github_prysmaticlabs_go_bitfield//:go_default_library",
    92          "@com_github_prysmaticlabs_eth2_types//:go_default_library",
    93          "@go_googleapis//google/api:annotations_go_proto",
    94          "@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
    95          "@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
    96      ],
    97  )
    98  
    99  go_proto_library(
   100      name = "go_grpc_gateway_library",
   101      compilers = [
   102          "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
   103      ],
   104      embed = [":go_proto"],
   105      importpath = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1",
   106      protos = [":proto"],
   107      visibility = ["//visibility:private"],
   108      deps = [
   109          "//proto/eth/ext:go_default_library",
   110          "@io_bazel_rules_go//proto/wkt:empty_go_proto",
   111          "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
   112          "@com_github_prysmaticlabs_go_bitfield//:go_default_library",
   113          "@go_googleapis//google/api:annotations_go_proto",
   114          "@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
   115          "@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
   116      ],
   117  )
   118  
   119  go_library(
   120      name = "go_default_library",
   121      srcs = [
   122          ":ssz_generated_files",  # keep
   123      ],
   124      embed = [
   125          ":go_grpc_gateway_library",
   126      ],
   127      importpath = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1",
   128      visibility = ["//visibility:public"],
   129      deps = SSZ_DEPS + [
   130          "//proto/eth/ext:go_default_library",
   131          "@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
   132          "@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library",
   133          "@io_bazel_rules_go//proto/wkt:empty_go_proto",
   134          "@org_golang_google_grpc//:go_default_library",
   135          "@org_golang_google_grpc//codes:go_default_library",
   136          "@org_golang_google_grpc//grpclog:go_default_library",
   137          "@org_golang_google_grpc//metadata:go_default_library",
   138          "@org_golang_google_grpc//status:go_default_library",
   139          "@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
   140          "@com_github_golang_protobuf//proto:go_default_library",
   141          "@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
   142          "@com_github_prysmaticlabs_go_bitfield//:go_default_library",  # keep
   143          "@go_googleapis//google/api:annotations_go_proto",
   144          "@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
   145          "@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
   146          "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
   147      ],  # keep
   148  )
   149  
   150  #protoc_gen_openapiv2(
   151  #    name = "swagger",
   152  #    json_names_for_fields = True,
   153  #    proto = ":proto",
   154  #    single_output = True,
   155  #    visibility = ["//visibility:public"],
   156  #)
   157  
   158  ## Genrule for template subsitution.
   159  ## See documentation in //tools/replacer.
   160  #genrule(
   161  #    name = "generated_swagger_proto",
   162  #    srcs = [
   163  #        "swagger.proto",  # A go template compatibile file.
   164  #        "swagger_description.md",  # Replacement for description.
   165  #    ],
   166  #    outs = ["swagger_generated.proto"],
   167  #    cmd = "$(location //tools/replacer) $(location swagger.proto) description=$(location swagger_description.md) > $(@)",
   168  #    tools = ["//tools/replacer"],
   169  #)