1load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
2load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
3load(":def.bzl", "std_package_list")
4
5# gazelle:exclude testdata
6
7# TODO(jayconrod): test that the checked-in static file matches the generated
8# file. The generated code is checked in so that Gazelle can still be built
9# with "go get".
10std_package_list(
11 name = "std_package_list",
12 out = "std_package_list.go",
13)
14
15go_library(
16 name = "go",
17 srcs = [
18 "build_constraints.go",
19 "config.go",
20 "constants.go",
21 "embed.go",
22 "fileinfo.go",
23 "fix.go",
24 "generate.go",
25 "kinds.go",
26 "lang.go",
27 "modules.go",
28 "package.go",
29 "resolve.go",
30 "std_package_list.go",
31 "stdlib_links.go",
32 "update.go",
33 "utils.go",
34 "work.go",
35 ],
36 importpath = "github.com/bazelbuild/bazel-gazelle/language/go",
37 visibility = ["//visibility:public"],
38 deps = [
39 "//config",
40 "//flag",
41 "//internal/module",
42 "//internal/version",
43 "//label",
44 "//language",
45 "//language/proto",
46 "//pathtools",
47 "//repo",
48 "//resolve",
49 "//rule",
50 "@com_github_bazelbuild_buildtools//build",
51 "@org_golang_x_mod//modfile",
52 "@org_golang_x_mod//module",
53 "@org_golang_x_sync//errgroup",
54 ],
55)
56
57go_test(
58 name = "go_test",
59 srcs = [
60 "build_constraints_test.go",
61 "config_test.go",
62 "fileinfo_go_test.go",
63 "fileinfo_test.go",
64 "fix_test.go",
65 "generate_test.go",
66 "resolve_test.go",
67 "stubs_test.go",
68 "update_import_test.go",
69 ],
70 data = glob(
71 ["testdata/**"],
72 # Empty when distributed.
73 allow_empty = True,
74 ),
75 embed = [":go"],
76 deps = [
77 "//config",
78 "//label",
79 "//language",
80 "//language/proto",
81 "//merger",
82 "//pathtools",
83 "//repo",
84 "//resolve",
85 "//rule",
86 "//testtools",
87 "//walk",
88 "@com_github_bazelbuild_buildtools//build",
89 "@com_github_google_go_cmp//cmp",
90 "@io_bazel_rules_go//go/tools/bazel:go_default_library",
91 "@org_golang_x_tools_go_vcs//:vcs",
92 ],
93)
94
95filegroup(
96 name = "all_files",
97 testonly = True,
98 srcs = [
99 "BUILD.bazel",
100 "build_constraints.go",
101 "build_constraints_test.go",
102 "config.go",
103 "config_test.go",
104 "constants.go",
105 "def.bzl",
106 "embed.go",
107 "fileinfo.go",
108 "fileinfo_go_test.go",
109 "fileinfo_test.go",
110 "fix.go",
111 "fix_test.go",
112 "generate.go",
113 "generate_test.go",
114 "kinds.go",
115 "lang.go",
116 "modules.go",
117 "package.go",
118 "resolve.go",
119 "resolve_test.go",
120 "std_package_list.go",
121 "stdlib_links.go",
122 "stubs_test.go",
123 "update.go",
124 "update_import_test.go",
125 "utils.go",
126 "work.go",
127 "//language/go/gen_std_package_list:all_files",
128 ],
129 visibility = ["//visibility:public"],
130)
131
132alias(
133 name = "go_default_library",
134 actual = ":go",
135 visibility = ["//visibility:public"],
136)
137
138bzl_library(
139 name = "def",
140 srcs = ["def.bzl"],
141 visibility = ["//visibility:public"],
142 deps = ["@io_bazel_rules_go//go:def"],
143)
View as plain text