-
Notifications
You must be signed in to change notification settings - Fork 42
/
BUILD.bazel
94 lines (82 loc) · 3.33 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
load("//bazel/enkit:defs.bzl", "multirun")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@rules_python//python/pip_install:requirements.bzl", "compile_pip_requirements")
# To update and generate the BUILD.bazel files, run:
# bazelisk run //:gazelle
#
# This will scan the source code, and bazed on imports, generate
# or update the BUILD.bazel files. Run every time you change imports,
# create a new library or binary.
#
# To update the list of dependencies downloaded by bazel, run:
# bazelisk run //:gazelle_update_repos
#
# This will read the go.mod file, and based on that, add statements
# to download the correct dependency for bazel to download. The dependency
# is added to the bazel/go_repositories.bzl file.
#
# Set the prefix for this repo
# gazelle:prefix github.com/enfabrica/enkit
# Ensure that BUILD files have targets generated with the correct convention
# TODO(scott): Change to `import` after targets have migrated to use the new
# convention
# gazelle:go_naming_convention import_alias
gazelle(
name = "gazelle",
command = "fix",
prefix = "github.com/enfabrica/enkit",
)
gazelle(
name = "gazelle_update_repos",
args = [
"-from_file=go.mod",
"-to_macro=bazel/go_repositories.bzl%go_repositories",
"-prune",
],
command = "update-repos",
)
# Custom gazelle resolve mappings
# Some third-party dependencies that are bazel-aware bamboozle gazelle running
# in our repository, which tries to generate dependency labels that don't exist.
# These mappings keep gazelle from generating bogus dependency labels.
#
# gazelle:resolve go kythe.io/kythe/go/platform/delimited @io_kythe//kythe/go/platform/delimited
# Buildbarn gazelle resolve mappings
# Buildbarn dependencies may need certain overrides; these mappings are copied
# from BUILD.bazel in github.com/buildbarn/bb-remote-execution so that libraries
# from that repo can build.
# gazelle:resolve proto pkg/proto/configuration/cloud/aws/aws.proto @com_github_buildbarn_bb_storage//pkg/proto/configuration/cloud/aws:aws_proto
# gazelle:resolve proto go pkg/proto/configuration/cloud/aws/aws.proto @com_github_buildbarn_bb_storage//pkg/proto/configuration/cloud/aws
# gazelle:resolve proto proto google/rpc/code.proto @googleapis//google/rpc:code_proto
# gazelle:resolve proto go google/rpc/code.proto @org_golang_google_genproto_googleapis_rpc//code
# gazelle:resolve proto proto google/rpc/status.proto @googleapis//google/rpc:status_proto
# gazelle:resolve proto go google/rpc/status.proto @org_golang_google_genproto_googleapis_rpc//status
# gazelle:resolve go github.com/enfabrica/enkit/auth/server/assets/templates //auth/server/assets/templates
exports_files(
[
"go.mod",
"go.sum",
],
visibility = ["//:__subpackages__"],
)
# To automatically format all .bzl files and all BUILD.bzl files, run:
# bazelisk run //:buildifier
buildifier(
name = "buildifier",
)
multirun(
name = "binaries_release",
commands = [
"//enkit:deploy",
"//staco:deploy",
"//faketree:astore_push",
"//flextape/server:astore_push",
"//flextape/client/flextape_client:astore_push",
],
)
compile_pip_requirements(
name = "python_deps",
requirements_in = "requirements.in",
requirements_txt = "requirements.txt",
)