diff options
author | Inseob Kim <inseob@google.com> | 2019-03-21 17:43:49 +0900 |
---|---|---|
committer | Inseob Kim <inseob@google.com> | 2019-03-21 22:04:01 +0900 |
commit | 6e93ac9a3212089500dee2095d611ff870471e68 (patch) | |
tree | c9a8040f71d31639afd202b1c07b2204f5733881 /sysprop | |
parent | 8098faad9f1c4bdead1aa0d6800c2253776b9ca3 (diff) | |
download | build_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 'sysprop')
-rw-r--r-- | sysprop/sysprop_library.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go index 6e8e306b..48078d84 100644 --- a/sysprop/sysprop_library.go +++ b/sysprop/sysprop_library.go @@ -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") } |