Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8959e149 authored by Anton Hansson's avatar Anton Hansson
Browse files

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
parent b6ffb625
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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)