Граф коммитов

44 Коммитов

Автор SHA1 Сообщение Дата
Chris Hamons cf77b790cb
[NET Attribute Conversion] Add missing attributes in code-behind by re-running conversion (#14660)
* [NET Attribute Conversion] Chip Framework
* [NET Attribute Conversion] Rerun with many fixes
* Fix generator crash when compiling attributes with no introduced version
* Test changes for availability re-run. One new test
2022-04-07 10:46:15 -05:00
Chris Hamons 71b78284b5
[CoreBluetooth] Remove unnecessary conditional defines from corebluetooth.cs (#14461)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-31 12:48:23 -04:00
TJ Lambert d8d90572ce
[corebluetooth] Add nullability to (generated and manual) bindings (#14348)
* use is null and is not null

* use better null check

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-03-10 06:48:02 -06:00
Rolf Bjarne Kvinge 9e5113a7b9
[src] Add a global namespace using for a couple of namespaces. (#14356)
Also remove all the 'using System.Runtime.Versioning;' statements everywhere.
2022-03-10 08:07:54 +01:00
Rolf Bjarne Kvinge e3424ae344
[CoreBluetooth] Remove fields already bound better elsewhere in .NET. (#14231) 2022-02-24 22:55:25 +01:00
Chris Hamons c52937ca57
[NET 6 Attribute Conversion] CoreBluetooth (#13814) 2022-01-25 11:25:35 -06:00
Rolf Bjarne Kvinge e088ceecff
[CoreBluetooth] Use new availability attributes and remove API that isn't in Apple's headers from .NET. (#13293)
* Change all XAMCORE_4_0 defines to NET defines to get the new API version in
  .NET.
* Remove some dead code.
* Change all the old-style [Availability] attributes to new-style [Obsoleted]
  or [Deprecated].
* Adjust tests.
2021-11-08 21:32:18 +01:00
Rolf Bjarne Kvinge 696e7a5679
[ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere. (#13231)
* [ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere.

The PlatformHelper class is deprecated, so implement a new version that isn't
deprecated, and which shares a similar API between all platforms - the Check*
methods includes the name of the platform, because that makes it clearer which
version we're talking about from the call site. There's a quirk though:
there's no separate ChecktvOS or CheckMacCatalyst, because the system version
is the same as for iOS, so we can just use 'iOS'.

For macOS we can now use NSProcessInfo.ProcessInfo.OperatingSystemVersion to
determine the OS version, because it's supported in all versions of macOS we
support for .NET.

Fixes issues such as this when building with XAMCORE_4_0:

> CoreMedia/CMSync.cs(590,11): error CS0103: The name 'PlatformHelper' does not exist in the current context

* Bring back PlatformHelper.CheckSystemVersion, but only for !NET.

* [tests] Remove 32-bit macOS logic, it's long dead.

* [introspection] Implement OS version check using 'NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion' for macOS.

* [monotouch-test] Use TestRuntime.[Check|Assert]XcodeVersion instead of PlatformHelper.CheckSystemVersion.
2021-11-04 11:13:23 +01:00
TJ Lambert 29b0bbc0d2
[CoreBluetooth] Add Support for DotNet Attributes
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2021-09-09 12:17:41 -04:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Sebastien Pouliot aa73c33db9
[corebluetooth] Add nullability to (generated and manual) bindings (#10241)
See [HOWTO](https://github.com/xamarin/xamarin-macios/wiki/Nullability)
2020-12-09 09:10:55 -05:00
Manuel de la Pena 0f7bc75e50 Merge branch 'xcode12.2' into main-xcode12.2 2020-11-17 11:09:15 -05:00
Sebastien Pouliot d89cba1d9d
[corebluetooth] Update for Xcode 12.2 beta 3 (#9900) 2020-10-16 15:54:51 -04:00
monojenkins 3b36acecba
[tests][cecil] Check that error-based enum values don't have availability attributes (#9780)
and fixes the ones that have some.

From https://github.com/xamarin/xamarin-macios/issues/9724

We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.

```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
   Console.WriteLine ($"API failed: {err});
   break;
case NSError.Ok:
   break;
default:
   Console.WriteLine ($"Unknown error code {err}");
   break;
}
```

Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;

As such we default to not add them - but we some time forgot about it. An intro rule could easily ensure we don't add them needlessly.
2020-10-05 10:37:54 -04:00
Sebastien Pouliot 1e5801c930 [tests][intro] Split attributes typos from API typos tests (#9652)
The latter requires the spellchecker which varies by OS versions, so we
only run it on the latest OS version (and simulator, except macOS).

The former are some internal rules and can be run on every commit and
avoid finding issues late in a release cycle.

Also changed to
- process members even if a type is obsoleted
- process the properties and events on types

About the strings...

Some were fine, others were not. Copy/pasted strings are hard to
maintain. Moving them to constants will help, both maintainability and
will reduce the metadata size of the platform assemblies.

ref: https://github.com/xamarin/xamarin-macios/issues/9353
2020-10-01 22:37:54 -04:00
Sebastien Pouliot e343e68725
[tests][cecil] Check that error-based enum values don't have availability attributes (#9737)
and fixes the ones that have some.

From https://github.com/xamarin/xamarin-macios/issues/9724

We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.

```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
   Console.WriteLine ($"API failed: {err});
   break;
case NSError.Ok:
   break;
default:
   Console.WriteLine ($"Unknown error code {err}");
   break;
}
```

Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;

As such we default to not add them - but we some time forgot about it.
2020-09-30 15:15:18 -04:00
Sebastien Pouliot 3e14650b6e
[tests][intro] Split attributes typos from API typos tests (#9652)
The latter requires the spellchecker which varies by OS versions, so we
only run it on the latest OS version (and simulator, except macOS).

The former are some internal rules and can be run on every commit and
avoid finding issues late in a release cycle.

Also changed to
- process members even if a type is obsoleted
- process the properties and events on types

About the strings...

Some were fine, others were not. Copy/pasted strings are hard to
maintain. Moving them to constants will help, both maintainability and
will reduce the metadata size of the platform assemblies.

ref: https://github.com/xamarin/xamarin-macios/issues/9353
2020-09-30 07:53:48 -04:00
Manuel de la Pena a19b0f2c75
[Submission] Fix all the selectors that apple warns about. (#9268) (#9408)
* [Submission] Fix all the selectors that apple warns about. (#9268)

We have noticed the following message from Apple when performing
submissions with Xamarin.iOS:

> ITMS-90338: Non-public API usage - The app references non-public
> selectors in WcBc.iOS: behaviorTypes, convolutionState,
> discoverAllContactUserInfosWithCompletionHandler:,
> discoverAllContactsCompletionBlock,
> discoverUserInfoWithEmailAddress:completionHandler:,
> discoverUserInfoWithUserRecordID:completionHandler:,
> discoverUserInfosCompletionBlock, displayContact, drawableResizesAsynchronously,
> encodeToCommandBuffer:sourceImage:convolutionState:,
> encodeToCommandBuffer:sourceImage:destinationImage:state:,
> getProperty:onChannel:responseHandler:, hasProperty:onChannel:responseHandler:,
> initWithEmailAddresses:userRecordIDs:, initWithMIDIEntity:dataReadyHandler:,
> initWithZoneID:options:, initWithZoneID:subscriptionID:options:,
> isPublicDatabase, mouseUpAction, newDrawable, propertyChangedCallback,
> removeAllAppearanceStreams, replaceTextStorage:, retrieveConnectedPeripherals,
> retrievePeripherals:, setDiscoverAllContactsCompletionBlock:,
> setDiscoverUserInfosCompletionBlock:, setDrawableResizesAsynchronously:,
> setEditedMask:, setMouseUpAction:, setMovieControlMode:,
> setProperty:onChannel:responseHandler:, setPropertyChangedCallback:,
> setSocketFamily:, setTemporaryAttributes:forCharacterRange:, setUserRecordIDs:,
> sourceOffset, subscriptionOptions, takeBackgroundColorFrom:, takePasswordFrom:,
> temporalAntialiasingEnabled, userRecordIDs. If method names in your source code
> match the private Apple APIs listed above, altering your method names will help
> prevent this app from being flagged in future submissions. In addition, note
> that one or more of the above APIs may be located in a static library that was
> included with your app. If so, they must be removed. For further information,
> visit the Technical Support Information at http://developer.apple.com/support/technical/

All of them have been removed but without a break in the API excep
"initWithMIDIEntity:dataReadyHandler:" wich does look like an error on
Apples side.

Empty stubs are used as much as possible except on those cases in which
a handler is called or an output variable should be modified (buffer,
out param) to minimize the users surprise at runtime.
2020-08-21 16:30:51 -04:00
Manuel de la Pena 7e7caa00a6
[Submission] Fix all the selectors that apple warns about. (#9268)
We have noticed the following message from Apple when performing
submissions with Xamarin.iOS:

> ITMS-90338: Non-public API usage - The app references non-public
> selectors in WcBc.iOS: behaviorTypes, convolutionState,
> discoverAllContactUserInfosWithCompletionHandler:,
> discoverAllContactsCompletionBlock,
> discoverUserInfoWithEmailAddress:completionHandler:,
> discoverUserInfoWithUserRecordID:completionHandler:,
> discoverUserInfosCompletionBlock, displayContact, drawableResizesAsynchronously,
> encodeToCommandBuffer:sourceImage:convolutionState:,
> encodeToCommandBuffer:sourceImage:destinationImage:state:,
> getProperty:onChannel:responseHandler:, hasProperty:onChannel:responseHandler:,
> initWithEmailAddresses:userRecordIDs:, initWithMIDIEntity:dataReadyHandler:,
> initWithZoneID:options:, initWithZoneID:subscriptionID:options:,
> isPublicDatabase, mouseUpAction, newDrawable, propertyChangedCallback,
> removeAllAppearanceStreams, replaceTextStorage:, retrieveConnectedPeripherals,
> retrievePeripherals:, setDiscoverAllContactsCompletionBlock:,
> setDiscoverUserInfosCompletionBlock:, setDrawableResizesAsynchronously:,
> setEditedMask:, setMouseUpAction:, setMovieControlMode:,
> setProperty:onChannel:responseHandler:, setPropertyChangedCallback:,
> setSocketFamily:, setTemporaryAttributes:forCharacterRange:, setUserRecordIDs:,
> sourceOffset, subscriptionOptions, takeBackgroundColorFrom:, takePasswordFrom:,
> temporalAntialiasingEnabled, userRecordIDs. If method names in your source code
> match the private Apple APIs listed above, altering your method names will help
> prevent this app from being flagged in future submissions. In addition, note
> that one or more of the above APIs may be located in a static library that was
> included with your app. If so, they must be removed. For further information,
> visit the Technical Support Information at http://developer.apple.com/support/technical/

All of them have been removed but without a break in the API excep
"initWithMIDIEntity:dataReadyHandler:" wich does look like an error on
Apples side.

Empty stubs are used as much as possible except on those cases in which
a handler is called or an output variable should be modified (buffer,
out param) to minimize the users surprise at runtime.
2020-08-14 14:53:01 -04:00
Sebastien Pouliot e47e10addf
[corebluetooth] Update for Xcode 12 beta 3 (#9186)
Apple removed the 10.16 API instead of marking them for 11.0 ?!?
2020-07-24 18:16:46 -04:00
Sebastien Pouliot 5bf1073cdb
[corebluetooth] Update for Xcode 12 beta 2 (#9037) 2020-07-08 17:27:02 -04:00
monojenkins 8ffa3d888b
[d16-7] [src] Remove Classic code from the CoreBluetooth, CoreAudioKit, CoreAnimation, ContactsUI, Contacts, CloudKit, ClassKit, CFNetwork, CarPlay, CallKit and BusinessChat frameworks. (#8784)
* BusinessChat

* CFNetwork

* CallKit

* CarPlay

* ClassKit

* CloudKit

* Contacts

* ContactsUI

* CoreAnimation

* CoreAudioKit

* CoreBluetooth

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-06-05 13:08:51 -04:00
Rolf Bjarne Kvinge 868079850d
[src] Remove Classic code from the CoreBluetooth, CoreAudioKit, CoreAnimation, ContactsUI, Contacts, CloudKit, ClassKit, CFNetwork, CarPlay, CallKit and BusinessChat frameworks. (#8778) 2020-06-05 16:05:53 +02:00
Alex Soto 570930ec3f
[CoreBluetooth] Update bindings to Xcode 11.4 Beta 1 (#7864) 2020-02-12 18:35:07 -05:00
Alex Soto b02da292bf
[corebluetooth] Update for Xcode 11 GM (#6990)
This should let us provide a nicer API for the GM change about
`CBManager authorization` moving from an instance to a static
property (in all but iOS 13.0 / watchOS 6.0)
2019-09-12 13:40:46 -04:00
Rolf Bjarne Kvinge 344dadb212
Bump the minimum iOS version to 7.0. Fixes #6213. (#6878)
Xcode 11 doesn't support anything below iOS 7.0 (the linker will automatically
change the deployment target to 7.0), so we need to drop support as well
(since our native bits will be targetting iOS 7.0, and we can't change that).

https://github.com/xamarin/xamarin-macios/issues/6213
2019-08-30 01:07:30 -07:00
Rolf Bjarne Kvinge c1e6ac029f [src] Remove/obsolete 'onlyOn64: true' in attributes. (#6595)
* [src] Obsolete 'onlyOn64' parameter to the availability attributes.

* [src] Remove 'onlyOn64: true' from attributes.

* [src] Adjust availability attributes.
2019-07-16 12:13:11 -04:00
Manuel de la Pena c46f3a4da1
[CoreBluetooth] Update bindings for Xcode 11 beta 1 & beta 2 & beta 3. (#6475) 2019-07-05 19:20:35 +02:00
Sebastien Pouliot d988124684
Remove private API (#5915)
* [pdfkit] Remove private API

* [vision] Remove VNRequest preferredMetalContext API and add API compatibility stub

Looks like it was removed between iOS 11 beta 4 and 5
http://codeworkshop.net/objc-diff/sdkdiffs/ios/11.0b5/Vision.html

* [gameplaykit] Do not expose selector for 'RemoveData'

* [cloudkit] Remove selector from deprecated 'UsesBackgroundSession' API

* [metalperformanceshaders] Remove private API

* [gamekit] Remove private API

* [avfoundation] Replace AVAssetResourceLoadingRequest 'finished' by 'isFinished'

Apple now reject the original (iOS 6) `finished` selector - even if its
replacement `isFinished` is not available until iOS 7.

* [corebluetooth] 'Primary' and 'UUID' are not mutable

This was not documented (or mis-documented in earlier macOS docs) and
the API are now replaced with empty stubs to maintain binary
compatibility with existing code.

* [coreanimation] Remove CAEmitterBehavior 'initWithType:' and 'behaviorWithType:' API

Corresponding headers were removed in Xcode 9 without any explanation
rdar #33590997 was filled - no news
'initWithType:' and 'behaviorWithType:' API now cause rejection
Tracked in https://trello.com/c/J8BDDUV9/86-33590997-coreanimation-quartzcore-api-removals

* [uikit] Remove (macOS only) API from NSLayoutManager (on other platforms)
2019-04-25 10:16:22 -04:00
Rolf Bjarne Kvinge 798cb5a688 [src] Adjust availability attributes to match API available on older macOS versions. 2018-07-03 16:55:30 +02:00
Sebastien Pouliot 8e72465496
[macos][corebluetooth] Enable CBConnectPeripheralOptionStartDelayKey on macOS (#4212)
Headers mention macOS 10.13 but, upon verification, the latest 10.13.5
still reports the key as missing from the framework.

Also remove the 10,13,4 maximum since we now have Mac(10,14) attributes
in the platform assemblies (which solve the previous issue)
2018-06-11 13:22:35 -07:00
Chris Hamons c0202e0e2b
PMCS Removal (#3197)
You were the preprocessor we wished C# had natively

Removing PMCS requires these changes:
* Remove XamCore from src/
* Remove XamCore from tools/
* Remove XamCore from runtime/
* nint/nuint enum conversion
* _compat_ enum conversion
* NSAction conversion
* Hand fix single API incorrectly converted by PMCS to unbreak compatibility
   - Due to a bug in PMCS, the nuint was incorrectly converted in this API.
   - However, as that ship as sailed, we must "fix" it until XAMCORE_4_0
* Update readme
* Bump macios-binaries
2018-02-05 10:26:29 -05:00
Sebastien Pouliot 07c81479e2
[tests][intro] Clean up old and some non-required availability attributes (#3141)
We normally frown on large scale _cosmetic_ changes, mostly because it breaks git's history (very useful) and makes merging branches harder and more error prone (very annoying).

However we require, right now, such changes to remove our old, mcs-based, pre-processor (pmcs) so it's a _good_ time to address the old, unneeded availability attributes - since most of them are re-written for our next milestone.

This won't change the final application size in most cases, as the linker removes them, but it will make the (unlinked) platform assemblies smaller. This means they will load faster (e.g. by mtouch, mmp, IDE, workbooks...) and will reduce the time/memory needed to reflect them.
2018-01-02 11:28:55 -05:00
Chris Hamons 91d598909a
Update more Availability attributes in files not processed by the generator (#3123) 2017-12-21 09:09:55 -06:00
Chris Hamons cad99240e7
Hand-process troublesome attributes to fit pmcs conversion tooling (#3101)
There are a number of availability constructs that were uncommon enough / difficult to handle in the generator update or dead simple enough to change.

Some of them include:
   - Multiple platforms |'ed into one Availability attributes.
   - 32-bit arch Availability attributes were really uncommon and hand processing allowed
     them to be skipped completely
   - Convert Since, MavericksAttribute/MountainLionAttribute/LionAttribute, and a bunch of Availability (Introduced) to short forms like [Mac] and [iOS].

I also had to patch PMCS to correctly handle PlatformArchitecture arguments, which is ironic because a PR soon after this will delete all of that code.
2017-12-20 09:19:16 -06:00
Timothy Risi 27741b636c [macOS] Fix Introspection and API tests (#2891) 2017-10-23 11:22:17 -08:00
Sebastien Pouliot 19a01f77cf [corebluetooth] Update up to beta 6 and enable it on watchOS (#2540)
macOS 10.13 has finally catch up with iOS and this simplifies the
bindings a bit.
2017-08-24 17:41:10 -04:00
Vincent Dondain e78a7a3291 [intro] Add availability messages checks to ApiTypoTest (#2240)
- ApiTypoTest now enforces the rules defined here: https://github.com/xamarin/xamarin-macios/wiki/BINDINGS#availability-attributes-messages.
- Update all availability messages to follow new ApiTypoTest rules.
- Fix `IsObsolete` to handle ObsoletedAttribute.
- Don't apply rule 1 on Obsolete attribute.
- Allow to skip rule 4.
- Prevent use of OSX, OS X.
2017-06-26 18:17:06 -04:00
Timothy Risi 065b189c26 [Mac] CoreBluetooth low hanging fruit bindings (#947) 2016-10-05 11:10:32 -05:00
Chris Hamons 3bdb0e37a6 [XM] More xtro-sharpie fixes (#682) 2016-08-26 12:32:45 -05:00
Chris Hamons b54bcd6ae0 [XM] Fix xtro-sharpie issues (#620) 2016-08-17 20:11:05 -04:00
Vincent Dondain 13dfd6677e [corebluetooth] Update for iOS 10 beta 1 (#342)
- Filled radar://27160443 for CBUUIDValidRangeString being
  different than CBUUIDCharacteristicValidRangeString on macOS.
2016-07-04 20:58:20 -04:00
Manuel de la Pena c3b768d739 [Fix] Add missing strong dict chectionaries in CoreBluetooth. (#168) 2016-06-16 18:34:31 -07:00
Rolf Bjarne Kvinge 5830166c63 Build the platform assemblies. 2016-04-24 14:47:26 -04:00