-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
73 lines (65 loc) · 2.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
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_sluongng_nogo_analyzer//:def.bzl", "nogo_config")
load("@com_github_sluongng_nogo_analyzer//staticcheck:def.bzl", "staticcheck_analyzers")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "nogo")
load(":staticcheck.bzl", "STATICCHECK_ANALYZERS", "STATICCHECK_OVERRIDE")
nogo_config(
name = "nogo_config",
out = "nogo_config.json",
analyzers = STATICCHECK_ANALYZERS,
override = STATICCHECK_OVERRIDE,
)
nogo(
name = "nogo",
config = ":nogo_config.json",
visibility = ["//visibility:public"],
deps = staticcheck_analyzers(STATICCHECK_ANALYZERS),
)
# gazelle:prefix github.com/AlexTereshenkov/dg-query
# Docs: https://github.com/bazelbuild/bazel-gazelle?tab=readme-ov-file#directives
gazelle(name = "gazelle")
# Docs: https://github.com/bazelbuild/bazel-gazelle?tab=readme-ov-file#setup
gazelle(
name = "update-deps",
args = [
"-from_file=go.mod",
"-to_macro=deps.bzl%go_dependencies",
"-prune",
],
command = "update-repos",
)
go_library(
name = "dg-query_lib",
srcs = ["main.go"],
importpath = "github.com/AlexTereshenkov/dg-query",
visibility = ["//visibility:public"],
deps = ["//cmd"],
)
go_binary(
name = "dg-query",
embed = [":dg-query_lib"],
visibility = ["//visibility:public"],
)
sh_binary(
name = "run_coverage_with_genhtml",
srcs = ["scripts/codecov.sh"],
args = ["$(location @lcov//:genhtml)"],
data = [
"@lcov//:genhtml",
"@lcov//:bin",
# find a way to refer to files with a `glob` or `filegroup`; none of these worked --
# the files are not included into the runfiles directory for some reason, so listing
# them individually is required
"//cmd:dependencies.go",
"//cmd:dependencies_test.go",
"//cmd:dependents.go",
"//cmd:dependents_test.go",
"//cmd:dg.go",
"//cmd:metrics.go",
"//cmd:metrics_test.go",
"//cmd:paths.go",
"//cmd:paths_test.go",
"//cmd:root.go",
],
visibility = ["//visibility:public"],
)