-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
54 lines (47 loc) · 1.43 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("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "TOOLS_NOGO", "go_binary", "go_library", "nogo")
gazelle(name = "gazelle")
buildifier(
name = "buildifier",
lint_mode = "fix",
mode = "fix",
)
buildifier(
name = "buildifier-check",
lint_mode = "warn",
mode = "diff",
)
# this would cause nogo analyzer to fail when running `bazel build //...`
# obj := false; res := fmt.Sprintf("%d", obj); fmt.Println(res)
# go run main.go subgraph --dg="examples/dg-linked-list.json" --root="7"
nogo(
name = "nogo",
visibility = ["//visibility:public"],
deps = TOOLS_NOGO,
)
go_library(
name = "dg-query_lib",
srcs = ["main.go"],
importpath = "github.com/AlexTereshenkov/dg-query",
visibility = ["//visibility:private"],
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//:bin/genhtml)"],
data = [
"@lcov//:bin/genhtml",
# if for some reason there will be a problem to refer to files with a `glob` or `filegroup`
# (the files are not included into the runfiles directory for some reason), you can list
# them individually here
"//cmd:exported_go_files",
],
visibility = ["//visibility:public"],
)