Ignore missing prebuilt_apis of java_sdk_library

Building java_sdk_library without defining prebuilt_apis has been
failing with weird error messages. So one have to touch empty txt files
and create prebuilt_apis module, even when the java_sdk_library is
brand-new and has no previous versions. This commit fixes it so that API
check against previous version is skipped, in the case of missing
prebuilt_apis.

Note that Current api txt files (placed under api/ directory) are still
needed (make update-api)

Bug: 126259114
Test: tries to build without touching empty api txt files.
Change-Id: I93630f4139cbf502621693ec315dc06c0d07d1c3
This commit is contained in:
Inseob Kim
2019-02-28 14:24:05 +09:00
parent afbddd8ddd
commit 38449af64f
2 changed files with 39 additions and 2 deletions

View File

@@ -454,8 +454,9 @@ func (module *SdkLibrary) createDocs(mctx android.TopDownMutatorContext, apiScop
Merge_annotations_dirs []string
Merge_inclusion_annotations_dirs []string
Check_api struct {
Current ApiToCheck
Last_released ApiToCheck
Current ApiToCheck
Last_released ApiToCheck
Ignore_missing_latest_api *bool
}
Aidl struct {
Include_dirs []string
@@ -524,6 +525,7 @@ func (module *SdkLibrary) createDocs(mctx android.TopDownMutatorContext, apiScop
module.latestApiFilegroupName(apiScope))
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
module.latestRemovedApiFilegroupName(apiScope))
props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true)
props.Srcs_lib = module.sdkLibraryProperties.Srcs_lib
props.Srcs_lib_whitelist_dirs = module.sdkLibraryProperties.Srcs_lib_whitelist_dirs
props.Srcs_lib_whitelist_pkgs = module.sdkLibraryProperties.Srcs_lib_whitelist_pkgs