aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorInseob Kim <inseob@google.com>2019-03-21 17:43:49 +0900
committerInseob Kim <inseob@google.com>2019-03-21 22:04:01 +0900
commit6e93ac9a3212089500dee2095d611ff870471e68 (patch)
treec9a8040f71d31639afd202b1c07b2204f5733881 /java
parent8098faad9f1c4bdead1aa0d6800c2253776b9ca3 (diff)
downloadbuild_soong-6e93ac9a3212089500dee2095d611ff870471e68.tar.gz
build_soong-6e93ac9a3212089500dee2095d611ff870471e68.tar.bz2
build_soong-6e93ac9a3212089500dee2095d611ff870471e68.zip
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
Diffstat (limited to 'java')
-rw-r--r--java/sdk_library.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 18866d57..72cce579 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -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")
}