-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBUILD.bazel
More file actions
66 lines (59 loc) · 1.58 KB
/
BUILD.bazel
File metadata and controls
66 lines (59 loc) · 1.58 KB
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
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("@rules_proto//proto:defs.bzl", "proto_library")
# Use built-in Bazel rules for simplicity
# Plugin configuration test
sh_test(
name = "test_plugin_config",
srcs = ["tests/test_plugin_config.sh"],
data = [
"lib/plugin.bash",
"hooks/post-command",
"bin/bazel_failure_analyzer",
"plugin.yml",
],
)
# Analyzer functionality test using shell
sh_test(
name = "test_analyzer_functionality",
srcs = ["tests/test_analyzer_functionality.sh"],
data = ["bin/bazel_failure_analyzer"],
)
# Filegroup for all plugin files
filegroup(
name = "plugin_files",
srcs = [
"plugin.yml",
"hooks/post-command",
"lib/plugin.bash",
"bin/bazel_failure_analyzer",
"README.md",
],
visibility = ["//visibility:public"],
)
# Python binary for failure analyzer (using genrule since it lacks .py extension)
genrule(
name = "failure_analyzer_py",
srcs = ["bin/bazel_failure_analyzer"],
outs = ["bin/bazel_failure_analyzer.py"],
cmd = "cp $< $@",
)
py_binary(
name = "failure_analyzer",
srcs = [
":failure_analyzer_py",
"bin/config.py",
],
main = "bin/bazel_failure_analyzer.py",
deps = [
"@protobuf//:protobuf_python",
],
visibility = ["//visibility:public"],
)
# Plugin archive for distribution
genrule(
name = "plugin_archive",
srcs = [":plugin_files"],
outs = ["bazel-annotate-plugin.tar.gz"],
cmd = "tar -czf $@ $(SRCS)",
visibility = ["//visibility:public"],
)