Add support of <APEX>-installed-files.txt in mixed build.
Bug: 239084750 Test: CIs Change-Id: Ie3823d1a620c3924111e71aa97df727565261c98
This commit is contained in:
@@ -1911,6 +1911,7 @@ func (a *apexBundle) ProcessBazelQueryResponse(ctx android.ModuleContext) {
|
|||||||
a.nativeApisBackedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.BackingLibs))
|
a.nativeApisBackedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.BackingLibs))
|
||||||
// TODO(b/239084755): Generate the java api using.xml file from Bazel.
|
// TODO(b/239084755): Generate the java api using.xml file from Bazel.
|
||||||
a.javaApisUsedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.JavaSymbolsUsedByApex))
|
a.javaApisUsedByModuleFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.JavaSymbolsUsedByApex))
|
||||||
|
a.installedFilesFile = android.ModuleOutPath(android.PathForBazelOut(ctx, outputs.InstalledFiles))
|
||||||
installSuffix := imageApexSuffix
|
installSuffix := imageApexSuffix
|
||||||
if a.isCompressed {
|
if a.isCompressed {
|
||||||
installSuffix = imageCapexSuffix
|
installSuffix = imageCapexSuffix
|
||||||
|
@@ -9775,6 +9775,7 @@ apex {
|
|||||||
SymbolsUsedByApex: "foo_using.txt",
|
SymbolsUsedByApex: "foo_using.txt",
|
||||||
JavaSymbolsUsedByApex: "foo_using.xml",
|
JavaSymbolsUsedByApex: "foo_using.xml",
|
||||||
BundleFile: "apex_bundle.zip",
|
BundleFile: "apex_bundle.zip",
|
||||||
|
InstalledFiles: "installed-files.txt",
|
||||||
|
|
||||||
// unused
|
// unused
|
||||||
PackageName: "pkg_name",
|
PackageName: "pkg_name",
|
||||||
@@ -9820,6 +9821,10 @@ apex {
|
|||||||
t.Errorf("Expected output file %q, got %q", w, g)
|
t.Errorf("Expected output file %q, got %q", w, g)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if w, g := "out/bazel/execroot/__main__/installed-files.txt", ab.installedFilesFile.String(); w != g {
|
||||||
|
t.Errorf("Expected installed-files.txt %q, got %q", w, g)
|
||||||
|
}
|
||||||
|
|
||||||
mkData := android.AndroidMkDataForTest(t, result.TestContext, m)
|
mkData := android.AndroidMkDataForTest(t, result.TestContext, m)
|
||||||
var builder strings.Builder
|
var builder strings.Builder
|
||||||
mkData.Custom(&builder, "foo", "BAZEL_TARGET_", "", mkData)
|
mkData.Custom(&builder, "foo", "BAZEL_TARGET_", "", mkData)
|
||||||
@@ -9828,4 +9833,7 @@ apex {
|
|||||||
if w := "ALL_MODULES.$(my_register_name).BUNDLE := out/bazel/execroot/__main__/apex_bundle.zip"; !strings.Contains(data, w) {
|
if w := "ALL_MODULES.$(my_register_name).BUNDLE := out/bazel/execroot/__main__/apex_bundle.zip"; !strings.Contains(data, w) {
|
||||||
t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
|
t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
|
||||||
}
|
}
|
||||||
|
if w := "$(call dist-for-goals,checkbuild,out/bazel/execroot/__main__/installed-files.txt:foo-installed-files.txt)"; !strings.Contains(data, w) {
|
||||||
|
t.Errorf("Expected %q in androidmk data, but did not find %q", w, data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -232,6 +232,7 @@ return json_encode({
|
|||||||
"java_symbols_used_by_apex": info.java_symbols_used_by_apex.path,
|
"java_symbols_used_by_apex": info.java_symbols_used_by_apex.path,
|
||||||
"backing_libs": info.backing_libs.path,
|
"backing_libs": info.backing_libs.path,
|
||||||
"bundle_file": info.base_with_config_zip.path,
|
"bundle_file": info.base_with_config_zip.path,
|
||||||
|
"installed_files": info.installed_files.path,
|
||||||
})`
|
})`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,6 +248,7 @@ type ApexInfo struct {
|
|||||||
JavaSymbolsUsedByApex string `json:"java_symbols_used_by_apex"`
|
JavaSymbolsUsedByApex string `json:"java_symbols_used_by_apex"`
|
||||||
BackingLibs string `json:"backing_libs"`
|
BackingLibs string `json:"backing_libs"`
|
||||||
BundleFile string `json:"bundle_file"`
|
BundleFile string `json:"bundle_file"`
|
||||||
|
InstalledFiles string `json:"installed_files"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseResult returns a value obtained by parsing the result of the request's Starlark function.
|
// ParseResult returns a value obtained by parsing the result of the request's Starlark function.
|
||||||
|
@@ -176,6 +176,7 @@ func TestGetApexInfoParseResults(t *testing.T) {
|
|||||||
"symbols_used_by_apex": "path/to/my.apex_using.txt",
|
"symbols_used_by_apex": "path/to/my.apex_using.txt",
|
||||||
"backing_libs":"path/to/backing.txt",
|
"backing_libs":"path/to/backing.txt",
|
||||||
"bundle_file": "dir/bundlefile.zip",
|
"bundle_file": "dir/bundlefile.zip",
|
||||||
|
"installed_files":"path/to/installed-files.txt",
|
||||||
"provides_native_libs":[]
|
"provides_native_libs":[]
|
||||||
}`,
|
}`,
|
||||||
expectedOutput: ApexInfo{
|
expectedOutput: ApexInfo{
|
||||||
@@ -189,6 +190,7 @@ func TestGetApexInfoParseResults(t *testing.T) {
|
|||||||
SymbolsUsedByApex: "path/to/my.apex_using.txt",
|
SymbolsUsedByApex: "path/to/my.apex_using.txt",
|
||||||
BackingLibs: "path/to/backing.txt",
|
BackingLibs: "path/to/backing.txt",
|
||||||
BundleFile: "dir/bundlefile.zip",
|
BundleFile: "dir/bundlefile.zip",
|
||||||
|
InstalledFiles: "path/to/installed-files.txt",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user