Skip to content

Commit b378c6b

Browse files
committed
Consolidate Bazel modules in frontend
Consolidate MODULE.bazel files under frontend/ to a single top-level file. Fix build targets. Bug: b/505119120 Assisted-by: Gemini:Next
1 parent 07b2adb commit b378c6b

16 files changed

Lines changed: 95 additions & 109 deletions

File tree

frontend/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
load("@gazelle//:def.bzl", "gazelle")
2+
3+
# gazelle:prefix github.com/google/android-cuttlefish/frontend
4+
gazelle(name = "gazelle")

frontend/MODULE.bazel

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module(name = "com_github_google_android_cuttlefish_frontend")
2+
3+
bazel_dep(name = "rules_go", version = "0.60.0")
4+
bazel_dep(name = "gazelle", version = "0.50.0")
5+
6+
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
7+
go_deps.from_file(go_work = "//:go.work")
8+
use_repo(
9+
go_deps,
10+
"com_github_cenkalti_backoff_v4",
11+
"com_github_google_android_cuttlefish_frontend_src_host_orchestrator",
12+
"com_github_google_android_cuttlefish_frontend_src_liboperator",
13+
"com_github_google_btree",
14+
"com_github_google_go_cmp",
15+
"com_github_google_uuid",
16+
"com_github_gorilla_mux",
17+
"com_github_gorilla_websocket",
18+
"com_github_hashicorp_go_multierror",
19+
"com_github_pion_logging",
20+
"com_github_pion_webrtc_v3",
21+
"org_golang_google_grpc",
22+
"org_golang_google_protobuf",
23+
)

frontend/go.work

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
go 1.18
2+
3+
use (
4+
./src/host_orchestrator
5+
./src/libhoclient
6+
./src/liboperator
7+
./src/operator
8+
)

frontend/src/host_orchestrator/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
load("@gazelle//:def.bzl", "gazelle")
22
load("@rules_go//go:def.bzl", "go_binary", "go_library")
33

4-
# gazelle:resolve_regexp go github.com/google/android-cuttlefish/frontend/src/liboperator/operator @liboperator//operator
54
gazelle(name = "gazelle")
65

76
go_library(
@@ -10,8 +9,9 @@ go_library(
109
importpath = "github.com/google/android-cuttlefish/frontend/src/host_orchestrator",
1110
visibility = ["//visibility:private"],
1211
deps = [
13-
"//orchestrator",
14-
"//orchestrator/debug",
12+
"//src/host_orchestrator/orchestrator",
13+
"//src/host_orchestrator/orchestrator/debug",
14+
"//src/host_orchestrator/orchestrator/exec",
1515
"@com_github_gorilla_mux//:mux",
1616
],
1717
)

frontend/src/host_orchestrator/MODULE.bazel

Lines changed: 0 additions & 22 deletions
This file was deleted.

frontend/src/host_orchestrator/WORKSPACE

Whitespace-only changes.

frontend/src/host_orchestrator/orchestrator/BUILD.bazel

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,35 @@ go_library(
77
"createcvdaction.go",
88
"createcvdbugreportaction.go",
99
"createsnapshotaction.go",
10+
"displayaddaction.go",
11+
"displaylistaction.go",
12+
"displayremoveaction.go",
13+
"displayscreenshotaction.go",
1014
"execcvdcommandaction.go",
1115
"fetchartifactsaction.go",
1216
"getscreenrecordingaction.go",
17+
"imagedirectories.go",
1318
"instancemanager.go",
1419
"listcvdsaction.go",
15-
"operation.go",
1620
"listscreenrecordingsaction.go",
21+
"operation.go",
22+
"resetcvdaction.go",
1723
"startcvdaction.go",
1824
"userartifacts.go",
25+
"validation.go",
1926
],
2027
importpath = "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/orchestrator",
2128
visibility = ["//visibility:public"],
2229
deps = [
23-
"//api/v1:api",
24-
"//orchestrator/artifacts",
25-
"//orchestrator/cvd",
26-
"//orchestrator/cvd/output",
27-
"//orchestrator/debug",
28-
"//orchestrator/exec",
29-
"@com_github_google_android_cuttlefish_frontend_src_liboperator//operator",
30+
"//src/host_orchestrator/api/v1:api",
31+
"//src/host_orchestrator/orchestrator/cvd",
32+
"//src/host_orchestrator/orchestrator/cvd/output",
33+
"//src/host_orchestrator/orchestrator/debug",
34+
"//src/host_orchestrator/orchestrator/exec",
35+
"//src/liboperator/operator",
36+
"@com_github_google_btree//:btree",
3037
"@com_github_google_uuid//:uuid",
3138
"@com_github_gorilla_mux//:mux",
32-
"@com_github_hashicorp_go_multierror//:go-multierror",
3339
],
3440
)
3541

