Merge "Fix checking of empty slice properties"

am: 6b200500cc

Change-Id: Iee776c587b66a28e007545e47c35703dc5efdc7a
This commit is contained in:
Inseob Kim 2019-03-21 18:36:09 -07:00 committed by android-build-merger
commit 2aad89a882
2 changed files with 7 additions and 3 deletions

View File

@ -668,11 +668,11 @@ func SdkLibraryMutator(mctx android.TopDownMutatorContext) {
}
func (module *SdkLibrary) createInternalModules(mctx android.TopDownMutatorContext) {
if module.Library.Module.properties.Srcs == nil {
if len(module.Library.Module.properties.Srcs) == 0 {
mctx.PropertyErrorf("srcs", "java_sdk_library must specify srcs")
}
if module.sdkLibraryProperties.Api_packages == nil {
if len(module.sdkLibraryProperties.Api_packages) == 0 {
mctx.PropertyErrorf("api_packages", "java_sdk_library must specify api_packages")
}

View File

@ -82,7 +82,11 @@ func syspropLibraryFactory() android.Module {
}
func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
if m.syspropLibraryProperties.Api_packages == nil {
if len(m.commonProperties.Srcs) == 0 {
ctx.PropertyErrorf("srcs", "sysprop_library must specify srcs")
}
if len(m.syspropLibraryProperties.Api_packages) == 0 {
ctx.PropertyErrorf("api_packages", "sysprop_library must specify api_packages")
}