* Change BlockLiteral.SetupBlock to keep a reference to the delegate passed as the trampoline.
Change BlockLiteral.SetupBlock to keep a reference to the delegate passed as
the trampoline, so that it's safer for normal users (crashes due to incorrect
usage are rare and random, and as such they're also hard to track down).
Additionally introduce a BlockLiteral.SetupBlockUnsafe method, that still has
the old behavior, so that we can use it in our own (reviewed) code.
* [ObjCRuntime] Add some validation to BlockLiteral.SetupBlock.
* Use BlockLiteral.SetupBlockUnsafe instead of .SetupBlock
Use SetupBlockUnsafe in our own code, because we know our own code is using it
correctly (by passing a trampoline stored in a static field, so that the GC
doesn't free it).
* [tests] Fix xammac tests build.
* [xharness] Don't list unusable devices.
* [xharness] Show the list of candidate devices in the html report.
* [xharness] Prioritize devices depending on the interface speed.
* [xharness] Simplify code a bit.
Logs are TextWriters by themselves, so no need to get a StreamWriter to pass
to API that takes TextWriter, when we can just pass the log instance itself.
This makes it possible to timestamp external process output (because
Log.Timestamp is honored instead of bypassed).
* [xharness] Timestamp install logs.
So that we get exact numbers of how long it takes to install on watch (and if
the watch installation stalls, or just times out because it takes too long).
Always wait for processes to exit, even if they're killed.
Also make absolutely sure that we can safely handle any exception when getting
the ExitCode, no matter what.
https://bugzilla.xamarin.com/show_bug.cgi?id=57846
* [ios11-b1] CoreGraphics bindings
* Updated with feedback from Sebastien
* Fix build, optimize checks
* Add version information
* Address comments
* Tests
* Remove Apply code, add special code for typo
* [CoreGraphics] Add comma after last enum value.
* [CoreGraphics] No need to bind CGColorSpaceGetName.
* [CoreGraphics] Add new field in Xcode 9 beta 5.
* [CoreGraphics] Move kCGPDFContextAccessPermissions to the correct dictionary container and implement the corresponding manual code.
* [CoreGraphics] Adjust nullability acceptance based on new attributes for CGColorSpace.CreateCalibratedGray/RGB functions.
* [CoreGraphics] Bind CGColorSpaceCreateLab, introduced in Xcode 9 beta 5.
* [CoreGraphics] Adjust CGColorSpaceCreateWithICCData and CGColorSpaceCreateWithICCProfile bindings according to Xcode 9 beta 2.
Apple introduced CGColorSpaceCreateWithICCData in b1, and made
CGColorSpaceCreateWithICCProfile a typedef to CGColorSpaceCreateWithICCData.
Apple reversed the typedef in b2 (probably because it creates broken
executables when targetting earlier versions of macOS, since those executables
would use CGColorSpaceCreateWithICCData, which would not exist), and instead
made CGColorSpaceCreateWithICCProfile a normal deprecated method.
So copy this logic in our bindings: deprecate CreateICCProfile, and introduce
CreateICCProfile, with two overloads for NSData and CGDataProvider (since
that's what's accepted according to the documentation).
* [CoreGraphics] Add CGContextPDF constructors to make parity between different overloads.
There are two types of CGContextPDF constructors: the first argument is either
an NSUrl or a CGDataConsumer. Previously the NSUrl type had more overloads,
and also allowed a null CGRect for the second argument. With the overloads are
identical between the two types of CGContextPDF constructors.
Existing constructors:
CGContextPDF (NSUrl, CGRect, CGPDFInfo)
CGContextPDF (NSUrl, CGRect)
CGContextPDF (NSUrl, CGPDFInfo)
CGContextPDF (NSUrl)
CGContextPDF (CGDataConsumer, CGRect, CGPDFInfo)
Added constructors:
CGContextPDF (CGDataConsumer, CGRect)
CGContextPDF (CGDataConsumer, CGPDFInfo)
CGContextPDF (CGDataConsumer)
Additionally the code has been fixed to not throw NullReferenceExceptions if
null is passed for any of the values and instead pass on any null values to
the native `CGPDFContextCreate` method (since `CGPDFContextCreate`'s arguments
are all `__nullable`).
* [tests] Add and improve existing tests for new and some existing CoreGraphics API.
* Undo accidental whitespace noise.
* [tests] Remove random characters in assert message.
* [CoreGraphics] Improve argument exception messages in CGColorSpace according to review.
* [CoreGraphics] Use 'Icc' instead of 'ICC' for new API, and also make the change for XAMCORE_4_0.
* [CoreGraphics] Fix availability attribute for High Sierra.
* [tests] Update monotouch-test after API changes.
csc does not allow unsafe code in iterators:
AudioUnit/AudioUnit.cs(1725,13): error CS1629: Unsafe code may not appear in iterators
AudioUnit/AudioUnit.cs(1725,33): error CS1629: Unsafe code may not appear in iterators
AudioUnit/AudioUnit.cs(1723,19): error CS1629: Unsafe code may not appear in iterators
It looks like mcs incorrectly allows this (https://bugzilla.xamarin.com/show_bug.cgi?id=56616).
So change the code to remove unsafe usage in iterators.
* [AVFoundation] AVFoundation API Enhancements
Changes in AVFoundation
===================
AVCaptureSynchronizedDataCollection:
* Obsoletes `From` method because the name does not makes sense in the current context.
* Obsoletes `ObjectForKeyedSubscript` in favor of a C# indexer.
* Adds `GetSynchronizedData` to replace obsoleted `From` method`.
AVCaptureSynchronizedData:
* Adds `[Abstract]` in XAMCORE_4_0 because it is an abstract superclass.
AVCaptureDevice:
* Adds strong typed API to `GetAuthorizationStatus` and `RequestAccessForMediaType`
using `AVAuthorizationMediaType` enum holding the only possible values.
AVCaptureDepthDataOutput:
* AVCaptureDepthDataOutput needs its default .ctor, there is no other way
to instantiate this class.
Test
====
A test exercising the new API lives here:
4715069b2b/AVCaptureDataOutputSynchronizerTest/AVCaptureDataOutputSynchronizerTest/ViewController.cs
The API needs an iPhone 7+, 8+ or X in order to run.
* Fix casing typos
AVCapturePhotoOutput:
* Adds missing members `DepthDataDeliverySupported` and `DepthDataDeliveryEnabled`
from `AVCapturePhotoOutputDepthDataDeliverySupport` category.
AVCaptureDevice:
* Adds missing members `ActiveDepthDataFormat`, `MinAvailableVideoZoomFactor` and
`MaxAvailableVideoZoomFactor` from `AVCaptureDeviceDepthSupport` category.
The registrar requires the availability attributes to work properly, which is
non-trivial when the linker is being used, because the linker runs before the
registrar, and will remove availability attributes.
For this reason we store the availability attributes separately when the
linker removes them so that the registrar can still find them, but
unfortunately it's not enough to store the CustomAttribute instance, because
it may end up crippled: if the attribute type itself is removed by the linker,
then it's not possible to get the attribute type from the CustomAttribute
instance, because 'attribute.Constructor.DeclaringType' returns null (the
linker sets the declaring type of the constructor to null).
Solution: store the attribute type separately; now we use a Tuple of
CustomAttribute and TypeReference.
Fixes this ugly exception:
System.NullReferenceException: Object reference not set to an instance of an object
at XamCore.Registrar.Registrar.RegisterAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00146] in /work/maccore/master/xamarin-macios/src/ObjCRuntime/Registrar.cs:2316
at XamCore.Registrar.StaticRegistrar.Generate (System.Collections.Generic.IEnumerable`1[T] assemblies, System.String header_path, System.String source_path) [0x00035] in /work/maccore/master/xamarin-macios/tools/common/StaticRegistrar.cs:4197
at Xamarin.Bundler.RunRegistrarTask.Execute () [0x00001] in /work/maccore/master/xamarin-macios/tools/mtouch/BuildTasks.mtouch.cs:154
Re-based from Miguel's PR #2476 including reviewers feedback.
[1] https://github.com/xamarin/xamarin-macios/pull/2476
* [spritekit] Add GKSceneRootNodeType to SKScene too and adjust intro tests
* [tests][intro][macos] Don't skip protocol checks for SceneKit on 64 bits
* [registrar] Remove useless interface.
* [registrar] Don't store LinkContext in the static registrar when in can be fetched from the Target. Partially fixes#59617.
This avoids a problem where our code would store null because LinkContext
wasn't created yet when the static registrar instance was created.
This fixes the missing error from bug #59617.
https://bugzilla.xamarin.com/show_bug.cgi?id=59617
* [registrar] Don't verify the SDK for protocol members. Partially fixes#59617.
It's not needed, because protocol members don't end up in the registrar output
anyway (and would thus not prevent the registrar code from compiling).
Classes that implement any protocol members would still run into the SDK
check, so this should not prevent real problematic code from being reported
either.
https://bugzilla.xamarin.com/show_bug.cgi?id=59617
* [tests][mtouch] Fix tests after registrar changes.
It does not make sense to create Xamarin.iOS projects that don't reference
Xamarin.iOS.dll, so make this an explicit error.
This fixes a NullReferenceException which could (when building for device, or
when not using simlauncher) occur, and instead shows the MT0123 error.
> MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
> System.NullReferenceException: Object reference not set to an instance of an object
> at Xamarin.Bundler.Target.GatherFrameworks () [0x00065] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/common/Target.cs:122
> at Xamarin.Bundler.Target.ProcessAssemblies () [0x000c2] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Target.cs:802
> at Xamarin.Bundler.Application.ProcessAssemblies () [0x0002f] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:1407
> at Xamarin.Bundler.Application.BuildManaged () [0x00001] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:831
> at Xamarin.Bundler.Application+<>c.<BuildAll>b__134_1 (Xamarin.Bundler.Application v) [0x00000] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:779
> at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x00024] in <48b95f3df5804531818f80e28ec60191>:0
> at Xamarin.Bundler.Application.BuildAll () [0x00050] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:779
> at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00481] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/mtouch.cs:1420
> at Xamarin.Bundler.Driver.Main (System.String[] args) [0x0000f] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/mtouch.cs:945
https://bugzilla.xamarin.com/show_bug.cgi?id=59798
Otherwise copying OpenTK-1.0.dll.config to its target destination would fail
because the target directory didn't exist:
> make[2]: *** [build/tvos/reference/OpenTK-1.0.dll.config] Error 1
https://bugzilla.xamarin.com/show_bug.cgi?id=59432
We already have this logic for frameworks we detect according to the namespace
of the used types, but not for frameworks we detect from P/Invokes.
Fix this by using the same framework exclusion logic for frameworks detected
from P/Invokes: don't link with frameworks not available in the current SDK.
https://bugzilla.xamarin.com/show_bug.cgi?id=59636
Unset XCODE_DEVELOPER_DIR_PATH when building mac binding projects, so that
when building from VSfM when the Xcode in VSfM differs from the system Xcode
(according to xcode-select) the Xcode command-line tools don't end up confused
and fail in strange ways.