Merge "Remove unnecessary handling of nil paths in HiddenAPIOutput" am: 38788dce43

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1772630

Change-Id: I1344ff9c9804e9c6221348171a6bf44ce679ccde
This commit is contained in:
Paul Duffin
2021-07-21 11:20:44 +00:00
committed by Automerger Merge Worker

View File

@@ -83,22 +83,11 @@ func newMonolithicHiddenAPIInfo(ctx android.ModuleContext, flagFilesByCategory F
// append appends all the files from the supplied info to the corresponding files in this struct. // append appends all the files from the supplied info to the corresponding files in this struct.
func (i *MonolithicHiddenAPIInfo) append(other *HiddenAPIInfo) { func (i *MonolithicHiddenAPIInfo) append(other *HiddenAPIInfo) {
i.FlagsFilesByCategory.append(other.FlagFilesByCategory) i.FlagsFilesByCategory.append(other.FlagFilesByCategory)
i.StubFlagsPaths = append(i.StubFlagsPaths, other.StubFlagsPath)
// The output may not be set if the bootclasspath_fragment has not yet been updated to support i.AnnotationFlagsPaths = append(i.AnnotationFlagsPaths, other.AnnotationFlagsPath)
// hidden API processing. i.MetadataPaths = append(i.MetadataPaths, other.MetadataPath)
// TODO(b/179354495): Switch back to append once all bootclasspath_fragment modules have been i.IndexPaths = append(i.IndexPaths, other.IndexPath)
// updated to support hidden API processing properly. i.AllFlagsPaths = append(i.AllFlagsPaths, other.AllFlagsPath)
appendIfNotNil := func(paths android.Paths, path android.Path) android.Paths {
if path == nil {
return paths
}
return append(paths, path)
}
i.StubFlagsPaths = appendIfNotNil(i.StubFlagsPaths, other.StubFlagsPath)
i.AnnotationFlagsPaths = appendIfNotNil(i.AnnotationFlagsPaths, other.AnnotationFlagsPath)
i.MetadataPaths = appendIfNotNil(i.MetadataPaths, other.MetadataPath)
i.IndexPaths = appendIfNotNil(i.IndexPaths, other.IndexPath)
i.AllFlagsPaths = appendIfNotNil(i.AllFlagsPaths, other.AllFlagsPath)
} }
// dedup removes duplicates in all the paths, while maintaining the order in which they were // dedup removes duplicates in all the paths, while maintaining the order in which they were