2023-03-09 09:23:42 -05:00
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_cross_binary", "go_library")
|
|
|
|
|
|
|
|
go_library(
|
|
|
|
name = "cli_lib",
|
|
|
|
srcs = ["main.go"],
|
|
|
|
importpath = "github.com/edgelesssys/constellation/v2/cli",
|
|
|
|
visibility = ["//visibility:private"],
|
|
|
|
deps = ["//cli/cmd"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# keep
|
|
|
|
go_binary(
|
|
|
|
name = "cli_oss",
|
|
|
|
embed = [":cli_lib"],
|
|
|
|
pure = "on",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# keep
|
|
|
|
go_binary(
|
|
|
|
name = "cli_enterprise",
|
|
|
|
embed = [":cli_lib"],
|
|
|
|
gotags = ["enterprise"],
|
|
|
|
pure = "on",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
[
|
|
|
|
go_cross_binary(
|
|
|
|
name = "cli_%s_%s" % (edition, platform),
|
|
|
|
platform = "@io_bazel_rules_go//go/toolchain:" + platform,
|
|
|
|
target = ":cli_%s" % edition,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
for platform in [
|
|
|
|
"darwin_amd64",
|
|
|
|
"darwin_arm64",
|
|
|
|
"linux_amd64",
|
|
|
|
"linux_arm64",
|
2023-05-30 06:02:43 -04:00
|
|
|
"windows_amd64",
|
2023-03-09 09:23:42 -05:00
|
|
|
]
|
|
|
|
for edition in [
|
|
|
|
"oss",
|
|
|
|
"enterprise",
|
|
|
|
]
|
|
|
|
]
|
2023-03-14 08:57:39 -04:00
|
|
|
|
|
|
|
[
|
|
|
|
go_cross_binary(
|
|
|
|
name = "cli_%s_host" % edition,
|
|
|
|
platform = "@local_config_platform//:host",
|
|
|
|
target = ":cli_%s" % edition,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
for edition in [
|
|
|
|
"oss",
|
|
|
|
"enterprise",
|
|
|
|
]
|
|
|
|
]
|
2023-05-30 03:05:36 -04:00
|
|
|
|
|
|
|
alias(
|
|
|
|
name = "cli_edition_host",
|
|
|
|
actual = select(
|
|
|
|
{
|
|
|
|
"//bazel/settings:cli_edition_enterprise": ":cli_enterprise_host",
|
|
|
|
"//bazel/settings:cli_edition_oss": ":cli_oss_host",
|
|
|
|
"//conditions:default": ":cli_oss_host",
|
|
|
|
},
|
|
|
|
),
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|