我正在尝试用 brazel 构建一个 Go 应用程序。这是我正在处理的现有私有 GitHub 存储库(位于此位置github.xyz.com/repo-name:),我的目标是从 main.go 文件创建一个二进制文件,该文件依赖于其他一些 Go 文件的方法。这是我在名为 e2e 的文件夹中的 BUILD.bazel 文件,其中所有这些 go 文件都存在:
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
go_binary(
name = "e2e",
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
go_library(
name = "go_default_library",
srcs = ["main.go"],
data = [
"//cmd/iasd",
"//migrations:migration_files",
"//test/iamd:client-ca-bundle.pem",
] + glob(
["testdata/**"],
),
importpath = "github.xyz.com/repo-name/test/e2e",
visibility = ["//visibility:public"],
deps = [
"//test:go_default_library",
"//vendor/github.com/bazelbuild/rules_go/go/tools/bazel:go_default_library",
"//vendor/github.com/golang-migrate/migrate:go_default_library",
"//vendor/github.com/golang-migrate/migrate/database/cockroachdb:go_default_library",
"//vendor/github.com/golang-migrate/migrate/source/file:go_default_library",
"//vendor/github.com/google/uuid:go_default_library",
"//vendor/github.com/lib/pq:go_default_library",
"//vendor/github.com/pkg/errors:go_default_library",
"//vendor/google.golang.org/grpc:go_default_library",
"//vendor/google.golang.org/grpc/credentials:go_default_library",
"//api/grpc/v1/applications:go_default_library",
"//api/grpc/v1/clients:go_default_library",
"//pkg/oauth2/mtls:go_default_library",
"//vendor/github.com/coreos/go-oidc:go_default_library",
"//vendor/github.com/dgrijalva/jwt-go:go_default_library",
"//vendor/golang.org/x/oauth2:go_default_library",
],
)
莫回无
相关分类