aboutsummaryrefslogtreecommitdiffstats
path: root/java/sdk_library.go
diff options
context:
space:
mode:
authorAnton Hansson <hansson@google.com>2018-04-25 11:56:13 +0100
committerAnton Hansson <hansson@google.com>2018-05-01 07:49:03 +0100
commit8959e149b713f6c7332f9eda80fe5dc47c9d0718 (patch)
tree00bc0b0e1a6da26683b498946562c2aa0e1bce34 /java/sdk_library.go
parentb6ffb625ebb461cf465905663b3024fb985782d1 (diff)
downloadandroid_build_soong-8959e149b713f6c7332f9eda80fe5dc47c9d0718.tar.gz
android_build_soong-8959e149b713f6c7332f9eda80fe5dc47c9d0718.tar.bz2
android_build_soong-8959e149b713f6c7332f9eda80fe5dc47c9d0718.zip
Add some friendly error messages for java_sdk_library.
The stubs will always fail to build without at least these three arguments. Give a clear error message when this happens instead of failing further into the build. Bug: 77575606 Test: make <x>.stubs for sdk_library "x" without these args Change-Id: If3142ecc73d6428f7e3120788f8de64d56a777ad
Diffstat (limited to 'java/sdk_library.go')
-rw-r--r--java/sdk_library.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 45a6a093..52e713fa 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -485,6 +485,13 @@ func javaSdkLibraries(config android.Config) *[]string {
// once for public API level and once for system API level
func sdkLibraryMutator(mctx android.TopDownMutatorContext) {
if module, ok := mctx.Module().(*sdkLibrary); ok {
+ if module.properties.Srcs == nil {
+ mctx.PropertyErrorf("srcs", "java_sdk_library must specify srcs")
+ }
+ if module.properties.Api_packages == nil {
+ mctx.PropertyErrorf("api_packages", "java_sdk_library must specify api_packages")
+ }
+
// for public API stubs
module.createStubsLibrary(mctx, apiScopePublic)
module.createDocs(mctx, apiScopePublic)