Skip to content

Commit

Permalink
[xtro] Don't treat APIs that are deprecated far in the future as actu…
Browse files Browse the repository at this point in the history
…ally deprecated. (#21822)

This fixes a few unnecessary ignores we have.
  • Loading branch information
rolfbjarne authored Dec 19, 2024
1 parent aa3ac14 commit 8528c90
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -494,16 +494,6 @@
!missing-type! AVVideoOutputSpecification not bound
!missing-type! AVVideoPerformanceMetrics not bound
!missing-type! AVZoomRange not bound
!deprecated-attribute-missing! AVAggregateAssetDownloadTask missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:didCompleteForMediaSelection: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:forMediaSelection: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:willDownloadToURL: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:assetDownloadTask:didFinishDownloadingToURL: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:assetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadTask::loadedTimeRanges missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadTask::options missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadURLSession::aggregateAssetDownloadTaskWithURLAsset:mediaSelections:assetTitle:assetArtworkData:options: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadURLSession::assetDownloadTaskWithURLAsset:assetTitle:assetArtworkData:options: missing a [Deprecated] attribute
!missing-enum! AVCaptionAnimation not bound
!missing-enum! AVCaptionConversionValidatorStatus not bound
!missing-enum! AVCaptionDecoration not bound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
!deprecated-attribute-missing! MLCPoolingLayer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCReductionLayer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCReshapeLayer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCRMSPropOptimizer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCScatterLayer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCSelectionLayer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCSGDOptimizer missing a [Deprecated] attribute
Expand Down
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/api-annotations-dotnet/common-MapKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,5 @@
!missing-field! MKMapRectWorld not bound
!missing-field! MKMapSizeWorld not bound

## soft deprecation
!deprecated-attribute-missing! MKMapView::mapType missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::setMapType: missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::pointOfInterestFilter missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::setPointOfInterestFilter: missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::showsBuildings missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::setShowsBuildings: missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::showsTraffic missing a [Deprecated] attribute
!deprecated-attribute-missing! MKMapView::setShowsTraffic: missing a [Deprecated] attribute

## The MKOverlay protocol implements the MKAnnotation protocol, which has a required 'coordinate' property, so the API is there.
!missing-protocol-member! MKOverlay::coordinate not found
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-AVFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,6 @@
!missing-type! AVPlayerVideoOutputConfiguration not bound
!missing-type! AVVideoOutputSpecification not bound
!missing-type! AVZoomRange not bound
!deprecated-attribute-missing! AVAggregateAssetDownloadTask missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:didCompleteForMediaSelection: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:forMediaSelection: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:willDownloadToURL: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:assetDownloadTask:didFinishDownloadingToURL: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:assetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadTask::loadedTimeRanges missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadTask::options missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadURLSession::aggregateAssetDownloadTaskWithURLAsset:mediaSelections:assetTitle:assetArtworkData:options: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadURLSession::assetDownloadTaskWithURLAsset:assetTitle:assetArtworkData:options: missing a [Deprecated] attribute
!missing-enum! AVCaptionAnimation not bound
!missing-enum! AVCaptionConversionValidatorStatus not bound
!missing-enum! AVCaptionDecoration not bound
Expand Down
10 changes: 0 additions & 10 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-AVFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,6 @@
!deprecated-attribute-missing! AVAudioEngine::connectMIDI:toNodes:format:block: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVCaptureConnection::isVideoOrientationSupported missing a [Deprecated] attribute
!deprecated-attribute-missing! AVSampleBufferGenerator::createSampleBufferForRequest: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAggregateAssetDownloadTask missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:didCompleteForMediaSelection: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad:forMediaSelection: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:aggregateAssetDownloadTask:willDownloadToURL: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:assetDownloadTask:didFinishDownloadingToURL: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadDelegate::URLSession:assetDownloadTask:didLoadTimeRange:totalTimeRangesLoaded:timeRangeExpectedToLoad: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadTask::loadedTimeRanges missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadTask::options missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadURLSession::aggregateAssetDownloadTaskWithURLAsset:mediaSelections:assetTitle:assetArtworkData:options: missing a [Deprecated] attribute
!deprecated-attribute-missing! AVAssetDownloadURLSession::assetDownloadTaskWithURLAsset:assetTitle:assetArtworkData:options: missing a [Deprecated] attribute
!missing-enum! AVCaptureMultichannelAudioMode not bound
!missing-enum! AVExternalContentProtectionStatus not bound
!missing-enum! AVPlayerInterstitialEventTimelineOccupancy not bound
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
!deprecated-attribute-missing! MLCRMSPropOptimizer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCActivationDescriptor missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCActivationLayer missing a [Deprecated] attribute
!deprecated-attribute-missing! MLCAdamOptimizer missing a [Deprecated] attribute
Expand Down
10 changes: 5 additions & 5 deletions tests/xtro-sharpie/xtro-sharpie/DeprecatedCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ public void ProcessItem (ICustomAttributeProvider item, string itemName, Version
if (AttributeHelpers.HasAnyAdvice (item))
return;

if (!AttributeHelpers.HasAnyDeprecationForCurrentPlatform (item)) {
Log.On (framework).Add ($"!deprecated-attribute-missing! {itemName} missing a [Deprecated] attribute");
return;
}

// Don't version check us when Apple does __attribute__((availability(macos, introduced=10.0, deprecated=100000)));
// #define __API_TO_BE_DEPRECATED 100000
if (objcVersion.Major == 100000)
return;

if (!AttributeHelpers.HasAnyDeprecationForCurrentPlatform (item)) {
Log.On (framework).Add ($"!deprecated-attribute-missing! {itemName} missing a [Deprecated] attribute");
return;
}

// Some APIs have both a [Deprecated] and [Obsoleted]. Bias towards [Obsoleted].
Version managedVersion;
bool foundObsoleted = AttributeHelpers.FindObsolete (item, out managedVersion);
Expand Down

10 comments on commit 8528c90

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.