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

3909 Коммитов

Автор SHA1 Сообщение Дата
Alex Soto bf53596d35 [SceneKit] Workaround SCNAnimationEvent breaking change introduced in iOS 11 (#3160)
This fixes xamarin-macios#3145 and xamarin/xamarin-macios#3146

This workarounds an Apple breaking change (since `SCNAnimation` protocol is new in iOS 11):

The Old definition was
> typedef void (^SCNAnimationEventBlock)(CAAnimation animation, id _Nonnull animatedObject, BOOL playingBackward)

The new ObjC definition is:
> typedef void (^SCNAnimationEventBlock)(id<SCNAnimation> animation, id animatedObject, BOOL playingBackward);

and it is bound as:
> delegate void SCNAnimationEventHandler (CAAnimation animation, NSObject animatedObject, bool playingBackward);

and for watchOS and XAMCORE_4_0 it is bound as:
> delegate void SCNAnimationEventHandler (ISCNAnimationProtocol animation, NSObject animatedObject, bool playingBackward);

Fortunatelly `CAAnimation` conforms to `SCNAnimation` protocol and
we are now abusing this fact and forcing its creation with `GetINativeObject`
this way we keep a single API and we can always completely fix this
when XAMCORE_4_0 happens following suit with apple's breaking change.
2018-01-05 08:59:03 -05:00
Sebastien Pouliot 1a7f90aef3
[tests][xtro] Add annotations after auditing some unknowns for ExternalAccessory.framework (#3163) 2018-01-05 08:53:11 -05:00
Timothy Risi 6ff74c5854 [MMP][60534] MMP Should check that Deployment Target is not below min version (#3122)
Return a build error if Deployment Target is too low
Add an mmptest for the change
2018-01-04 15:19:44 -05:00
Sebastien Pouliot ec744533b9
[generator] Add support for [RequiresSuper] attribute. Fixes #58350 (#3147)
* Add new attribute;
* Add generator support (re-copy attribute);
* Add xtro rule to detect missing/extra [RequiresSuper] attributes;
* Add attributes to the required API;

The generated code changes (reversed) can be verified with
https://gist.github.com/spouliot/1c91d6ee7c084a06890e5f3f2a475001

Reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=58350
2018-01-04 11:48:00 -05:00
Sebastien Pouliot a9788a480b
[macos][corespotlight] Enable CoreSpotlight for XM (#3157)
First shown (incorrectly) in El Capitan headers it finally made it's way
in High Sierra!
2018-01-04 10:53:52 -05:00
Alex Soto 30669abe5c
[Vision] Removes incorrect [Abstract] from VNDetectBarcodesRequest (#3155)
Fixes xamarin/xamarin-macios#3140

According to headers and documentation this should not be abstract.
This was incorrectly added by me in 89071bc19d
I could not find why this was added by checking headers nor I can
recall why I added it so I'll just say it was a honest mistake :) Oops... 🙈
2018-01-03 19:33:45 -06:00
Chris Hamons 4c5161a446
Create classic snapshot of bgen and update tests/scripts (#3153)
Previous PMCS removal changes froze XamMac.BindingAttributes.dll but not bgen.exe which causes interesting issues when we make changes there and run classic XM tests.

This can be seen here: #3147

This PR freezes bgen-classic in macios-binaries (which will need to be added to master and bumped before this goes in) and update various scripts/tests.
2018-01-03 15:41:49 -06:00
Sebastien Pouliot 09e346142e
[avfoundation] Add some missing API detected by xtro. Also fix #60924 (#3154)
https://bugzilla.xamarin.com/show_bug.cgi?id=60924
2018-01-03 15:09:38 -05:00
Sebastien Pouliot d2c7084f72
[macos][notificationcenter] Fix extraneous setter on NCWidgetProviding.WidgetAllowsEditing (#3150)
Before XAMCORE_4_0 the setter will throw an `NotImplementedException`
which is better, and more accurate, than a native exception.

Found by xtro. Data file updated.
2018-01-03 08:50:36 -05:00
Sebastien Pouliot 39a514602c
[uikit] Remove old selector checks in UIDevice (#3151)
Those were useful, a long time ago, to use the API even on _older_
versions. This is not needed anymore and can be simplified.
2018-01-03 08:49:11 -05:00
Sebastien Pouliot 3df75b7baa
[macos][audiotoolbox] Enable some existing API for XM (#3149)
and this allows adding (missing) `AVAudioEngine.MusicSequence` for
AVFoundation.

Updated xtro files.
2018-01-02 21:53:12 -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
Sebastien Pouliot 3ea8ad4041
[tests][xtro] Annotation update (#3143) 2018-01-02 08:18:32 -05:00
Sebastien Pouliot a69e161d59
[src] Properly annotate designated initializers in many frameworks (#3142)
Correspond to xtro `!missing-designated-initializer!` errors
2017-12-28 16:37:13 -05:00
Sebastien Pouliot dcf8b1110c
[social] Enable SLComposeServiceViewController on macOS and fix other xtro reported issues (#3132)
* SLComposeServiceViewController has [Mac] specific stuff but was
excluded under a (too large) `#if !MONOMAC`

* SLComposeSheetConfigurationItem::init is a designated initializer

* SLRequest::addMultipartData:withName:type: is macOS-only and missing

xtro results:
!missing-designated-initializer! SLComposeSheetConfigurationItem::init is missing an [DesignatedInitializer] attribute
!missing-selector! SLComposeServiceViewController::charactersRemaining not bound
!missing-selector! SLComposeServiceViewController::contentText not bound
!missing-selector! SLComposeServiceViewController::placeholder not bound
!missing-selector! SLComposeServiceViewController::setCharactersRemaining: not bound
!missing-selector! SLComposeServiceViewController::setPlaceholder: not bound
!missing-selector! SLComposeServiceViewController::textView not bound
!missing-selector! SLRequest::addMultipartData:withName:type: not bound
!missing-type! SLComposeServiceViewController not bound
2017-12-28 13:14:23 -05:00
Sebastien Pouliot 02042741db
[macos][photosui] Make PHLivePhotoView available on macOS (#3136)
* PHLivePhotoView only available on 64 bits

xtro results:
!missing-enum! PHLivePhotoViewContentMode not bound
!missing-enum! PHLivePhotoViewPlaybackStyle not bound
!missing-protocol! PHLivePhotoViewDelegate not bound
!missing-selector! PHLivePhotoView::audioVolume not bound
!missing-selector! PHLivePhotoView::contentMode not bound
!missing-selector! PHLivePhotoView::delegate not bound
!missing-selector! PHLivePhotoView::isMuted not bound
!missing-selector! PHLivePhotoView::livePhoto not bound
!missing-selector! PHLivePhotoView::livePhotoBadgeView not bound
!missing-selector! PHLivePhotoView::setAudioVolume: not bound
!missing-selector! PHLivePhotoView::setContentMode: not bound
!missing-selector! PHLivePhotoView::setDelegate: not bound
!missing-selector! PHLivePhotoView::setLivePhoto: not bound
!missing-selector! PHLivePhotoView::setMuted: not bound
!missing-selector! PHLivePhotoView::startPlaybackWithStyle: not bound
!missing-selector! PHLivePhotoView::stopPlaybackAnimated: not bound
!missing-type! PHLivePhotoView not bound

* [xtro] Sort earlier in EnumCheck so we don't have to duplicate checks (or get random failures)
2017-12-28 08:51:34 -05:00
Chris Hamons 8169c63aba Fix behaviour of NSMenuItem.Activated on top of modal windows. (#3134)
Setting `NSMenuItem.Activated` internally creates the `ActionDispatcher` object that is assigned to the `Target` property. 

When the menu item gets activated the system calls `NSApplication.SendAction`, which internally
checks the `WorksWhenModal` property on the `Target` object before proceeding with the action.

Since `ActionDispatcher` is not part of the normal `NSResponder` chain it needs to implement the property itself to ensure the event is fired even when the menu is opened from a modal window.
2017-12-27 09:52:12 -05:00
Sebastien Pouliot 9c375c614a
[xtro] Don't assume a nested type when no namespace is available (#3133)
That fix a NRE while running xtro

12:55:31.4682580 System.NullReferenceException: Object reference not set to an instance of an object
12:55:31.4682960   at Extrospection.Helpers.GetFramework (Mono.Cecil.TypeReference type) [0x00012] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xtro-sharpie/Helpers.cs:284
12:55:31.4683110   at Extrospection.EnumCheck.VisitManagedType (Mono.Cecil.TypeDefinition type) [0x0006c] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xtro-sharpie/EnumCheck.cs:28
12:55:31.4683210   at Extrospection.AssemblyReader.ProcessType (Extrospection.BaseVisitor v, Mono.Cecil.TypeDefinition type) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xtro-sharpie/Runner.cs:78
12:55:31.4683320   at Extrospection.AssemblyReader.Load (System.String filename) [0x00079] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xtro-sharpie/Runner.cs:71
12:55:31.4684210   at Extrospection.Runner.Execute (System.String pchFile, System.Collections.Generic.IEnumerable`1[T] assemblyNames) [0x000f2] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xtro-sharpie/Runner.cs:41
12:55:31.4684400   at Extrospection.MainClass.Main (System.String[] args) [0x00046] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xtro-sharpie/Program.cs:20

https://jenkins.mono-project.com/job/xamarin-macios-pr-builder/5845/Test_Report/

Short story: PR #3096 adds **non public** attributes without a namespace
so they take precedence over existing ones.

xtro enum check also needed to discard them.
2017-12-22 15:40:19 -05:00
Chris Hamons 734850d416
Remove PMCS processing of availability attributes (#3096)
- XamarinPreprocessorVisitor handled processing/generating availability
  attributes but needs to be removed as it depends on PMCS
- Because processing was handled at a preprocessor/token level before and
  now inside generator.cs a number of changes were needed avoid checking
  in a million line diff (literally)
- This commit creates a "shadow" set of availability attributes, with
  the desired names [Mac] [Watch] [NoTV], etc when not in existence before
- Instead of adding hundreds of using statements to force resolution of these
  shadow types, I abuse C# type resolution by storing them in the root
  (not namespaced) so they are resolved first.
- generator-attributes-manager was taught how to process the multitude of
  old-style attributes and how to generate the new-style attributes
- Generator's bug57070 is no longer valid, since we _can_ and do convert [iOS]
2017-12-22 13:03:21 -06:00
Sebastien Pouliot 3d58e360e5
[xtro] Fix macOS Intent sanity warning (#3131)
PR3119 was done (and tested on bots) before PR3120 that checked for
such mistakes. They were committed in the reverse order too
2017-12-22 13:08:43 -05:00
Chris Hamons 7f565e6e4c
Stop injecting compiler arguments via PMCS (#3057)
- Remove PMCS injection of command line arguments. Handled directly by Makefile
- Classic iOS is still building for now due to documentation issues but will be removed at a later date.
2017-12-22 10:37:40 -06:00
Timothy Risi 6ad9014c9f [Xammac_tests] RoundtripRSAMinPKCS1 public/GetPublicKey should be false on 10.13 (#3116) 2017-12-22 10:29:59 -05:00
Sebastien Pouliot 4509e66168
[mtouch] Fix Xamarin.Sdk not to link with private frameworks. Fixes #61039 (#3118)
We can't trust Apple's native linker to pick the right (non private)
framework when an older TargetVersion is used. It just prefer what's
available - even if specified with a WeakFramework :(

That was already dealt with for applications. However the native linking
of the Xamarin.Sdk.framework (code sharing with extensions) is done with
the `LinkTask` instead of the `NativeLinkTask` so it did not have the
"auto correct" code.

Unit test added.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=61039
2017-12-22 10:28:29 -05:00
Sebastien Pouliot 76ea46e347
[tests][xtro] Migration of annotation (WIP) (#3119) 2017-12-22 09:29:37 -05:00
Sebastien Pouliot 81381c3ee6
[watchos][accelerate] Enable Accelerate framework on watchOS (#3127)
According to documentation this was added in watchOS 4.0

xtro reported:
!missing-pinvoke! vImageBoxConvolve_ARGB8888 is not bound
!missing-pinvoke! vImageBoxConvolve_Planar8 is not bound
!missing-pinvoke! vImageConvolve_ARGB8888 is not bound
!missing-pinvoke! vImageConvolve_ARGBFFFF is not bound
!missing-pinvoke! vImageConvolve_Planar8 is not bound
!missing-pinvoke! vImageConvolve_PlanarF is not bound
!missing-pinvoke! vImageConvolveMultiKernel_ARGB8888 is not bound
!missing-pinvoke! vImageConvolveMultiKernel_ARGBFFFF is not bound
!missing-pinvoke! vImageConvolveWithBias_ARGB8888 is not bound
!missing-pinvoke! vImageConvolveWithBias_ARGBFFFF is not bound
!missing-pinvoke! vImageConvolveWithBias_Planar8 is not bound
!missing-pinvoke! vImageConvolveWithBias_PlanarF is not bound
!missing-pinvoke! vImageMatrixMultiply_ARGB8888 is not bound
!missing-pinvoke! vImageRichardsonLucyDeConvolve_ARGB8888 is not bound
!missing-pinvoke! vImageRichardsonLucyDeConvolve_ARGBFFFF is not bound
!missing-pinvoke! vImageRichardsonLucyDeConvolve_Planar8 is not bound
!missing-pinvoke! vImageRichardsonLucyDeConvolve_PlanarF is not bound
!missing-pinvoke! vImageTentConvolve_ARGB8888 is not bound
!missing-pinvoke! vImageTentConvolve_Planar8 is not bound
2017-12-22 09:09:39 -05:00
Sebastien Pouliot 137aecc361
Bump XI to 11.9 and XM to 4.3 now that d15-6 is branched (#3121) 2017-12-21 17:06:57 -05:00
Sebastien Pouliot b546a20256
[src] Use a single, shared declaration for the 'close' p/invoke (#3126)
Beside eliminating a bit of code duplication this solve the random
(metadata order) xtro report

> ?unknown-entry? !unknown-pinvoke! close bound in 'macOS-ObjCRuntime.ignore'

because it was reported against two namespaces and we don't check
for duplicate p/invokes (largely because there's tons of them in
OpenTK)

Fixes https://github.com/xamarin/maccore/issues/602
2017-12-21 15:18:06 -05:00
Sebastien Pouliot ae061822ac
[tests][xtro] Warn if entries in *.todo files seems fixed (not in corresponding .raw files) (#3120) 2017-12-21 13:10:34 -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 3c835eefac
Semantically equivalent attributes which make PMCS conversion easier (#3125) 2017-12-21 09:05:11 -06:00
Sebastien Pouliot b0ed1c49b3
[apidiff] Update master XML references to 15.6 branch (#3124) 2017-12-20 21:44:18 -05: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
Sebastien Pouliot 0cd74f2ed9
Bump mono and fix default for linker UserAction (#3113)
The linker bump (included in the mono bump) requires setting a default value for UserAction
4d2362d808

Commit list for mono/mono:

* mono/mono@ce89e4c5fa [threads] Fix leak of gchandle to MonoInternalThread (#6258)
* mono/mono@9bd33ec5b6 [android] Android NDK does not contain API level/platform 12
* mono/mono@63e8dc6ea1 Bump cecil
* mono/mono@e65bf00e22 Merge pull request #6122 from lewurm/2017-10-interp-aot-mode-fixes
* mono/mono@8f0589ae81 [mini] Add missing try holes
* mono/mono@ab20369d5f [mini] Align stack when resuming to catch handler
* mono/mono@3a134a2d8c [mini] Add missing try holes
* mono/mono@2e775c7e39 [mini] Fix clause try hole checking
* mono/mono@a9a4166431 [loader] Don't assert on abstract methods in get_method_constrained
* mono/mono@feba66a6ce [interp] small improvment for error reporting in interp compile method callback
* mono/mono@6fc6ca1e18 [aot] encode interp_in wrappers with proper signature
* mono/mono@7332690826 [interp] fix copy/paste-typo in n2m macro magic
* mono/mono@b64faae88c [aot] add more signatures for interp_in wrapper needed for iOS
* mono/mono@b3b0613ad3 Bump msbuild to bring in fix for #60770 (#6107)
* mono/mono@ddeba6e1ba [interp] fix using conv.u with string
* mono/mono@0360f420fe Bump API snapshot submodule
* mono/mono@2f18e7dd23 Bump cecil & linker to match master.
* mono/mono@0f53cb275c [interp] allow unsigned i8 in pinvoke signature

Diff: c5cd0f1e7f...ce89e4c5fa

https://bugzilla.xamarin.com/show_bug.cgi?id=60770
2017-12-18 17:56:12 -05:00
Sebastien Pouliot 701ec075c8
[macos][photos] Fix breaking change wrt PHLivePhotoFrameProcessingBlock (#3112)
API diff reported

```
Type Changed: Photos.PHLivePhotoEditingContext

Removed property:

	public virtual PHLivePhotoFrameProcessingBlock FrameProcessor { get; set; }

Removed Type Photos.PHLivePhotoFrameProcessingBlock
````
2017-12-18 13:31:17 -05:00
Sebastien Pouliot 48530bcd8d
[tests][security] Update TrustTest to run faster (without timeouts) (#3108)
The original test was to cover both X509Certificate and X509Certiicate2
when using with SecTrust. However the code diverged over time. That and
the different certificates used caused the `*2` tests to hit a time
loop (designed to reduce incorrect errors randomly reported).

We want to keep the "delay" logic for it's intended purpose - but it
should not be needed normally.

The tests have been refactored to reuse the same logic (between both
types of certificates) which solve this (when used with the same
certificates)

Replace https://github.com/xamarin/xamarin-macios/pull/3068
2017-12-18 11:14:31 -05:00
Sebastien Pouliot fffaba2414
[xtro] Add sanity tests to keep the entries up to date (avoid invalid, dupes and out of date entries) (#3110) 2017-12-18 10:49:07 -05:00
Alex Soto f8d7c54a0f [generator] Disallow the use of [Async] when the signature contains ref/out parameters, fixes bug 58792. (#3059)
When a method signature contains any ref/out parameters
it is a hint that this method is not a candidate to be
used with [Async] we now error BI1062 in the generator.

The reason of an error instead of a warning is that we
currently generate not compilable code when ref/out is
used on the method signature or in the signature of the
delegate (completion handler), it is very unlikely we are
breaking someone now that we emit an error instead of broken
code.

* Fix Anchor and Clarify the addition of BI1117 Warning into docs/website/generator-errors.md

BI1117 Warning documentation was missing from docs/website/generator-errors.md
so I added it.
2017-12-18 09:21:23 -05:00
Jeffrey Stedfast ddf9d63078 bumped Xamarin.MacDev to fix bug #60377 (#3094) 2017-12-15 17:48:37 -05:00
Sebastien Pouliot 8d854a0f3d
[xtro] Split results by framework and add an HTML report (#3093)
* Not every old annotations have been migrated (work in progress, to be completed in another PR);

* Sanitation of the data files (e.g. removal of dupes and fixed, by Apple, entries) is done, but not automated (also a work in progress)

Even then this is immediately useful, i.e. better merged before 15.6 gets branched.
2017-12-15 14:08:09 -05:00
Manuel de la Pena cb688be5c4
[CoreAnimation] Ensure that we increase the handle refenrece count in MakeMutable. Fixes #3089 (#3099)
* [CoreAnimation] Ensure that we increate the handle referene in MakeMutable. Fixes 3089

Fixes https://github.com/xamarin/xamarin-macios/issues/3089
2017-12-15 16:13:42 +01:00
Emanuel Fernandez Dell'Oca 53f260166d Bumps maccore to get Xamarin Analysis fix for XVS (#3105)
Gets the latest version of Xamarin Analysis that includes a fix to copy the Xamarin.iOS.Analysis.targets file to the build output directory
2017-12-14 20:03:59 -05:00
Emanuel c84f0dac3d [msbuild] Fixes MoveTaskBase inclusion
MoveTaskBase inherits from Microsoft.Build.Tasks.Move, and Mono has a different implementation of it, so when building from a Mac we need to include XBuildMoveTaskBase.cs instead. The previous condition does no apply any more, because we're now using MSBuild to build, but the Move task implementation didn't change so it doesn't matter if we're using Xbuild or MSBuild.

This issue is preventing us (XVS) from merging features to our master branch
2017-12-14 19:37:15 -03:00
Chris Hamons b357bb4e1e [macos] NSView.LocationInView should accept null (#3103)
- https://bugzilla.xamarin.com/show_bug.cgi?id=61101
2017-12-14 15:57:07 -05:00
Emanuel 4526a3cf74 Bump maccore to get fix for package step issue 2017-12-14 15:23:37 -03:00
Sebastien Pouliot d414072b74
Update API diff references with xcode92 data (#3097) 2017-12-14 11:48:19 -05:00
Sebastien Pouliot bb330468ec
Bump maccore and guiunit to HEAD (#3098)
There's a separate PR for mono
https://github.com/xamarin/xamarin-macios/pull/3082
2017-12-14 09:48:37 -05:00
Emanuel Fernandez Dell'Oca 37683f771e [xvs] Bump maccore to get msbuild.zip changes (#3095)
We need xamarin/maccore@f819228 because it changes the msbuild.zip to include Xamarin Analysis targets and binaries.
2017-12-13 10:53:52 -05:00
Vincent Dondain 808c67017d
[msbuild] Add support for optionally explaining why inapplicable certificates are not applicable (#3085)
Help fix #58251: When looking for valid signing certificates, print out each invalid certificate and state why it's not valid
(https://bugzilla.xamarin.com/show_bug.cgi?id=58251)
2017-12-12 14:25:04 -05:00
Jeffrey Stedfast b52a38bd33
[msbuild] Catch json parser exceptions to provide better error reporting (#2992)
* [msbuild] Catch json parser exceptions to provide better error reporting

This is in response to https://bugzilla.xamarin.com/show_bug.cgi?id=60536

* Added unit test
2017-12-12 13:54:09 -05:00
Vincent Dondain 79e1d3613e
[xamarin-analysis] Add rule #6 and updated md file (#3088)
- Add XIA0006: HttpClientAvoidManaged.
- Add documentation on how the rules work and how to activate them.
  Also mention that they need to be ran on each active configuration.
- Bump maccore to include XIA 0006.
2017-12-12 12:43:36 -05:00