github.com/bazelbuild/bazel-gazelle@v0.36.1-0.20240520142334-61b277ba6fed/language/proto/BUILD.bazel (about)

     1  load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
     2  load("//language/proto/gen:def.bzl", "known_imports")
     3  
     4  # gazelle:exclude testdata
     5  
     6  known_imports(
     7      name = "known_imports",
     8      src = "proto.csv",
     9      out = "known_imports.go",
    10      key = 0,
    11      package = "proto",
    12      value = 1,
    13      var = "knownImports",
    14  )
    15  
    16  known_imports(
    17      name = "known_proto_imports",
    18      src = "proto.csv",
    19      out = "known_proto_imports.go",
    20      key = 0,
    21      package = "proto",
    22      value = 3,
    23      var = "knownProtoImports",
    24  )
    25  
    26  known_imports(
    27      name = "known_go_imports",
    28      src = "proto.csv",
    29      out = "known_go_imports.go",
    30      key = 2,
    31      package = "proto",
    32      value = 3,
    33      var = "knownGoProtoImports",
    34  )
    35  
    36  go_library(
    37      name = "proto",
    38      srcs = [
    39          "config.go",
    40          "constants.go",
    41          "fileinfo.go",
    42          "fix.go",
    43          "generate.go",
    44          "kinds.go",
    45          "known_go_imports.go",
    46          "known_imports.go",
    47          "known_proto_imports.go",
    48          "lang.go",
    49          "package.go",
    50          "resolve.go",
    51      ],
    52      importpath = "github.com/bazelbuild/bazel-gazelle/language/proto",
    53      visibility = ["//visibility:public"],
    54      deps = [
    55          "//config",
    56          "//label",
    57          "//language",
    58          "//pathtools",
    59          "//repo",
    60          "//resolve",
    61          "//rule",
    62      ],
    63  )
    64  
    65  go_test(
    66      name = "proto_test",
    67      srcs = [
    68          "config_test.go",
    69          "fileinfo_test.go",
    70          "generate_test.go",
    71          "resolve_test.go",
    72      ],
    73      data = glob(
    74          ["testdata/**"],
    75          # Empty when distributed.
    76          allow_empty = True,
    77      ),
    78      embed = [":proto"],
    79      deps = [
    80          "//config",
    81          "//label",
    82          "//language",
    83          "//merger",
    84          "//repo",
    85          "//resolve",
    86          "//rule",
    87          "//testtools",
    88          "//walk",
    89          "@com_github_bazelbuild_buildtools//build",
    90      ],
    91  )
    92  
    93  exports_files(["proto.csv"])
    94  
    95  filegroup(
    96      name = "all_files",
    97      testonly = True,
    98      srcs = [
    99          "BUILD.bazel",
   100          "config.go",
   101          "config_test.go",
   102          "constants.go",
   103          "fileinfo.go",
   104          "fileinfo_test.go",
   105          "fix.go",
   106          "generate.go",
   107          "generate_test.go",
   108          "kinds.go",
   109          "known_go_imports.go",
   110          "known_imports.go",
   111          "known_proto_imports.go",
   112          "lang.go",
   113          "package.go",
   114          "proto.csv",
   115          "resolve.go",
   116          "resolve_test.go",
   117          "//language/proto/gen:all_files",
   118      ],
   119      visibility = ["//visibility:public"],
   120  )
   121  
   122  alias(
   123      name = "go_default_library",
   124      actual = ":proto",
   125      visibility = ["//visibility:public"],
   126  )