-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
100 lines (95 loc) · 2.86 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
load("@gazelle//:def.bzl", "gazelle")
load("@rules_go//go:def.bzl", "go_library", "go_test")
load("helper.bzl", "cross_compile_binary")
load("platforms.def.bzl", "PLATFORMS")
gazelle(name = "gazelle")
# Name of the binary
NAME = "tdiscuss"
go_library(
name = "{}_lib".format(NAME),
srcs = [
"config.go",
"csrf.go",
"db.go",
"helpers.go",
"main.go",
"metrics.go",
"models.go",
"parser.go",
"querier.go",
"queries.sql.go",
"server.go",
],
embedsrcs = [
"tmpl/admin.html",
"tmpl/edit-profile.html",
"tmpl/edit-thread.html",
"tmpl/edit-thread-post.html",
"tmpl/error.html",
"tmpl/footer.html",
"tmpl/header.html",
"tmpl/index-thread-partial.html",
"tmpl/index.html",
"tmpl/member.html",
"tmpl/menu.html",
"tmpl/newthread.html",
"tmpl/thread.html",
"static/style.css",
],
importpath = "github.com/imeyer/{}".format(NAME),
visibility = ["//visibility:private"],
x_defs = {
"version": "{STABLE_VERSION}",
"gitSha": "{STABLE_GIT_SHA}",
},
deps = [
"@com_github_google_uuid//:uuid",
"@com_github_jackc_pgx_v5//:pgx",
"@com_github_jackc_pgx_v5//pgconn",
"@com_github_jackc_pgx_v5//pgtype",
"@com_github_jackc_pgx_v5//pgxpool",
"@com_github_microcosm_cc_bluemonday//:bluemonday",
"@com_github_prometheus_client_golang//prometheus",
"@com_github_prometheus_client_golang//prometheus/promhttp",
"@com_github_prometheus_client_golang//prometheus/testutil",
"@com_github_yuin_goldmark//:goldmark",
"@com_github_yuin_goldmark//extension",
"@com_github_yuin_goldmark//renderer/html",
"@com_github_yuin_goldmark_emoji//:goldmark-emoji",
"@com_tailscale//client/tailscale",
"@com_tailscale//client/tailscale/apitype",
"@com_tailscale//hostinfo",
"@com_tailscale//ipn/ipnstate",
"@com_tailscale//tailcfg",
"@com_tailscale//tsnet",
"@com_tailscale//types/logger",
],
)
[cross_compile_binary(
name = NAME,
goarch = goarch,
goos = goos,
) for (goos, goarch) in PLATFORMS]
go_test(
name = "tdiscuss_test",
size = "small",
srcs = [
"config_test.go",
"csrf_test.go",
"helpers_test.go",
"metrics_test.go",
"parser_test.go",
"server_test.go",
],
embed = [":tdiscuss_lib"],
deps = [
"@com_github_jackc_pgx_v5//:pgx",
"@com_github_jackc_pgx_v5//pgtype",
"@com_github_jackc_pgx_v5//pgxpool",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
"@com_tailscale//client/tailscale/apitype",
"@com_tailscale//ipn/ipnstate",
"@com_tailscale//tailcfg",
],
)