Skip to content

Commit 8408a27

Browse files
committed
Inline GetBuildZipName into FetchContext
This was the only caller of the free function.
1 parent 12490db commit 8408a27

File tree

5 files changed

+5
-78
lines changed

5 files changed

+5
-78
lines changed

base/cvd/cuttlefish/host/commands/cvd/fetch/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ cf_cc_library(
139139
"//cuttlefish/host/libs/web:android_build_api",
140140
"//cuttlefish/host/libs/web:build_api",
141141
"//cuttlefish/host/libs/web:build_api_zip",
142-
"//cuttlefish/host/libs/web:build_zip_name",
143142
"//cuttlefish/host/libs/zip:zip_file",
144143
"//cuttlefish/host/libs/zip/libzip_cc:archive",
145144
"//libbase",

base/cvd/cuttlefish/host/commands/cvd/fetch/fetch_context.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <string>
2222
#include <string_view>
2323
#include <utility>
24+
#include <variant>
2425
#include <vector>
2526

2627
#include <android-base/file.h>
@@ -39,7 +40,6 @@
3940
#include "cuttlefish/host/libs/web/android_build_api.h"
4041
#include "cuttlefish/host/libs/web/build_api.h"
4142
#include "cuttlefish/host/libs/web/build_api_zip.h"
42-
#include "cuttlefish/host/libs/web/build_zip_name.h"
4343
#include "cuttlefish/host/libs/zip/libzip_cc/archive.h"
4444
#include "cuttlefish/host/libs/zip/zip_file.h"
4545

@@ -175,7 +175,10 @@ FetchBuildContext::FetchBuildContext(FetchContext& fetch_context,
175175
const Build& FetchBuildContext::Build() const { return build_; }
176176

177177
std::string FetchBuildContext::GetBuildZipName(const std::string& name) const {
178-
return ::cuttlefish::GetBuildZipName(build_, name);
178+
std::string product =
179+
std::visit([](auto&& arg) { return arg.product; }, build_);
180+
std::string id = std::get<0>(GetBuildIdAndTarget(build_));
181+
return product + "-" + name + "-" + id + ".zip";
179182
}
180183

181184
std::optional<std::string> FetchBuildContext::GetFilepath() const {

base/cvd/cuttlefish/host/libs/web/BUILD.bazel

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,6 @@ cf_cc_library(
105105
],
106106
)
107107

108-
cf_cc_library(
109-
name = "build_zip_name",
110-
srcs = ["build_zip_name.cc"],
111-
hdrs = ["build_zip_name.h"],
112-
deps = [
113-
"//cuttlefish/host/libs/web:android_build",
114-
"//libbase",
115-
],
116-
)
117-
118108
cf_cc_library(
119109
name = "caching_build_api",
120110
srcs = ["caching_build_api.cpp"],

base/cvd/cuttlefish/host/libs/web/build_zip_name.cc

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

base/cvd/cuttlefish/host/libs/web/build_zip_name.h

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

0 commit comments

Comments
 (0)