Rename ApexCqueryInfo to ApexInfo
cquery is redundant given this is in the cquery package.
Test: go test soong tests
Change-Id: Ib38794b712f548129eec964b8fd85bf8401a5f86
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index c157d39..1f87410 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -142,7 +142,7 @@
GetPythonBinary(label string, cfgKey configKey) (string, error)
// Returns the results of the GetApexInfo query (including output files)
- GetApexInfo(label string, cfgkey configKey) (cquery.ApexCqueryInfo, error)
+ GetApexInfo(label string, cfgkey configKey) (cquery.ApexInfo, error)
// Returns the results of the GetCcUnstrippedInfo query
GetCcUnstrippedInfo(label string, cfgkey configKey) (cquery.CcUnstrippedInfo, error)
@@ -226,7 +226,7 @@
LabelToOutputFiles map[string][]string
LabelToCcInfo map[string]cquery.CcInfo
LabelToPythonBinary map[string]string
- LabelToApexInfo map[string]cquery.ApexCqueryInfo
+ LabelToApexInfo map[string]cquery.ApexInfo
LabelToCcBinary map[string]cquery.CcUnstrippedInfo
}
@@ -249,7 +249,7 @@
return result, nil
}
-func (n MockBazelContext) GetApexInfo(_ string, _ configKey) (cquery.ApexCqueryInfo, error) {
+func (m MockBazelContext) GetApexInfo(label string, _ configKey) (cquery.ApexInfo, error) {
panic("unimplemented")
}
@@ -313,12 +313,12 @@
return "", fmt.Errorf("no bazel response found for %v", key)
}
-func (bazelCtx *bazelContext) GetApexInfo(label string, cfgKey configKey) (cquery.ApexCqueryInfo, error) {
+func (bazelCtx *bazelContext) GetApexInfo(label string, cfgKey configKey) (cquery.ApexInfo, error) {
key := makeCqueryKey(label, cquery.GetApexInfo, cfgKey)
if rawString, ok := bazelCtx.results[key]; ok {
return cquery.GetApexInfo.ParseResult(strings.TrimSpace(rawString)), nil
}
- return cquery.ApexCqueryInfo{}, fmt.Errorf("no bazel response found for %v", key)
+ return cquery.ApexInfo{}, fmt.Errorf("no bazel response found for %v", key)
}
func (bazelCtx *bazelContext) GetCcUnstrippedInfo(label string, cfgKey configKey) (cquery.CcUnstrippedInfo, error) {
@@ -345,7 +345,7 @@
panic("unimplemented")
}
-func (n noopBazelContext) GetApexInfo(_ string, _ configKey) (cquery.ApexCqueryInfo, error) {
+func (n noopBazelContext) GetApexInfo(_ string, _ configKey) (cquery.ApexInfo, error) {
panic("unimplemented")
}
diff --git a/bazel/cquery/request_type.go b/bazel/cquery/request_type.go
index febca5d..f624bf8 100644
--- a/bazel/cquery/request_type.go
+++ b/bazel/cquery/request_type.go
@@ -221,7 +221,7 @@
})`
}
-type ApexCqueryInfo struct {
+type ApexInfo struct {
SignedOutput string `json:"signed_output"`
UnsignedOutput string `json:"unsigned_output"`
ProvidesLibs []string `json:"provides_native_libs"`
@@ -234,8 +234,8 @@
// ParseResult returns a value obtained by parsing the result of the request's Starlark function.
// The given rawString must correspond to the string output which was created by evaluating the
// Starlark given in StarlarkFunctionBody.
-func (g getApexInfoType) ParseResult(rawString string) ApexCqueryInfo {
- var info ApexCqueryInfo
+func (g getApexInfoType) ParseResult(rawString string) ApexInfo {
+ var info ApexInfo
parseJson(rawString, &info)
return info
}
diff --git a/bazel/cquery/request_type_test.go b/bazel/cquery/request_type_test.go
index 42b42e1..09e3885 100644
--- a/bazel/cquery/request_type_test.go
+++ b/bazel/cquery/request_type_test.go
@@ -133,12 +133,12 @@
testCases := []struct {
description string
input string
- expectedOutput ApexCqueryInfo
+ expectedOutput ApexInfo
}{
{
description: "no result",
input: "{}",
- expectedOutput: ApexCqueryInfo{},
+ expectedOutput: ApexInfo{},
},
{
description: "one result",
@@ -149,7 +149,7 @@
`"container_key_info":["foo.x509.pem", "foo.pk8", "foo"],` +
`"package_name":"package.name",` +
`"provides_native_libs":[]}`,
- expectedOutput: ApexCqueryInfo{
+ expectedOutput: ApexInfo{
SignedOutput: "my.apex",
UnsignedOutput: "my.apex.unsigned",
RequiresLibs: []string{"//bionic/libc:libc", "//bionic/libdl:libdl"},