@@ -7,67 +7,7 @@ workspace(name = "build_file_generation_example")
77# file. When the symbol is loaded you can use the rule.
88load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
99
10- ######################################################################
11- # We need rules_go and bazel_gazelle, to build the gazelle plugin from source.
12- # Setup instructions for this section are at
13- # https://github.com/bazelbuild/bazel-gazelle#running-gazelle-with-bazel
14- # You may need to update the version of the rule, which is listed in the above
15- # documentation.
16- ######################################################################
17-
18- # Define an http_archive rule that will download the below ruleset,
19- # test the sha, and extract the ruleset to you local bazel cache.
20-
21- http_archive (
22- name = "bazel_skylib" ,
23- sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446" ,
24- urls = [
25- "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz" ,
26- "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz" ,
27- ],
28- )
29-
30- load ("@bazel_skylib//:workspace.bzl" , "bazel_skylib_workspace" )
31-
32- bazel_skylib_workspace ()
33-
34- http_archive (
35- name = "io_bazel_rules_go" ,
36- sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a" ,
37- urls = [
38- "https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip" ,
39- "https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip" ,
40- ],
41- )
42-
43- # Download the bazel_gazelle ruleset.
44- http_archive (
45- name = "bazel_gazelle" ,
46- sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62" ,
47- urls = [
48- "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz" ,
49- "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz" ,
50- ],
51- )
52-
53- # Load rules_go ruleset and expose the toolchain and dep rules.
54- load ("@bazel_gazelle//:deps.bzl" , "gazelle_dependencies" )
55- load ("@io_bazel_rules_go//go:deps.bzl" , "go_register_toolchains" , "go_rules_dependencies" )
56-
57- # go_rules_dependencies is a function that registers external dependencies
58- # needed by the Go rules.
59- # See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies
60- go_rules_dependencies ()
61-
62- # go_rules_dependencies is a function that registers external dependencies
63- # needed by the Go rules.
64- # See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies
65- go_register_toolchains (version = "1.21.13" )
66-
67- # The following call configured the gazelle dependencies, Go environment and Go SDK.
68- gazelle_dependencies ()
69-
70- # Remaining setup is for rules_python.
10+ # Setup rules_python.
7111
7212# DON'T COPY_PASTE THIS.
7313# Our example uses `local_repository` to point to the HEAD version of rules_python.
@@ -137,6 +77,66 @@ load("@pip//:requirements.bzl", "install_deps")
13777# Initialize repositories for all packages in requirements_lock.txt.
13878install_deps ()
13979
80+ ######################################################################
81+ # We need rules_go and bazel_gazelle, to build the gazelle plugin from source.
82+ # Setup instructions for this section are at
83+ # https://github.com/bazelbuild/bazel-gazelle#running-gazelle-with-bazel
84+ # You may need to update the version of the rule, which is listed in the above
85+ # documentation.
86+ ######################################################################
87+
88+ # Define an http_archive rule that will download the below ruleset,
89+ # test the sha, and extract the ruleset to you local bazel cache.
90+
91+ http_archive (
92+ name = "bazel_skylib" ,
93+ sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446" ,
94+ urls = [
95+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz" ,
96+ "https://github.com/bazelbuild/bazel-skylib/releases/download/1.8.2/bazel-skylib-1.8.2.tar.gz" ,
97+ ],
98+ )
99+
100+ load ("@bazel_skylib//:workspace.bzl" , "bazel_skylib_workspace" )
101+
102+ bazel_skylib_workspace ()
103+
104+ http_archive (
105+ name = "io_bazel_rules_go" ,
106+ sha256 = "9d72f7b8904128afb98d46bbef82ad7223ec9ff3718d419afb355fddd9f9484a" ,
107+ urls = [
108+ "https://mirror.bazel.build/github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip" ,
109+ "https://github.com/bazel-contrib/rules_go/releases/download/v0.55.1/rules_go-v0.55.1.zip" ,
110+ ],
111+ )
112+
113+ # Download the bazel_gazelle ruleset.
114+ http_archive (
115+ name = "bazel_gazelle" ,
116+ sha256 = "75df288c4b31c81eb50f51e2e14f4763cb7548daae126817247064637fd9ea62" ,
117+ urls = [
118+ "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz" ,
119+ "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.36.0/bazel-gazelle-v0.36.0.tar.gz" ,
120+ ],
121+ )
122+
123+ # Load rules_go ruleset and expose the toolchain and dep rules.
124+ load ("@bazel_gazelle//:deps.bzl" , "gazelle_dependencies" )
125+ load ("@io_bazel_rules_go//go:deps.bzl" , "go_register_toolchains" , "go_rules_dependencies" )
126+
127+ # go_rules_dependencies is a function that registers external dependencies
128+ # needed by the Go rules.
129+ # See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies
130+ go_rules_dependencies ()
131+
132+ # go_rules_dependencies is a function that registers external dependencies
133+ # needed by the Go rules.
134+ # See: https://github.com/bazelbuild/rules_go/blob/master/go/dependencies.rst#go_rules_dependencies
135+ go_register_toolchains (version = "1.21.13" )
136+
137+ # The following call configured the gazelle dependencies, Go environment and Go SDK.
138+ gazelle_dependencies ()
139+
140140# The rules_python gazelle extension has some third-party go dependencies
141141# which we need to fetch in order to compile it.
142142load ("@rules_python_gazelle_plugin//:deps.bzl" , _py_gazelle_deps = "gazelle_deps" )
0 commit comments