Skip to content

Commit

Permalink
[introspection] Stop hardcoding minimum OS versions. (xamarin#10582)
Browse files Browse the repository at this point in the history
* [introspection] Stop hardcoding minimum OS versions.

* [src] Remove redundant availability attributes.
  • Loading branch information
rolfbjarne authored Feb 8, 2021
1 parent 511a32f commit 3bdd092
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/MediaToolbox/MTAudioProcessingTap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

namespace MediaToolbox
{
[iOS (6,0)][Mac (10,9)]
public class MTAudioProcessingTap : INativeObject
#if !COREBUILD
, IDisposable
Expand Down
2 changes: 1 addition & 1 deletion src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3878,7 +3878,7 @@ interface AVAssetResourceLoadingRequest {
[Export ("finishLoadingWithResponse:data:redirect:")]
[Deprecated (PlatformName.MacOSX, 10, 15, message : "Use the 'Response', 'Redirect' properties and the 'AVAssetResourceLoadingDataRequest.Responds' and 'AVAssetResourceLoadingRequest.FinishLoading' methods instead.")]
[Deprecated (PlatformName.TvOS, 9, 0, message : "Use the 'Response', 'Redirect' properties and the 'AVAssetResourceLoadingDataRequest.Responds' and 'AVAssetResourceLoadingRequest.FinishLoading' methods instead.")]
[Availability (Introduced = Platform.iOS_6_0, Deprecated = Platform.iOS_7_0, Message = "Use the 'Response', 'Redirect' properties and the 'AVAssetResourceLoadingDataRequest.Responds' and 'AVAssetResourceLoadingRequest.FinishLoading' methods instead.")]
[Availability (Deprecated = Platform.iOS_7_0, Message = "Use the 'Response', 'Redirect' properties and the 'AVAssetResourceLoadingDataRequest.Responds' and 'AVAssetResourceLoadingRequest.FinishLoading' methods instead.")]
void FinishLoading ([NullAllowed] NSUrlResponse usingResponse, [NullAllowed] NSData data, [NullAllowed] NSUrlRequest redirect);

[Export ("finishLoadingWithError:")]
Expand Down
2 changes: 1 addition & 1 deletion src/corebluetooth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ interface CBPeripheralDelegate {

[NoTV]
[NoWatch]
[Availability (Introduced = Platform.iOS_6_0, Deprecated = Platform.iOS_7_0, Obsoleted = Platform.iOS_8_4)]
[Availability (Deprecated = Platform.iOS_7_0, Obsoleted = Platform.iOS_8_4)]
[Export ("peripheralDidInvalidateServices:")]
void InvalidatedService (CBPeripheral peripheral);

Expand Down
4 changes: 0 additions & 4 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15796,7 +15796,6 @@ interface NSMeasurementFormatter : NSSecureCoding {
string ToString (NSUnit unit);
}

[Mac (10, 9)][iOS (6, 0)][Watch (2, 0)][TV (9, 0)]
[BaseType (typeof (NSObject), Name = "NSXPCConnection")]
[DisableDefaultCtor]
interface NSXpcConnection
Expand Down Expand Up @@ -15878,7 +15877,6 @@ interface NSXpcConnection

interface INSXpcListenerDelegate {}

[Mac (10, 9)][iOS (6, 0)][Watch (2, 0)][TV (9, 0)]
[BaseType (typeof (NSObject), Name = "NSXPCListener", Delegates = new string[] { "WeakDelegate" })]
[DisableDefaultCtor]
interface NSXpcListener
Expand Down Expand Up @@ -15925,7 +15923,6 @@ interface NSXpcListenerDelegate
}

[BaseType (typeof (NSObject), Name = "NSXPCInterface")]
[Mac (10, 9)][iOS (6, 0)][Watch (2, 0)][TV (9, 0)]
[DisableDefaultCtor]
interface NSXpcInterface
{
Expand All @@ -15945,7 +15942,6 @@ interface NSXpcInterface
// Methods taking xpc_type_t have been skipped.
}

[iOS (6,0), Watch (2,0), TV (9,0)]
[BaseType (typeof (NSObject), Name = "NSXPCListenerEndpoint")]
[DisableDefaultCtor]
interface NSXpcListenerEndpoint : NSSecureCoding
Expand Down
2 changes: 1 addition & 1 deletion src/generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static Type GetBaseType (Type type, Generator generator)
// of [NoiOS] or [NoMac] are applied.
//
// This needs to merge, because we might have multiple attributes in
// use, for example, the availability (iOS (6,0)) and the fact that this
// use, for example, the availability (iOS (7,0)) and the fact that this
// is not available on Mac (NoMac).
//
public static bool IsUnavailable (this ICustomAttributeProvider provider, Generator generator)
Expand Down
2 changes: 1 addition & 1 deletion src/uikit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8585,7 +8585,7 @@ interface UILabel : UIContentSizeCategoryAdjusting {

[NoTV]
[Export ("adjustsLetterSpacingToFitWidth")]
[Availability (Introduced = Platform.iOS_6_0, Deprecated = Platform.iOS_7_0, Message = "Use 'NSKernAttributeName' instead.")]
[Availability (Deprecated = Platform.iOS_7_0, Message = "Use 'NSKernAttributeName' instead.")]
bool AdjustsLetterSpacingToFitWidth { get; set; }

[Export ("minimumScaleFactor")]
Expand Down
10 changes: 4 additions & 6 deletions tests/introspection/ApiAvailabilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,16 @@ public ApiAvailabilityTest ()
Maximum = Version.Parse (Constants.SdkVersion);
#if __IOS__
Platform = PlatformName.iOS;
Minimum = new Version (6,0);
Minimum = Xamarin.SdkVersions.MiniOSVersion;
#elif __TVOS__
Platform = PlatformName.TvOS;
Minimum = new Version (9,0);
Minimum = Xamarin.SdkVersions.MinTVOSVersion;
#elif __WATCHOS__
Platform = PlatformName.WatchOS;
Minimum = new Version (2,0);
// Need to special case watchOS 'Maximum' version for OS minor subversions (can't change Constants.SdkVersion)
//Maximum = new Version (6,2,5);
Minimum = Xamarin.SdkVersions.MinWatchOSVersion;
#else
Platform = PlatformName.MacOSX;
Minimum = new Version (10,9);
Minimum = Xamarin.SdkVersions.MinOSXVersion;
// Need to special case macOS 'Maximum' version for OS minor subversions (can't change Constants.SdkVersion)
// Please comment the code below if needed
Maximum = new Version (11,1,0);
Expand Down
3 changes: 3 additions & 0 deletions tests/introspection/Mac/introspection-mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
<Compile Include="..\..\..\tools\common\Frameworks.cs">
<Link>Frameworks.cs</Link>
</Compile>
<Compile Include="..\..\..\tools\common\SdkVersions.cs">
<Link>SdkVersions.cs</Link>
</Compile>
<Compile Include="..\ApiFrameworkTest.cs">
<Link>ApiFrameworkTest.cs</Link>
</Compile>
Expand Down
3 changes: 3 additions & 0 deletions tests/introspection/dotnet/iOS/introspection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
<Compile Include="..\..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\..\..\..\tools\common\SdkVersions.cs">
<Link>SdkVersions.cs</Link>
</Compile>
<Compile Include="..\..\ApiFrameworkTest.cs">
<Link>ApiFrameworkTest.cs</Link>
</Compile>
Expand Down
3 changes: 3 additions & 0 deletions tests/introspection/dotnet/tvOS/introspection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
<Compile Include="..\..\..\..\tools\common\ApplePlatform.cs">
<Link>ApplePlatform.cs</Link>
</Compile>
<Compile Include="..\..\..\..\tools\common\SdkVersions.cs">
<Link>SdkVersions.cs</Link>
</Compile>
<Compile Include="..\..\ApiFrameworkTest.cs">
<Link>ApiFrameworkTest.cs</Link>
</Compile>
Expand Down
3 changes: 3 additions & 0 deletions tests/introspection/iOS/introspection-ios.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
<Compile Include="..\..\..\tools\common\Frameworks.cs">
<Link>Frameworks.cs</Link>
</Compile>
<Compile Include="..\..\..\tools\common\SdkVersions.cs">
<Link>SdkVersions.cs</Link>
</Compile>
<Compile Include="..\ApiFrameworkTest.cs">
<Link>ApiFrameworkTest.cs</Link>
</Compile>
Expand Down

0 comments on commit 3bdd092

Please sign in to comment.