Merge "Implement sysprop type checker" am: ac66c74a58
Change-Id: I1bb2c3c44373d70ff50b6415f922adfb812115a9
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"path"
|
"path"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
"github.com/google/blueprint/proptools"
|
"github.com/google/blueprint/proptools"
|
||||||
@@ -154,8 +155,21 @@ type syspropLibraryProperties struct {
|
|||||||
var (
|
var (
|
||||||
pctx = android.NewPackageContext("android/soong/sysprop")
|
pctx = android.NewPackageContext("android/soong/sysprop")
|
||||||
syspropCcTag = dependencyTag{name: "syspropCc"}
|
syspropCcTag = dependencyTag{name: "syspropCc"}
|
||||||
|
|
||||||
|
syspropLibrariesKey = android.NewOnceKey("syspropLibraries")
|
||||||
|
syspropLibrariesLock sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func syspropLibraries(config android.Config) *[]string {
|
||||||
|
return config.Once(syspropLibrariesKey, func() interface{} {
|
||||||
|
return &[]string{}
|
||||||
|
}).(*[]string)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SyspropLibraries(config android.Config) []string {
|
||||||
|
return append([]string{}, *syspropLibraries(config)...)
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
android.RegisterModuleType("sysprop_library", syspropLibraryFactory)
|
android.RegisterModuleType("sysprop_library", syspropLibraryFactory)
|
||||||
}
|
}
|
||||||
@@ -195,6 +209,10 @@ func (m *syspropLibrary) HasPublicStub() bool {
|
|||||||
return proptools.Bool(m.properties.Public_stub)
|
return proptools.Bool(m.properties.Public_stub)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *syspropLibrary) CurrentSyspropApiFile() android.Path {
|
||||||
|
return m.currentApiFile
|
||||||
|
}
|
||||||
|
|
||||||
func (m *syspropLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (m *syspropLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
baseModuleName := m.BaseModuleName()
|
baseModuleName := m.BaseModuleName()
|
||||||
|
|
||||||
@@ -463,6 +481,12 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
|
|||||||
Stem: proptools.StringPtr(m.BaseModuleName()),
|
Stem: proptools.StringPtr(m.BaseModuleName()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
syspropLibrariesLock.Lock()
|
||||||
|
defer syspropLibrariesLock.Unlock()
|
||||||
|
|
||||||
|
libraries := syspropLibraries(ctx.Config())
|
||||||
|
*libraries = append(*libraries, ctx.ModuleName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func syspropDepsMutator(ctx android.BottomUpMutatorContext) {
|
func syspropDepsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
|
Reference in New Issue
Block a user