summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2020-05-29 21:29:20 +0900
committer Jiyong Park <jiyong@google.com> 2020-05-30 21:15:24 +0900
commitcbe50c7073feb8b295fbcf44dce3cb1c723f3008 (patch)
tree4f87ba27e7c4477f7d0dc222c24319c0ab125d85 /apex/apex.go
parented50ca8dd8806e957a42751ebac83ebe57805ab8 (diff)
Use Stem where output file name is expected in APEX
Bug: 157638999 Test: m Merged-In: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7 (cherry picked from commit f1493cc0f24fcc7736623faf171ba404fb06fef8) Change-Id: I4a4892bc2941cf1301d210fc3107c02f0e7b13b7
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/apex/apex.go b/apex/apex.go
index ba1c1d27e..34b5595b4 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1225,11 +1225,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
@@ -1931,11 +1934,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)
@@ -2045,6 +2049,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.
@@ -2056,12 +2062,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
}