Merge "apex: emit file_contexts for flattened apex"
This commit is contained in:
25
apex/apex.go
25
apex/apex.go
@@ -19,7 +19,6 @@ import (
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/bootstrap"
|
||||
@@ -743,12 +742,6 @@ func init() {
|
||||
android.PreDepsMutators(RegisterPreDepsMutators)
|
||||
android.PostDepsMutators(RegisterPostDepsMutators)
|
||||
|
||||
android.RegisterMakeVarsProvider(pctx, func(ctx android.MakeVarsContext) {
|
||||
apexFileContextsInfos := apexFileContextsInfos(ctx.Config())
|
||||
sort.Strings(*apexFileContextsInfos)
|
||||
ctx.Strict("APEX_FILE_CONTEXTS_INFOS", strings.Join(*apexFileContextsInfos, " "))
|
||||
})
|
||||
|
||||
android.AddNeverAllowRules(createApexPermittedPackagesRules(qModulesPackages())...)
|
||||
android.AddNeverAllowRules(createApexPermittedPackagesRules(rModulesPackages())...)
|
||||
}
|
||||
@@ -916,24 +909,6 @@ func apexMutator(mctx android.BottomUpMutatorContext) {
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
apexFileContextsInfosKey = android.NewOnceKey("apexFileContextsInfosKey")
|
||||
apexFileContextsInfosMutex sync.Mutex
|
||||
)
|
||||
|
||||
func apexFileContextsInfos(config android.Config) *[]string {
|
||||
return config.Once(apexFileContextsInfosKey, func() interface{} {
|
||||
return &[]string{}
|
||||
}).(*[]string)
|
||||
}
|
||||
|
||||
func addFlattenedFileContextsInfos(ctx android.BaseModuleContext, fileContextsInfo string) {
|
||||
apexFileContextsInfosMutex.Lock()
|
||||
defer apexFileContextsInfosMutex.Unlock()
|
||||
apexFileContextsInfos := apexFileContextsInfos(ctx.Config())
|
||||
*apexFileContextsInfos = append(*apexFileContextsInfos, fileContextsInfo)
|
||||
}
|
||||
|
||||
func apexFlattenedMutator(mctx android.BottomUpMutatorContext) {
|
||||
if !mctx.Module().Enabled() {
|
||||
return
|
||||
|
Reference in New Issue
Block a user