Disable "check last" for test api
@TestApi does not have stability requirements, so we shouldn't be checking its compatibility with the last released version. This CL removes the expectation that a test-removed.txt is checked in for each module during finalization. Bug: 155197156 Test: m (with SDK 30 imported) Change-Id: Ib3f671493f1d230116bec51b884e8072643b10d4 Merged-In: Ib3f671493f1d230116bec51b884e8072643b10d4 (cherry picked from commit 6bf8e415a50826a378cc58aba87854f52c9f1d32)
This commit is contained in:
@@ -90,6 +90,9 @@ type apiScope struct {
|
|||||||
|
|
||||||
// Extra arguments to pass to droidstubs for this scope.
|
// Extra arguments to pass to droidstubs for this scope.
|
||||||
droidstubsArgs []string
|
droidstubsArgs []string
|
||||||
|
|
||||||
|
// Whether the api scope can be treated as unstable, and should skip compat checks.
|
||||||
|
unstable bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize a scope, creating and adding appropriate dependency tags
|
// Initialize a scope, creating and adding appropriate dependency tags
|
||||||
@@ -142,6 +145,7 @@ var (
|
|||||||
moduleSuffix: sdkTestApiSuffix,
|
moduleSuffix: sdkTestApiSuffix,
|
||||||
sdkVersion: "test_current",
|
sdkVersion: "test_current",
|
||||||
droidstubsArgs: []string{"-showAnnotation android.annotation.TestApi"},
|
droidstubsArgs: []string{"-showAnnotation android.annotation.TestApi"},
|
||||||
|
unstable: true,
|
||||||
})
|
})
|
||||||
allApiScopes = apiScopes{
|
allApiScopes = apiScopes{
|
||||||
apiScopePublic,
|
apiScopePublic,
|
||||||
@@ -560,12 +564,14 @@ func (module *SdkLibrary) createStubsSources(mctx android.LoadHookContext, apiSc
|
|||||||
props.Check_api.Current.Api_file = proptools.StringPtr(currentApiFileName)
|
props.Check_api.Current.Api_file = proptools.StringPtr(currentApiFileName)
|
||||||
props.Check_api.Current.Removed_api_file = proptools.StringPtr(removedApiFileName)
|
props.Check_api.Current.Removed_api_file = proptools.StringPtr(removedApiFileName)
|
||||||
|
|
||||||
// check against the latest released API
|
if !apiScope.unstable {
|
||||||
props.Check_api.Last_released.Api_file = proptools.StringPtr(
|
// check against the latest released API
|
||||||
module.latestApiFilegroupName(apiScope))
|
props.Check_api.Last_released.Api_file = proptools.StringPtr(
|
||||||
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
|
module.latestApiFilegroupName(apiScope))
|
||||||
module.latestRemovedApiFilegroupName(apiScope))
|
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
|
||||||
props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true)
|
module.latestRemovedApiFilegroupName(apiScope))
|
||||||
|
props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true)
|
||||||
|
}
|
||||||
|
|
||||||
// Dist the api txt artifact for sdk builds.
|
// Dist the api txt artifact for sdk builds.
|
||||||
if !Bool(module.sdkLibraryProperties.No_dist) {
|
if !Bool(module.sdkLibraryProperties.No_dist) {
|
||||||
|
Reference in New Issue
Block a user