-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
62 lines (55 loc) · 1.52 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
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "gazelle_binary")
load("@io_bazel_rules_go//go:def.bzl", "nogo")
nogo(
name = "my_nogo",
deps = [
"@org_golang_x_tools//go/analysis/passes/asmdecl:go_default_library",
],
visibility = ["//visibility:public"], # must have public visibility
)
gazelle_binary(
name = "gazelle_bin",
# Gazelle runs the extensions below in order. Behavior may change if the order is changed.
languages = [
"@bazel_gazelle//language/bazel/visibility:go_default_library",
"@bazel_gazelle//language/proto:go_default_library",
"@bazel_gazelle//language/go:go_default_library",
# break
"@com_github_bazelbuild_rules_python_gazelle//python",
],
visibility = ["//visibility:public"],
)
go_library(
name = "project_lib",
srcs = [
"add.c",
"add.h",
"main.go",
],
cdeps = [":add", "@libpam//:lib"],
cgo = True,
importpath = "github.com/example/project",
visibility = ["//visibility:private"],
deps = ["@in_gopkg_yaml_v3//:yaml_v3"],
)
cc_library(
name = "add",
srcs = [
"add.c",
"add.h",
],
hdrs = ["add.h"],
)
go_binary(
name = "project",
embed = [":project_lib"],
linkmode = "c-shared",
visibility = ["//visibility:public"],
)
go_test(
name = "project_test",
srcs = ["main_test.go"],
embed = [":project_lib"],
deps = ["@com_github_stretchr_testify//assert"],
)