Fix ctx.InstallFile calls for java modules

Call ctx.InstallFile on the primary install file last so that the
primary install file can depend on the extra install files, and so that
the primary install file can be inferred from the last installed file.

Add missing ctx.InstallFile calls for the dexpreopt and hostdex outputs.

Fix the install subdirectory for modules installing to the testcases
directory.

Bug: 204136549
Test: m checkbuild
Change-Id: I7edd7647be27439d3ca0ecc589ca5e89d4ba8474
This commit is contained in:
Colin Cross
2021-11-03 14:08:20 -07:00
parent ae5330a2d9
commit 1d0eb7a9d0
4 changed files with 55 additions and 20 deletions

View File

@@ -721,10 +721,12 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
// Install the app package.
if (Bool(a.Module.properties.Installable) || ctx.Host()) && apexInfo.IsForPlatform() {
ctx.InstallFile(a.installDir, a.outputFile.Base(), a.outputFile)
var extraInstalledPaths android.Paths
for _, extra := range a.extraOutputFiles {
ctx.InstallFile(a.installDir, extra.Base(), extra)
installed := ctx.InstallFile(a.installDir, extra.Base(), extra)
extraInstalledPaths = append(extraInstalledPaths, installed)
}
ctx.InstallFile(a.installDir, a.outputFile.Base(), a.outputFile, extraInstalledPaths...)
}
a.buildAppDependencyInfo(ctx)