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:
@@ -192,24 +192,6 @@ type DroidstubsProperties struct {
|
|||||||
|
|
||||||
Current ApiToCheck
|
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 {
|
Api_lint struct {
|
||||||
Enabled *bool
|
Enabled *bool
|
||||||
|
|
||||||
@@ -304,25 +286,6 @@ func apiCheckEnabled(ctx android.ModuleContext, apiToCheck ApiToCheck, apiVersio
|
|||||||
return false
|
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
|
// Used by xsd_config
|
||||||
type ApiFilePath interface {
|
type ApiFilePath interface {
|
||||||
ApiFilePath() android.Path
|
ApiFilePath() android.Path
|
||||||
@@ -1079,24 +1042,6 @@ func (d *Droidstubs) StubsSrcJar() android.Path {
|
|||||||
func (d *Droidstubs) DepsMutator(ctx android.BottomUpMutatorContext) {
|
func (d *Droidstubs) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||||
d.Javadoc.addDeps(ctx)
|
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 {
|
if len(d.properties.Merge_annotations_dirs) != 0 {
|
||||||
for _, mergeAnnotationsDir := range d.properties.Merge_annotations_dirs {
|
for _, mergeAnnotationsDir := range d.properties.Merge_annotations_dirs {
|
||||||
ctx.AddDependency(ctx.Module(), metalavaMergeAnnotationsDirTag, mergeAnnotationsDir)
|
ctx.AddDependency(ctx.Module(), metalavaMergeAnnotationsDirTag, mergeAnnotationsDir)
|
||||||
|
@@ -1273,9 +1273,8 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
|||||||
Generate_stubs *bool
|
Generate_stubs *bool
|
||||||
Previous_api *string
|
Previous_api *string
|
||||||
Check_api struct {
|
Check_api struct {
|
||||||
Current ApiToCheck
|
Current ApiToCheck
|
||||||
Last_released ApiToCheck
|
Last_released ApiToCheck
|
||||||
Ignore_missing_latest_api *bool
|
|
||||||
|
|
||||||
Api_lint struct {
|
Api_lint struct {
|
||||||
Enabled *bool
|
Enabled *bool
|
||||||
@@ -1358,9 +1357,8 @@ func (module *SdkLibrary) createStubsSourcesAndApi(mctx android.DefaultableHookC
|
|||||||
// check against the not-yet-release API
|
// check against the not-yet-release API
|
||||||
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)
|
||||||
props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(module.sdkLibraryProperties.Unsafe_ignore_missing_latest_api)
|
|
||||||
|
|
||||||
if !apiScope.unstable {
|
if !(apiScope.unstable || module.sdkLibraryProperties.Unsafe_ignore_missing_latest_api) {
|
||||||
// check against the latest released API
|
// check against the latest released API
|
||||||
latestApiFilegroupName := proptools.StringPtr(module.latestApiFilegroupName(apiScope))
|
latestApiFilegroupName := proptools.StringPtr(module.latestApiFilegroupName(apiScope))
|
||||||
props.Previous_api = latestApiFilegroupName
|
props.Previous_api = latestApiFilegroupName
|
||||||
|
Reference in New Issue
Block a user