-
Notifications
You must be signed in to change notification settings - Fork 18
/
BUILD.bazel
173 lines (152 loc) · 4.1 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@gazelle//:def.bzl", "gazelle")
load("@rules_pkg//pkg:install.bzl", "pkg_install")
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "strip_prefix")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("//:settings.bzl", "include_scanner_rule")
exports_files(["go.mod"])
# gazelle:prefix github.com/bazelbuild/reclient
# gazelle:exclude docker
# gazelle:exclude **/*.pb.go
gazelle(
name = "gazelle",
build_tags = ["goma"],
)
platform(
name = "x64_windows",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
visibility = ["//visibility:public"],
)
config_setting(
name = "windows",
constraint_values = ["@platforms//os:windows"],
)
config_setting(
name = "linux",
constraint_values = ["@platforms//os:linux"],
)
config_setting(
name = "macos",
constraint_values = ["@platforms//os:macos"],
)
include_scanner_rule(
name = "include_scanner",
build_setting_default = "clangscandeps",
)
config_setting(
name = "clangscandeps_input_processor_config",
flag_values = {":include_scanner": "clangscandeps"},
)
config_setting(
name = "clangscandeps_input_processor_config_windows",
constraint_values = ["@platforms//os:windows"],
flag_values = {
":include_scanner": "clangscandeps",
},
)
config_setting(
name = "goma_input_processor_config",
flag_values = {":include_scanner": "goma"},
)
config_setting(
name = "goma_input_processor_config_windows",
constraint_values = ["@platforms//os:windows"],
flag_values = {
":include_scanner": "goma",
},
)
config_setting(
name = "goma_input_processor_config_windows_dbg",
constraint_values = ["@platforms//os:windows"],
flag_values = {
":include_scanner": "goma",
},
values = {"features": "dbg"},
)
config_setting(
name = "config_windows_dbg",
constraint_values = ["@platforms//os:windows"],
values = {"features": "dbg"},
)
bool_flag(
name = "use_android_glibc",
build_setting_default = False,
)
config_setting(
name = "use_android_glibc_true",
constraint_values = ["@platforms//os:linux"],
flag_values = {
":use_android_glibc": "True",
},
)
genrule(
name = "version_txt",
srcs = ["//internal/pkg/version:version_txt"],
outs = ["version.txt"],
cmd = "cat $(location //internal/pkg/version:version_txt) >> $@;" + select({
"//:clangscandeps_input_processor_config": "",
"//:goma_input_processor_config": "echo -n \"-gomaip\" >> $@",
}),
visibility = ["//visibility:public"],
)
pkg_files(
name = "artifacts_regular",
srcs = [
"LICENSE",
"NOTICE",
"version.txt",
"//cmd/scandeps:scandeps_server_sym",
],
strip_prefix = strip_prefix.files_only(),
)
pkg_files(
name = "artifacts_executable",
srcs = [
"//cmd/bootstrap",
"//cmd/dumpstats",
"//cmd/logdump",
"//cmd/metricsuploader",
"//cmd/reclientreport",
"//cmd/reproxy",
"//cmd/reproxystatus",
"//cmd/rewrapper",
"//cmd/rpl2cloudtrace",
"//cmd/rpl2trace",
"//cmd/scandeps:scandeps_server.stripped",
"@com_github_bazelbuild_remote_apis_sdks//go/cmd/remotetool",
],
attributes = pkg_attributes(
mode = "0755",
),
renames = select({
"//conditions:default": {
"//cmd/scandeps:scandeps_server.stripped": "scandeps_server",
},
"@platforms//os:windows": {
"//cmd/scandeps:scandeps_server.stripped": "scandeps_server.exe",
},
}),
strip_prefix = strip_prefix.files_only(),
)
pkg_filegroup(
name = "artifacts",
srcs = [
":artifacts_executable",
":artifacts_regular",
],
visibility = ["//visibility:public"],
)
pkg_tar(
name = "artifacts_tar",
srcs = [":artifacts"],
out = "artifacts.tar",
visibility = ["//visibility:public"],
)
pkg_install(
name = "artifacts_install",
srcs = [":artifacts"],
)