Merge "Use Stem where output file name is expected in APEX" into rvc-dev

This commit is contained in:
Anton Hansson
2020-06-05 10:05:50 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 14 deletions

View File

@@ -1227,11 +1227,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
@@ -1933,11 +1936,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
switch depTag {
case sharedLibTag:
if c, ok := child.(*cc.Module); ok {
fi := apexFileForNativeLibrary(ctx, c, handleSpecialLibs)
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, c.OutputFile().Path().Base())
provideNativeLibs = append(provideNativeLibs, fi.Stem())
}
filesInfo = append(filesInfo, apexFileForNativeLibrary(ctx, c, handleSpecialLibs))
return true // track transitive dependencies
} else {
ctx.PropertyErrorf("native_shared_libs", "%q is not a cc_library or cc_library_shared module", depName)
@@ -2047,6 +2051,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.
@@ -2058,12 +2064,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
if !android.DirectlyInAnyApex(ctx, cc.Name()) && !android.InList(cc.Name(), a.requiredDeps) {
a.requiredDeps = append(a.requiredDeps, cc.Name())
}
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
}