Merge "Set previous_api correctly for java_sdk_library"
This commit is contained in:
@@ -1082,6 +1082,10 @@ func (d *Droidstubs) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
// If requested clear any properties that provide information about the latest version
|
||||
// of an API and which reference non-existent modules.
|
||||
if Bool(d.properties.Check_api.Ignore_missing_latest_api) {
|
||||
previousApi := android.SrcIsModule(String(d.properties.Previous_api))
|
||||
if previousApi != "" && !ctx.OtherModuleExists(previousApi) {
|
||||
d.properties.Previous_api = nil
|
||||
}
|
||||
ignoreMissingModules(ctx, &d.properties.Check_api.Last_released)
|
||||
|
||||
// If the new_since references a module, e.g. :module-latest-api and the module
|
||||
|
@@ -1271,6 +1271,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
||||
Merge_annotations_dirs []string
|
||||
Merge_inclusion_annotations_dirs []string
|
||||
Generate_stubs *bool
|
||||
Previous_api *string
|
||||
Check_api struct {
|
||||
Current ApiToCheck
|
||||
Last_released ApiToCheck
|
||||
@@ -1363,6 +1364,7 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
||||
if !apiScope.unstable {
|
||||
// check against the latest released API
|
||||
latestApiFilegroupName := proptools.StringPtr(module.latestApiFilegroupName(apiScope))
|
||||
props.Previous_api = latestApiFilegroupName
|
||||
props.Check_api.Last_released.Api_file = latestApiFilegroupName
|
||||
props.Check_api.Last_released.Removed_api_file = proptools.StringPtr(
|
||||
module.latestRemovedApiFilegroupName(apiScope))
|
||||
|
Reference in New Issue
Block a user