Allow sysprop library API files to be missing
If sysprop library contains only internal properties, the API txt file will be empty. This allows the API files to be missing in such cases to turn off API-Review bit. Bug: 177036449 Test: manual test Change-Id: I9792e46ce6d19e65ee83cb055f76069063bec281
This commit is contained in:
parent
150355b1c3
commit
3a3539a27b
1 changed files with 4 additions and 2 deletions
|
@ -382,11 +382,13 @@ func (m *selinuxContextsModule) buildPropertyContexts(ctx android.ModuleContext,
|
||||||
|
|
||||||
var apiFiles android.Paths
|
var apiFiles android.Paths
|
||||||
ctx.VisitDirectDepsWithTag(syspropLibraryDepTag, func(c android.Module) {
|
ctx.VisitDirectDepsWithTag(syspropLibraryDepTag, func(c android.Module) {
|
||||||
i, ok := c.(interface{ CurrentSyspropApiFile() android.Path })
|
i, ok := c.(interface{ CurrentSyspropApiFile() android.OptionalPath })
|
||||||
if !ok {
|
if !ok {
|
||||||
panic(fmt.Errorf("unknown dependency %q for %q", ctx.OtherModuleName(c), ctx.ModuleName()))
|
panic(fmt.Errorf("unknown dependency %q for %q", ctx.OtherModuleName(c), ctx.ModuleName()))
|
||||||
}
|
}
|
||||||
apiFiles = append(apiFiles, i.CurrentSyspropApiFile())
|
if api := i.CurrentSyspropApiFile(); api.Valid() {
|
||||||
|
apiFiles = append(apiFiles, api.Path())
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// check compatibility with sysprop_library
|
// check compatibility with sysprop_library
|
||||||
|
|
Loading…
Reference in a new issue