Skip to content

Commit

Permalink
Create bazel rules for libhoclient.
Browse files Browse the repository at this point in the history
  • Loading branch information
ser-io committed Oct 9, 2024
1 parent 3cc215a commit 40596fe
Show file tree
Hide file tree
Showing 3 changed files with 772 additions and 0 deletions.
41 changes: 41 additions & 0 deletions frontend/src/libhoclient/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

gazelle(name = "gazelle")

go_library(
name = "libhoclient",
srcs = [
"client.go",
"host_orchestrator_client.go",
"httputils.go",
],
importpath = "github.com/google/android-cuttlefish/frontend/src/libhoclient",
visibility = ["//visibility:public"],
deps = [
"@com_github_cenkalti_backoff_v4//:go_default_library",
"@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:go_default_library",
"@com_github_google_android_cuttlefish_frontend_src_liboperator//api/v1:go_default_library",
"@com_github_google_cloud_android_orchestration//api/v1:go_default_library",
"@com_github_google_cloud_android_orchestration//pkg/webrtcclient:go_default_library",
"@com_github_gorilla_websocket//:go_default_library",
"@com_github_hashicorp_go_multierror//:go_default_library",
"@com_github_pion_webrtc_v3//:go_default_library",
],
)

go_test(
name = "libhoclient_test",
srcs = [
"client_test.go",
"host_orchestrator_client_test.go",
"httputils_test.go",
],
embed = [":libhoclient"],
deps = [
"@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:go_default_library",
"@com_github_google_cloud_android_orchestration//api/v1:go_default_library",
"@com_github_google_go_cmp//cmp:go_default_library",
"@com_github_hashicorp_go_multierror//:go_default_library",
],
)
32 changes: 32 additions & 0 deletions frontend/src/libhoclient/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
integrity = "sha256-M6zErg9wUC20uJPJ/B3Xqb+ZjCPn/yxFF3QdQEmpdvg=",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.0/rules_go-v0.48.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.48.0/rules_go-v0.48.0.zip",
],
)

http_archive(
name = "bazel_gazelle",
integrity = "sha256-12v3pg/YsFBEQJDfooN6Tq+YKeEWVhjuNdzspcvfWNU=",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.37.0/bazel-gazelle-v0.37.0.tar.gz",
],
)

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("//:deps.bzl", "go_dependencies")

# gazelle:repository_macro deps.bzl%go_dependencies
go_dependencies()

go_rules_dependencies()

go_register_toolchains(version = "1.23.1")

gazelle_dependencies()
Loading

0 comments on commit 40596fe

Please sign in to comment.