Make prebuilt_sdk support module-lib and system-server

This makes prebuilt_sdk look for and create modules in the module-lib
and system-server subdirs too, e.g.:
    framework-wifi.api.module-lib.latest

Bug: 149293194
Test: follow-up change
Change-Id: Idbded6b633315034e669e9c5dd2bd30725d5c76b
This commit is contained in:
Anton Hansson 2020-05-01 18:37:15 +01:00
parent 34ced82d2a
commit 0fd1de5f0b
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ func parseApiFilePath(ctx android.LoadHookContext, path string) (module string,
apiver = elements[0] apiver = elements[0]
scope = elements[1] scope = elements[1]
if scope != "public" && scope != "system" && scope != "test" { if scope != "public" && scope != "system" && scope != "test" && scope != "module-lib" && scope != "system-server" {
ctx.ModuleErrorf("invalid scope %q found in path: %q", scope, path) ctx.ModuleErrorf("invalid scope %q found in path: %q", scope, path)
return return
} }
@ -100,7 +100,7 @@ func getPrebuiltFiles(mctx android.LoadHookContext, name string) []string {
mydir := mctx.ModuleDir() + "/" mydir := mctx.ModuleDir() + "/"
var files []string var files []string
for _, apiver := range mctx.Module().(*prebuiltApis).properties.Api_dirs { for _, apiver := range mctx.Module().(*prebuiltApis).properties.Api_dirs {
for _, scope := range []string{"public", "system", "test", "core"} { for _, scope := range []string{"public", "system", "test", "core", "module-lib", "system-server"} {
vfiles, err := mctx.GlobWithDeps(mydir+apiver+"/"+scope+"/"+name, nil) vfiles, err := mctx.GlobWithDeps(mydir+apiver+"/"+scope+"/"+name, nil)
if err != nil { if err != nil {
mctx.ModuleErrorf("failed to glob %s files under %q: %s", name, mydir+apiver+"/"+scope, err) mctx.ModuleErrorf("failed to glob %s files under %q: %s", name, mydir+apiver+"/"+scope, err)