build/fietsje: split into monogon-specific library and cli tool
This is a first pass at sightly modularizing fietsje. This allows
fietsje-for-Monogon to be used as a Go library, and moves all the
toolbase startup logic into its own executable package. This allows us
to call fietsje from some multi-purpose CI/check tool that I'm slowly
implementing on the side.
Fietsje should still be split up further, allowing a generic fietsje
library to be used for more than just the Monogon repository - but that
will come at a later point.
Change-Id: Ic59c0bb954c5416fda95d3604d5aa94553dc1030
Reviewed-on: https://review.monogon.dev/c/monogon/+/331
Reviewed-by: Mateusz Zalega <mateusz@monogon.tech>
diff --git a/build/fietsje/BUILD.bazel b/build/fietsje/BUILD.bazel
index 733a832..5fe5f5e 100644
--- a/build/fietsje/BUILD.bazel
+++ b/build/fietsje/BUILD.bazel
@@ -1,4 +1,4 @@
-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
@@ -8,30 +8,22 @@
"deps_delve.go",
"deps_gvisor.go",
"deps_kubernetes.go",
- "main.go",
+ "deps_monogon.go",
"planner.go",
"render.go",
"shelf.go",
"transitive.go",
],
importpath = "source.monogon.dev/build/fietsje",
- visibility = ["//visibility:private"],
+ visibility = ["//build:__subpackages__"],
deps = [
"//build/fietsje/proto:go_default_library",
- "//build/toolbase:go_default_library",
- "//build/toolbase/gotoolchain:go_default_library",
"@bazel_gazelle//label:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_x_mod//modfile:go_default_library",
],
)
-go_binary(
- name = "fietsje",
- embed = [":go_default_library"],
- visibility = ["//visibility:public"],
-)
-
exports_files(
[
"fietsje.bash.in",