Remove Ignore_missing_latest_api

This flag was only used by sdk_library.go, and is no longer needed
since sdk_library.go now knows which libraries are missing latest_api
tracking files.

Bug: 176092454
Test: m
Change-Id: I5a967f784bde99f103b85654c794e8d7110fd0db
This commit is contained in:
Anton Hansson
2020-12-31 10:37:27 +00:00
parent 591920fcfa
commit e6056153cf
2 changed files with 3 additions and 60 deletions

View File

@@ -192,24 +192,6 @@ type DroidstubsProperties struct {
Current ApiToCheck
// The java_sdk_library module generates references to modules (i.e. filegroups)
// from which information about the latest API version can be obtained. As those
// modules may not exist (e.g. because a previous version has not been released) it
// sets ignore_missing_latest_api=true on the droidstubs modules it creates so
// that droidstubs can ignore those references if the modules do not yet exist.
//
// If true then this will ignore module references for modules that do not exist
// in properties that supply the previous version of the API.
//
// There are two sets of those:
// * Api_file, Removed_api_file in check_api.last_released
// * New_since in check_api.api_lint.new_since
//
// The first two must be set as a pair, so either they should both exist or neither
// should exist - in which case when this property is true they are ignored. If one
// exists and the other does not then it is an error.
Ignore_missing_latest_api *bool `blueprint:"mutated"`
Api_lint struct {
Enabled *bool
@@ -304,25 +286,6 @@ func apiCheckEnabled(ctx android.ModuleContext, apiToCheck ApiToCheck, apiVersio
return false
}
func ignoreMissingModules(ctx android.BottomUpMutatorContext, apiToCheck *ApiToCheck) {
apiFile := String(apiToCheck.Api_file)
removedApiFile := String(apiToCheck.Removed_api_file)
apiModule := android.SrcIsModule(apiFile)
removedApiModule := android.SrcIsModule(removedApiFile)
if apiModule == "" || removedApiModule == "" {
return
}
if ctx.OtherModuleExists(apiModule) || ctx.OtherModuleExists(removedApiModule) {
return
}
apiToCheck.Api_file = nil
apiToCheck.Removed_api_file = nil
}
// Used by xsd_config
type ApiFilePath interface {
ApiFilePath() android.Path
@@ -1079,24 +1042,6 @@ func (d *Droidstubs) StubsSrcJar() android.Path {
func (d *Droidstubs) DepsMutator(ctx android.BottomUpMutatorContext) {
d.Javadoc.addDeps(ctx)
// 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
// does not exist then clear it.
newSinceSrc := d.properties.Check_api.Api_lint.New_since
newSinceSrcModule := android.SrcIsModule(proptools.String(newSinceSrc))
if newSinceSrcModule != "" && !ctx.OtherModuleExists(newSinceSrcModule) {
d.properties.Check_api.Api_lint.New_since = nil
}
}
if len(d.properties.Merge_annotations_dirs) != 0 {
for _, mergeAnnotationsDir := range d.properties.Merge_annotations_dirs {
ctx.AddDependency(ctx.Module(), metalavaMergeAnnotationsDirTag, mergeAnnotationsDir)