Add some friendly error messages for java_sdk_library. am: 8959e149b7

am: fc3f21e609

Change-Id: I43e16f42be1e13eff69035cd3862dacce7f95b43
This commit is contained in:
Anton Hansson 2018-05-01 00:04:23 -07:00 committed by android-build-merger
commit 212f52008e

View file

@ -485,6 +485,13 @@ func javaSdkLibraries(config android.Config) *[]string {
// once for public API level and once for system API level // once for public API level and once for system API level
func sdkLibraryMutator(mctx android.TopDownMutatorContext) { func sdkLibraryMutator(mctx android.TopDownMutatorContext) {
if module, ok := mctx.Module().(*sdkLibrary); ok { 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 // for public API stubs
module.createStubsLibrary(mctx, apiScopePublic) module.createStubsLibrary(mctx, apiScopePublic)
module.createDocs(mctx, apiScopePublic) module.createDocs(mctx, apiScopePublic)