blob: af967780695e1374d78c13e9e80d7489cfcc45a7 [file] [log] [blame]
Leopold Schabel5c80aca2019-10-22 15:48:58 +02001load("@bazel_gazelle//:def.bzl", "gazelle")
Serge Bazanskif369cfa2020-05-22 18:36:42 +02002load("//build/fietsje:def.bzl", "fietsje")
Leopold Schabeleff72172020-01-04 15:07:52 +01003load("@io_bazel_rules_go//go:def.bzl", "go_path", "nogo")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02004
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02005# gazelle:prefix git.monogon.dev/source/nexantic.git
Leopold Schabel5c80aca2019-10-22 15:48:58 +02006gazelle(name = "gazelle")
Leopold Schabeld868d692019-11-17 17:28:29 +01007
Serge Bazanskif369cfa2020-05-22 18:36:42 +02008fietsje(name = "fietsje")
9
Leopold Schabeld868d692019-11-17 17:28:29 +010010# Shortcut for the Go SDK
11alias(
12 name = "go",
13 actual = "@go_sdk//:bin/go",
Leopold Schabela4516f92019-12-04 20:27:05 +000014 visibility = ["//visibility:public"],
15)
16
Leopold Schabel60a85b62019-11-17 19:12:41 +010017# nogo linters
18nogo(
19 name = "nogo_vet",
20 config = "nogo_config.json",
21 visibility = ["//visibility:public"],
22 # These deps enable the analyses equivalent to running `go vet`.
23 # Passing vet = True enables only a tiny subset of these (the ones
24 # that are always correct).
25 #
26 # You can see the what `go vet` does by running `go doc cmd/vet`.
27 deps = [
28 "@org_golang_x_tools//go/analysis/passes/asmdecl:go_tool_library",
29 "@org_golang_x_tools//go/analysis/passes/assign:go_tool_library",
30 "@org_golang_x_tools//go/analysis/passes/atomic:go_tool_library",
31 "@org_golang_x_tools//go/analysis/passes/bools:go_tool_library",
32 "@org_golang_x_tools//go/analysis/passes/buildtag:go_tool_library",
Hendrik Hofstadt4ff52bd2020-01-12 15:21:49 +010033 # Disable cgocall because it fails processing com_github_mattn_go_sqlite3 before exclusions are applied
34 #"@org_golang_x_tools//go/analysis/passes/cgocall:go_tool_library",
Leopold Schabel60a85b62019-11-17 19:12:41 +010035 "@org_golang_x_tools//go/analysis/passes/composite:go_tool_library",
36 "@org_golang_x_tools//go/analysis/passes/copylock:go_tool_library",
37 "@org_golang_x_tools//go/analysis/passes/httpresponse:go_tool_library",
38 "@org_golang_x_tools//go/analysis/passes/loopclosure:go_tool_library",
39 "@org_golang_x_tools//go/analysis/passes/lostcancel:go_tool_library",
40 "@org_golang_x_tools//go/analysis/passes/nilfunc:go_tool_library",
41 "@org_golang_x_tools//go/analysis/passes/printf:go_tool_library",
42 "@org_golang_x_tools//go/analysis/passes/shift:go_tool_library",
43 "@org_golang_x_tools//go/analysis/passes/stdmethods:go_tool_library",
44 "@org_golang_x_tools//go/analysis/passes/structtag:go_tool_library",
45 "@org_golang_x_tools//go/analysis/passes/tests:go_tool_library",
46 "@org_golang_x_tools//go/analysis/passes/unmarshal:go_tool_library",
47 "@org_golang_x_tools//go/analysis/passes/unreachable:go_tool_library",
48 "@org_golang_x_tools//go/analysis/passes/unsafeptr:go_tool_library",
49 "@org_golang_x_tools//go/analysis/passes/unusedresult:go_tool_library",
50 ],
51)
Serge Bazanski7a1b10c2020-02-11 10:02:21 +010052
53load("@rules_python//python:defs.bzl", "py_runtime_pair")
54
55# Python toolchains - just use the host python for now.
56# TODO(T649): move to external (nix?) interpreters.
57py_runtime(
58 name = "host_python3",
59 interpreter_path = "/usr/bin/python3",
60 python_version = "PY3",
61)
62
63py_runtime(
64 name = "host_python2",
65 interpreter_path = "/usr/bin/python2",
66 python_version = "PY2",
67)
68
69py_runtime_pair(
70 name = "host_python_pair",
71 py2_runtime = ":host_python2",
72 py3_runtime = ":host_python3",
73)
74
75toolchain(
76 name = "host_python",
77 toolchain = ":host_python_pair",
78 toolchain_type = "@rules_python//python:toolchain_type",
79)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010080
81# Shortcut for kubectl when running through bazel run
82# (don't depend on this, it might turn into an env-based PATH shortcut, use
Serge Bazanskibb7db922020-04-30 12:43:10 +020083# @io_k8s_kubernetes//cmd/kubectl instead)
Serge Bazanski2fb13a82020-02-11 12:41:37 +010084alias(
85 name = "kubectl",
Serge Bazanskibb7db922020-04-30 12:43:10 +020086 actual = "@io_k8s_kubernetes//cmd/kubectl:kubectl",
Serge Bazanski2fb13a82020-02-11 12:41:37 +010087)
Leopold Schabel3058b7a2020-06-03 17:51:07 +020088
89# Shortcut for the Delve debugger for interactive debugging
90alias(
91 name = "dlv",
92 actual = "@com_github_go_delve_delve//cmd/dlv:dlv",
93)
Lorenz Brunfc5dbc62020-05-28 12:18:07 +020094
95# Shortcut for launching a single Smalltown instance
96alias(
97 name = "launch",
98 actual = "//core/cmd/launch",
99)
Lorenz Brun52f7f292020-06-24 16:42:02 +0200100
101# Shortcut for launching a virtual network with two Smalltown instances
102alias(
103 name = "launch-multi2",
104 actual = "//core/cmd/launch-multi2",
105)