Add attribute to disable last-api compat tracking

Setting this to true by default is dangerous as it can mask bugs. Create
a dedicated attribute for java_sdk_library to enable this behavior
instead. The default will be flipped in a future CL when all the current
offenders have been fixed.

Fix all the tests to have the right API files.

Bug: 176092454
Test: m nothing
Change-Id: Ieab94bcb74abf8d018365a56fb447fe3dbd46957
This commit is contained in:
Anton Hansson
2020-12-21 17:10:01 +00:00
parent 69c43e40ad
commit dff2c78a20
6 changed files with 77 additions and 61 deletions

View File

@@ -453,6 +453,10 @@ type sdkLibraryProperties struct {
// * Removed API specification filegroup -> <dist-stem>-removed.api.<scope>.latest
Dist_stem *string
// A compatibility mode that allows historical API-tracking files to not exist.
// Do not use.
Unsafe_ignore_missing_latest_api bool
// indicates whether system and test apis should be generated.
Generate_system_and_test_apis bool `blueprint:"mutated"`
@@ -1352,6 +1356,8 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
// check against the not-yet-release API
props.Check_api.Current.Api_file = proptools.StringPtr(currentApiFileName)
props.Check_api.Current.Removed_api_file = proptools.StringPtr(removedApiFileName)
// TODO(b/176092454): change true to module.sdkLibraryProperties.Unsafe_ignore_missing_latest_api
props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true)
if !apiScope.unstable {
// check against the latest released API
@@ -1359,7 +1365,6 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
props.Check_api.Last_released.Api_file = latestApiFilegroupName
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
module.latestRemovedApiFilegroupName(apiScope))
props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true)
if proptools.Bool(module.sdkLibraryProperties.Api_lint.Enabled) {
// Enable api lint.