@@ -38,18 +44,20 @@ go_test(
3844
srcs = [
3945
"controller_test.go",
4046
"createcvdaction_test.go",
47+
"imagedirectories_test.go",
4148
"instancemanager_test.go",
4249
"listcvdsaction_test.go",
4350
"operation_test.go",
4451
"userartifacts_test.go",
52+
"validation_test.go",
4553
],
4654
embed = [":orchestrator"],
4755
deps = [
48-
"//api/v1:api",
49-
"//orchestrator/debug",
50-
"//orchestrator/exec",
51-
"//orchestrator/testing",
52-
"@com_github_google_android_cuttlefish_frontend_src_liboperator//operator",
56+
"//src/host_orchestrator/api/v1:api",
57+
"//src/host_orchestrator/orchestrator/debug",
58+
"//src/host_orchestrator/orchestrator/testing",
59+
"//src/liboperator/operator",
60+
"@com_github_google_btree//:btree",
5361
"@com_github_google_go_cmp//cmp",
5462
"@com_github_gorilla_mux//:mux",
5563
],

frontend/src/host_orchestrator/orchestrator/cvd/BUILD.bazel

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ go_library(
66
importpath = "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/orchestrator/cvd",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"//orchestrator/exec",
10-
"//orchestrator/cvd/output",
9+
"//src/host_orchestrator/orchestrator/cvd/output",
10+
"//src/host_orchestrator/orchestrator/exec",
1111
],
1212
)
1313

1414
go_test(
1515
name = "cvd_test",
16-
srcs = [
17-
"cvd_test.go",
18-
],
16+
srcs = ["cvd_test.go"],
1917
embed = [":cvd"],
20-
deps = [
21-
"//orchestrator/exec",
22-
"@com_github_google_go_cmp//cmp",
23-
],
18+
deps = ["@com_github_google_go_cmp//cmp"],
2419
)
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
load("@rules_go//go:def.bzl", "go_library", "go_test")
1+
load("@rules_go//go:def.bzl", "go_library")
22

33
go_library(
44
name = "output",
55
srcs = ["output.go"],
66
importpath = "github.com/google/android-cuttlefish/frontend/src/host_orchestrator/orchestrator/cvd/output",
77
visibility = ["//visibility:public"],
8-
deps = [
9-
"//orchestrator/exec",
10-
],
118
)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
load("@gazelle//:def.bzl", "gazelle")
22
load("@rules_go//go:def.bzl", "go_library", "go_test")
33

4-
# gazelle:resolve_regexp go github.com/google/android-cuttlefish/frontend/src/host_orchestrator/api/v1 @host_orchestrator//api/v1:api
5-
# gazelle:resolve_regexp go github.com/google/android-cuttlefish/frontend/src/liboperator/api/v1 @liboperator//api/v1:api
64
gazelle(name = "gazelle")
75

86
go_library(
97
name = "libhoclient",
108
srcs = [
9+
"fake_host_orchestrator_client.go",
1110
"host_orchestrator_client.go",
1211
"httputils.go",
1312
],
1413
importpath = "github.com/google/android-cuttlefish/frontend/src/libhoclient",
1514
visibility = ["//visibility:public"],
1615
deps = [
17-
"//webrtcclient",
16+
"//src/host_orchestrator/api/v1:api",
17+
"//src/libhoclient/webrtcclient",
18+
"//src/liboperator/api/v1:api",
1819
"@com_github_cenkalti_backoff_v4//:backoff",
19-
"@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:api",
20-
"@com_github_google_android_cuttlefish_frontend_src_liboperator//api/v1:api",
2120
"@com_github_gorilla_websocket//:websocket",
2221
"@com_github_pion_webrtc_v3//:webrtc",
2322
],
@@ -26,12 +25,13 @@ go_library(
2625
go_test(
2726
name = "libhoclient_test",
2827
srcs = [
28+
"fake_host_orchestrator_client_test.go",
2929
"host_orchestrator_client_test.go",
3030
"httputils_test.go",
3131
],
3232
embed = [":libhoclient"],
3333
deps = [
34-
"@com_github_google_android_cuttlefish_frontend_src_host_orchestrator//api/v1:api",
34+
"//src/host_orchestrator/api/v1:api",
3535
"@com_github_google_go_cmp//cmp",
3636
],
3737
)

0 commit comments

Comments
 (0)