Skip to content

Commit c30be71

Browse files
committed
Move cuttlefish/common/libs/utils:result* to cuttlefish/result:result*
The `common` naming was an artifact from a time when this code was used for both device and host builds. The new location is more central and shorter to include, which aligns with it being a pervasive type in the codebase. Creating a distinct directory gives more room to separate `result.h` into multiple files, with the following benefits: - Separating the `Result` type from the `EXPECT` logic allows depending on the `Result` type without depending on every type with special handling in the macros. - Separating out `CF_EXPECTF` makes it possible to depend on `Result` without depending on `@fmt`. - Separate files are easier to understand in isolation. The original headers and build targets are left as forwarding dependencies to the new location. Bug: b/471037778
1 parent cb682ee commit c30be71

File tree

8 files changed

+567
-517
lines changed

8 files changed

+567
-517
lines changed

base/cvd/cuttlefish/common/libs/utils/BUILD.bazel

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -275,42 +275,18 @@ cf_cc_library(
275275

276276
cf_cc_library(
277277
name = "result",
278-
srcs = [
279-
"result.cpp",
280-
],
281-
hdrs = [
282-
"result.h",
283-
],
284-
deps = [
285-
"//libbase",
286-
"@fmt",
287-
],
288-
)
289-
290-
cf_cc_test(
291-
name = "result_test",
292-
srcs = [
293-
"result_test.cpp",
294-
],
278+
hdrs = ["result.h"],
295279
deps = [
296-
":result",
297-
":result_matchers",
298-
"//libbase",
299-
"@googletest//:gtest",
300-
"@googletest//:gtest_main",
280+
"//cuttlefish/result",
301281
],
302282
)
303283

304284
cf_cc_library(
305285
name = "result_matchers",
306286
testonly = 1,
307-
hdrs = [
308-
"result_matchers.h",
309-
],
287+
hdrs = ["result_matchers.h"],
310288
deps = [
311-
":result",
312-
"//libbase",
313-
"@googletest//:gtest",
289+
"//cuttlefish/result:result_matchers",
314290
],
315291
)
316292

0 commit comments

Comments
 (0)