Merge "Use Stem where output file name is expected in APEX" am: 0e666433cd am: 611703096e

Change-Id: I94d8f5541deea86310ad3b249b670c61623f3b96
This commit is contained in:
Jiyong Park
2020-06-01 01:02:03 +00:00
committed by Automerger Merge Worker
3 changed files with 20 additions and 17 deletions

View File

@@ -1228,11 +1228,14 @@ func (af *apexFile) apexRelativePath(path string) string {
// Path() returns path of this apex file relative to the APEX root
func (af *apexFile) Path() string {
stem := af.builtFile.Base()
return af.apexRelativePath(af.Stem())
}
func (af *apexFile) Stem() string {
if af.stem != "" {
stem = af.stem
return af.stem
}
return af.apexRelativePath(stem)
return af.builtFile.Base()
}
// SymlinkPaths() returns paths of the symlinks (if any) relative to the APEX root
@@ -1971,13 +1974,13 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
case sharedLibTag, jniLibTag:
isJniLib := depTag == jniLibTag
if c, ok := child.(*cc.Module); ok {
// bootstrap bionic libs are treated as provided by system
if c.HasStubsVariants() && !cc.InstallToBootstrap(c.BaseModuleName(), ctx.Config()) {
provideNativeLibs = append(provideNativeLibs, c.OutputFile().Path().Base())
}
fi := apexFileForNativeLibrary(ctx, c, handleSpecialLibs)
fi.isJniLib = isJniLib
filesInfo = append(filesInfo, fi)
// bootstrap bionic libs are treated as provided by system
if c.HasStubsVariants() && !cc.InstallToBootstrap(c.BaseModuleName(), ctx.Config()) {
provideNativeLibs = append(provideNativeLibs, fi.Stem())
}
return true // track transitive dependencies
} else {
propertyName := "native_shared_libs"
@@ -2097,6 +2100,8 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// don't include it in this APEX
return false
}
af := apexFileForNativeLibrary(ctx, cc, handleSpecialLibs)
af.transitiveDep = true
if !a.Host() && !android.DirectlyInApex(ctx.ModuleName(), ctx.OtherModuleName(cc)) && (cc.IsStubs() || cc.HasStubsVariants()) {
// If the dependency is a stubs lib, don't include it in this APEX,
// but make sure that the lib is installed on the device.
@@ -2108,12 +2113,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.BaseModuleName(), a.requiredDeps) {
a.requiredDeps = append(a.requiredDeps, cc.BaseModuleName())
}
requireNativeLibs = append(requireNativeLibs, cc.OutputFile().Path().Base())
requireNativeLibs = append(requireNativeLibs, af.Stem())
// Don't track further
return false
}
af := apexFileForNativeLibrary(ctx, cc, handleSpecialLibs)
af.transitiveDep = true
filesInfo = append(filesInfo, af)
return true // track transitive dependencies
}