Implement mixed builds for apex modules.

* Add ApexCqueryInfo to obtain apex artifacts used by the makefile
  generator and downstream modules
* Refactor code common to GenerateAndroidBuildActions and ProcessBazelQueryResponse
* Implement android.MixedBuildBuildable for modules
* Enable mixed build for apex modules with payload_type:"image"

Bug: 232085015
Test: treehugger
Change-Id: I9f1e03e5e7a5b5dde35a5db10c253069543ac973
This commit is contained in:
Sasha Smundak
2022-05-19 21:28:53 -07:00
parent b3e7dfbd80
commit 6a2b7c40b3
6 changed files with 324 additions and 100 deletions

View File

@@ -806,8 +806,8 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
return
}
if apexType == imageApex && (compressionEnabled || a.testOnlyShouldForceCompression()) {
a.isCompressed = true
a.setCompression(ctx)
if a.isCompressed {
unsignedCompressedOutputFile := android.PathForModuleOut(ctx, a.Name()+imageCapexSuffix+".unsigned")
compressRule := android.NewRuleBuilder(pctx, ctx)
@@ -837,17 +837,12 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
a.outputFile = signedCompressedOutputFile
}
installSuffix := suffix
if a.isCompressed {
installSuffix = imageCapexSuffix
}
if !a.installable() {
a.SkipInstall()
}
// Install to $OUT/soong/{target,host}/.../apex.
a.installedFile = ctx.InstallFile(a.installDir, a.Name()+installSuffix, a.outputFile,
a.installedFile = ctx.InstallFile(a.installDir, a.Name()+a.installSuffix(), a.outputFile,
a.compatSymlinks.Paths()...)
// installed-files.txt is dist'ed