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/cmd/BUILD.bazel b/build/fietsje/cmd/BUILD.bazel
new file mode 100644
index 0000000..00ab0f0
--- /dev/null
+++ b/build/fietsje/cmd/BUILD.bazel
@@ -0,0 +1,19 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+ name = "go_default_library",
+ srcs = ["main.go"],
+ importpath = "source.monogon.dev/build/fietsje/cmd",
+ visibility = ["//visibility:private"],
+ deps = [
+ "//build/fietsje:go_default_library",
+ "//build/toolbase:go_default_library",
+ "//build/toolbase/gotoolchain:go_default_library",
+ ],
+)
+
+go_binary(
+ name = "cmd",
+ embed = [":go_default_library"],
+ visibility = ["//visibility:public"],
+)