Fix checking of empty slice properties
Properties can be empty (not nil), and in that case some weird error
messages will happen to be emitted.
Bug: N/A
Test: try to build with api_pacakges: [] and srcs: []
Change-Id: I492077616e742072696265796520737465616b21
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 18866d5..72cce57 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -668,11 +668,11 @@
}
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")
}