github.com/bazelbuild/bazel-gazelle@v0.36.1-0.20240520142334-61b277ba6fed/internal/BUILD.bazel (about) 1 load("@bazel_skylib//:bzl_library.bzl", "bzl_library") 2 load("@io_bazel_rules_go//go/tools/bazel_testing:def.bzl", "go_bazel_test") 3 load(":gazelle_binary_test.bzl", "gazelle_binary_test_suite") 4 5 # gazelle:exclude *_test.go 6 go_bazel_test( 7 name = "bazel_test", 8 srcs = [ 9 "go_repository_test.go", 10 "runner_test.go", 11 ], 12 rule_files = [ 13 "//:all_files", 14 "@io_bazel_rules_go//:all_files", 15 ], 16 deps = ["//testtools"], 17 ) 18 19 gazelle_binary_test_suite() 20 21 # TODO(jayconrod): test fetch_repo error cases. 22 23 exports_files( 24 [ 25 "gazelle.bash.in", 26 "extend_docs.bzl", 27 "repository_docs.bzl", 28 "list_repository_tools_srcs.go", 29 "repository_rules_test_errors.patch", 30 ], 31 visibility = ["//visibility:public"], 32 ) 33 34 filegroup( 35 name = "all_files", 36 testonly = True, 37 srcs = [ 38 "BUILD.bazel", 39 "common.bzl", 40 "extend_docs.bzl", 41 "gazelle.bash.in", 42 "gazelle_binary.bzl", 43 "gazelle_binary_test.bzl", 44 "go_repository.bzl", 45 "go_repository_cache.bzl", 46 "go_repository_config.bzl", 47 "go_repository_tools.bzl", 48 "go_repository_tools_srcs.bzl", 49 "is_bazel_module.bzl", 50 "list_repository_tools_srcs.go", 51 "overlay_repository.bzl", 52 "repository_docs.bzl", 53 "repository_rules_test_errors.patch", 54 "//internal/bzlmod:all_files", 55 "//internal/gazellebinarytest:all_files", 56 "//internal/generationtest:all_files", 57 "//internal/language:all_files", 58 "//internal/module:all_files", 59 "//internal/version:all_files", 60 "//internal/wspace:all_files", 61 ], 62 visibility = ["//visibility:public"], 63 ) 64 65 bzl_library( 66 name = "gazelle_binary", 67 srcs = ["gazelle_binary.bzl"], 68 visibility = ["//:__subpackages__"], 69 deps = ["@io_bazel_rules_go//go:def"], 70 ) 71 72 bzl_library( 73 name = "go_repository", 74 srcs = ["go_repository.bzl"], 75 visibility = ["//:__subpackages__"], 76 deps = [ 77 ":common", 78 "//internal:go_repository_cache", 79 "@bazel_tools//tools/build_defs/repo:utils.bzl", 80 ], 81 ) 82 83 bzl_library( 84 name = "go_repository_cache", 85 srcs = ["go_repository_cache.bzl"], 86 visibility = ["//:__subpackages__"], 87 deps = [":common"], 88 ) 89 90 bzl_library( 91 name = "go_repository_config", 92 srcs = ["go_repository_config.bzl"], 93 visibility = ["//:__subpackages__"], 94 deps = [ 95 ":common", 96 "//internal:go_repository_cache", 97 ], 98 ) 99 100 bzl_library( 101 name = "go_repository_tools", 102 srcs = ["go_repository_tools.bzl"], 103 visibility = ["//:__subpackages__"], 104 deps = [ 105 ":common", 106 "//internal:go_repository_cache", 107 "//internal:go_repository_tools_srcs", 108 ], 109 ) 110 111 bzl_library( 112 name = "repository_docs", 113 srcs = ["repository_docs.bzl"], 114 visibility = ["//:__subpackages__"], 115 deps = [ 116 ":go_repository", 117 ":overlay_repository", 118 ], 119 ) 120 121 bzl_library( 122 name = "extend_docs", 123 srcs = ["extend_docs.bzl"], 124 visibility = ["//:__subpackages__"], 125 deps = [ 126 "gazelle_binary", 127 "//internal/generationtest", 128 ], 129 ) 130 131 bzl_library( 132 name = "common", 133 srcs = ["common.bzl"], 134 visibility = ["//:__subpackages__"], 135 ) 136 137 bzl_library( 138 name = "go_repository_tools_srcs", 139 srcs = ["go_repository_tools_srcs.bzl"], 140 visibility = ["//:__subpackages__"], 141 ) 142 143 bzl_library( 144 name = "is_bazel_module", 145 srcs = ["is_bazel_module.bzl"], 146 visibility = ["//:__subpackages__"], 147 ) 148 149 bzl_library( 150 name = "overlay_repository", 151 srcs = ["overlay_repository.bzl"], 152 visibility = ["//:__subpackages__"], 153 )