-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.bazel
54 lines (49 loc) · 1.21 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
load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:prefix github.com/hazaelsan/ssh-relay
# gazelle:proto package
# gazelle:proto_group go_package
gazelle(name = "gazelle")
filegroup(
name = "coverage_files",
srcs = glob(["bazel-out/**/coverage.dat"]),
)
genrule(
name = "coverage_gcov",
outs = ["coverage.gcov"],
cmd = " ".join([
"$(locations @com_github_wadey_gocovmerge//:gocovmerge)",
"--",
"$(locations //:coverage_files)",
">$@",
]),
tags = ["manual"],
tools = [
":coverage_files",
"@com_github_wadey_gocovmerge//:gocovmerge",
],
)
genrule(
name = "coverage_lcov",
outs = ["coverage.lcov"],
cmd = " ".join([
"GOPATH=$(GOPATH)",
"$(locations @com_github_jandelgado_gcov2lcov//:gcov2lcov)",
"--infile=$(locations :coverage_gcov)",
"--outfile=$@",
]),
tags = ["manual"],
tools = [
":coverage_gcov",
"@com_github_jandelgado_gcov2lcov//:gcov2lcov",
],
)
genrule(
name = "coverage_html",
outs = ["coverage"],
cmd = "genhtml --output-directory $@ $(locations :coverage_lcov)",
tags = [
"local",
"manual",
],
tools = [":coverage_lcov"],
)