blob: 05737ec6b02e30e79f262cf4f570f4a3a9e741ed [file] [log] [blame] [view]
Serge Bazanskibb7db922020-04-30 12:43:10 +02001Go dependency managment
2=======================
3
Serge Bazanskiee4bfdb2022-04-06 15:30:52 +02004Status: managed by [Gazelle](https://github.com/bazelbuild/bazel-gazelle).
Serge Bazanskibb7db922020-04-30 12:43:10 +02005
Serge Bazanskiee4bfdb2022-04-06 15:30:52 +02006
7 .--------.
8 | go.mod |------------.
9 '--------' |
10 | go mod tidy | bazel //:gazelle-update-repos
11 V |
12 .--------. |
13 | go.sum |-----------.|
14 '--------' |
15 V
16 .---------------------------------.
17 | third_party/go/repositories.bzl |
18 '---------------------------------'
19 | bazel run //:gazelle
20 V
21 .----------------.
22 | **/BUILD.bazel |.
23 '----------------'|
24 '----------------'
25 | bazel build //...
26 V
27 .-----------------.
28 | build artifacts |
29 '-----------------'
30
31Updating and adding new dependencies
32------------------------------------
33
34Add a Go dependency to your code, then:
35
36 $ go mod tidy
37 $ bazel run //:gazelle-update-repos
38
39NOTE: currently the first part (`go mod tidy`) doesn't work without performing some in-place symlinking in the repository. TODO(lorenz): document this
40
41Regenerating BUILDfiles
42-----------------------
43
44 $ bazel run //:gazelle