diff options
| author | 2020-06-05 10:05:50 +0000 | |
|---|---|---|
| committer | 2020-06-05 10:05:50 +0000 | |
| commit | 4ecb0d6bb0b2d15ad31ed83b76f62f1b010acc3a (patch) | |
| tree | 27e3ca7c1a68cc6e75cede4c13e2f69bebc0b9d7 /apex/apex.go | |
| parent | 2743c1def6c91f77cb52cc96f18ef0c771b15ad4 (diff) | |
| parent | cbe50c7073feb8b295fbcf44dce3cb1c723f3008 (diff) | |
Merge "Use Stem where output file name is expected in APEX" into rvc-dev
Diffstat (limited to 'apex/apex.go')
| -rw-r--r-- | apex/apex.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/apex/apex.go b/apex/apex.go index 4c5dbd0ef..2d1b06dca 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -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 } |