...

Text file src/github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/examplepb/BUILD.bazel

Documentation: github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/examplepb

     1load("@rules_proto//proto:defs.bzl", "proto_library")
     2load("@io_bazel_rules_go//go:def.bzl", "go_library")
     3load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
     4load("@grpc_ecosystem_grpc_gateway//protoc-gen-swagger:defs.bzl", "protoc_gen_swagger")
     5
     6package(default_visibility = ["//visibility:public"])
     7
     8# TODO(yannic): Add examples/tests that use import_prefix/strip_import_prefix.
     9
    10# gazelle:exclude a_bit_of_everything.pb.gw.go
    11# gazelle:exclude echo_service.pb.gw.go
    12# gazelle:exclude flow_combination.pb.gw.go
    13# gazelle:exclude generated_input.proto
    14# gazelle:exclude non_standard_names.pb.gw.go
    15# gazelle:exclude response_body_service.pb.gw.go
    16# gazelle:exclude stream.pb.gw.go
    17# gazelle:exclude use_go_template.pb.gw.go
    18# gazelle:exclude wrappers.pb.gw.go
    19# gazelle:go_grpc_compilers @io_bazel_rules_go//proto:go_grpc,//protoc-gen-grpc-gateway:go_gen_grpc_gateway
    20
    21genrule(
    22    name = "generated_proto",
    23    srcs = ["generated_input.proto"],
    24    outs = ["generated_output.proto"],
    25    cmd = "cp $< $@",  # A simple copy simulates a generated proto file.
    26)
    27
    28proto_library(
    29    name = "examplepb_proto",
    30    srcs = [
    31        "a_bit_of_everything.proto",
    32        "echo_service.proto",
    33        "flow_combination.proto",
    34        "generate_unbound_methods.proto",
    35        "generated_output.proto",
    36        "non_standard_names.proto",
    37        "response_body_service.proto",
    38        "stream.proto",
    39        "swagger_merge_a.proto",
    40        "swagger_merge_b.proto",
    41        "unannotated_echo_service.proto",
    42        "use_go_template.proto",
    43        "wrappers.proto",
    44    ],
    45    deps = [
    46        "//examples/internal/proto/pathenum:pathenum_proto",
    47        "//examples/internal/proto/sub:sub_proto",
    48        "//examples/internal/proto/sub2:sub2_proto",
    49        "//protoc-gen-swagger/options:options_proto",
    50        "@com_google_protobuf//:duration_proto",
    51        "@com_google_protobuf//:empty_proto",
    52        "@com_google_protobuf//:field_mask_proto",
    53        "@com_google_protobuf//:timestamp_proto",
    54        "@com_google_protobuf//:wrappers_proto",
    55        "@go_googleapis//google/api:annotations_proto",
    56    ],
    57)
    58
    59go_proto_library(
    60    name = "examplepb_go_proto",
    61    compilers = [
    62        "@io_bazel_rules_go//proto:go_grpc",
    63        "//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
    64    ],
    65    importpath = "github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/examplepb",
    66    proto = ":examplepb_proto",
    67    deps = [
    68        "//examples/internal/proto/pathenum:go_default_library",
    69        "//examples/internal/proto/sub:go_default_library",
    70        "//examples/internal/proto/sub2:go_default_library",
    71        "//protoc-gen-swagger/options:go_default_library",
    72        "@go_googleapis//google/api:annotations_go_proto",
    73    ],
    74)
    75
    76go_library(
    77    name = "go_default_library",
    78    srcs = [
    79        "generate_unbound_methods.pb.gw.go",
    80        "unannotated_echo_service.pb.gw.go",
    81    ],
    82    embed = [":examplepb_go_proto"],
    83    importpath = "github.com/grpc-ecosystem/grpc-gateway/examples/internal/proto/examplepb",
    84    deps = [
    85        "//runtime:go_default_library",
    86        "//utilities:go_default_library",
    87        "@com_github_golang_protobuf//descriptor:go_default_library_gen",
    88        "@com_github_golang_protobuf//proto:go_default_library",
    89        "@org_golang_google_grpc//:go_default_library",
    90        "@org_golang_google_grpc//codes:go_default_library",
    91        "@org_golang_google_grpc//grpclog:go_default_library",
    92        "@org_golang_google_grpc//metadata:go_default_library",
    93        "@org_golang_google_grpc//status:go_default_library",
    94    ],
    95)
    96
    97protoc_gen_swagger(
    98    name = "examplepb_protoc_gen_swagger",
    99    proto = ":examplepb_proto",
   100)
   101
   102protoc_gen_swagger(
   103    name = "examplepb_protoc_gen_swagger_merged",
   104    proto = ":examplepb_proto",
   105    single_output = True,  # Outputs a single swagger.json file.
   106)

View as plain text