summaryrefslogtreecommitdiff
path: root/apex/builder.go
diff options
context:
space:
mode:
author Jooyung Han <jooyung@google.com> 2023-02-08 09:24:06 +0900
committer Jooyung Han <jooyung@google.com> 2023-02-08 09:24:06 +0900
commitdf26332d50c9c156b13844b4dbbecb43df6e3e1c (patch)
treee7fdbe1e37ce753cb780f9767769be8e9ae0a6e3 /apex/builder.go
parentd7d179a0e8c180c0911e8eb5e252023dc957728f (diff)
Remove apex.apex_name
apex_name was used to install symbol files under /apex/<apex name>, which caused duplicate rules when there's two apexes with the same apex_name. (e.g. override_apex or multi-install apexes) Since symbol files can be looked up via ELF Build-Id, we don't have to install symbol files with the actual "apex name", but instead we can install them with soong module name. Bug: 267581665 Test: m (soong test) Change-Id: I1cbe5c86d287f180c7deef93ba85ea5552680011
Diffstat (limited to 'apex/builder.go')
-rw-r--r--apex/builder.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/apex/builder.go b/apex/builder.go
index 49223a024..93ff80d70 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -446,7 +446,7 @@ func markManifestTestOnly(ctx android.ModuleContext, androidManifestFile android
func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
apexType := a.properties.ApexType
suffix := apexType.suffix()
- apexName := proptools.StringDefault(a.properties.Apex_name, a.BaseModuleName())
+ apexName := a.BaseModuleName()
////////////////////////////////////////////////////////////////////////////////////////////
// Step 1: copy built files to appropriate directories under the image directory
@@ -461,7 +461,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
// TODO(jiyong): use the RuleBuilder
var copyCommands []string
var implicitInputs []android.Path
- pathWhenActivated := android.PathForModuleInPartitionInstall(ctx, "apex", apexName)
+ apexDir := android.PathForModuleInPartitionInstall(ctx, "apex", apexName)
for _, fi := range a.filesInfo {
destPath := imageDir.Join(ctx, fi.path()).String()
// Prepare the destination path
@@ -491,12 +491,12 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
fmt.Sprintf("unzip -qDD -d %s %s", destPathDir,
fi.module.(*java.AndroidAppSet).PackedAdditionalOutputs().String()))
if installSymbolFiles {
- installedPath = ctx.InstallFileWithExtraFilesZip(pathWhenActivated.Join(ctx, fi.installDir),
+ installedPath = ctx.InstallFileWithExtraFilesZip(apexDir.Join(ctx, fi.installDir),
fi.stem(), fi.builtFile, fi.module.(*java.AndroidAppSet).PackedAdditionalOutputs())
}
} else {
if installSymbolFiles {
- installedPath = ctx.InstallFile(pathWhenActivated.Join(ctx, fi.installDir), fi.stem(), fi.builtFile)
+ installedPath = ctx.InstallFile(apexDir.Join(ctx, fi.installDir), fi.stem(), fi.builtFile)
}
}
implicitInputs = append(implicitInputs, fi.builtFile)
@@ -510,7 +510,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
symlinkDest := imageDir.Join(ctx, symlinkPath).String()
copyCommands = append(copyCommands, "ln -sfn "+filepath.Base(destPath)+" "+symlinkDest)
if installSymbolFiles {
- installedSymlink := ctx.InstallSymlink(pathWhenActivated.Join(ctx, filepath.Dir(symlinkPath)), filepath.Base(symlinkPath), installedPath)
+ installedSymlink := ctx.InstallSymlink(apexDir.Join(ctx, filepath.Dir(symlinkPath)), filepath.Base(symlinkPath), installedPath)
implicitInputs = append(implicitInputs, installedSymlink)
}
}
@@ -537,8 +537,8 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
}
implicitInputs = append(implicitInputs, a.manifestPbOut)
if installSymbolFiles {
- installedManifest := ctx.InstallFile(pathWhenActivated, "apex_manifest.pb", a.manifestPbOut)
- installedKey := ctx.InstallFile(pathWhenActivated, "apex_pubkey", a.publicKeyFile)
+ installedManifest := ctx.InstallFile(apexDir, "apex_manifest.pb", a.manifestPbOut)
+ installedKey := ctx.InstallFile(apexDir, "apex_pubkey", a.publicKeyFile)
implicitInputs = append(implicitInputs, installedManifest, installedKey)
}