From 7a586d3a59f7745313e567acd562e31bafd70269 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Mon, 30 Dec 2019 17:09:34 +0000 Subject: [PATCH] java_sdk_library: Remove requirement for api_packages to be specified If api_packages is not set then will try and generate stubs from all the source packages. Bug: 145998881 Test: m checkbuild Change-Id: Ic9d7f82bb34c4b960a2f17614d7f64ddd13ad8b0 --- java/sdk_library.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/java/sdk_library.go b/java/sdk_library.go index d69339bdd..3fc18036f 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -97,7 +97,10 @@ type sdkLibraryProperties struct { // List of Java libraries that will be in the classpath when building stubs Stub_only_libs []string `android:"arch_variant"` - // list of package names that will be documented and publicized as API + // list of package names that will be documented and publicized as API. + // This allows the API to be restricted to a subset of the source files provided. + // If this is unspecified then all the source files will be treated as being part + // of the API. Api_packages []string // list of package names that must be hidden from the API @@ -707,11 +710,6 @@ func (module *SdkLibrary) CreateInternalModules(mctx android.LoadHookContext) { return } - if len(module.sdkLibraryProperties.Api_packages) == 0 { - mctx.PropertyErrorf("api_packages", "java_sdk_library must specify api_packages") - return - } - // If this builds against standard libraries (i.e. is not part of the core libraries) // then assume it provides both system and test apis. Otherwise, assume it does not and // also assume it does not contribute to the dist build.