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

831 Коммитов

Автор SHA1 Сообщение Дата
Vincent Dondain d819d25bff [modelio] Add missing MDLMesh constructors and fix xtro (#1826)
Fixes bug #52575: Missing ModelIO API
(https://bugzilla.xamarin.com/show_bug.cgi?id=52575)

We turn the MDLMesh constructors into static ones because we don't want to lose the shape name.
Also, the signatures of these constructors differ so it would not be possible to use an enum to differentiate the shapes.
2017-03-28 10:08:12 -05:00
Sebastien Pouliot 9686e6464b [tests][xtro] Some fixes, mostly data, so [ios|tvos|watchos].unclassified are empty (#1766)
Also reduce a bit the size of common.unclassified
2017-03-28 10:07:54 -05:00
Manuel de la Pena 8c94c974df [AVFoundation] Fix some minor issues with the Xcode 8.3 bindings. (#1757) 2017-03-28 10:01:04 -05:00
Manuel de la Pena e6130b9735 [AVFoundation] Update bindings for Xcode 8.3 (#1713)
* has some remaining issues that will be fixed in a different PR
2017-03-28 09:56:48 -05:00
Alex Soto c8e4135faa [Intents] Update to Xcode 8.3 Beta 3 (#1741) 2017-03-28 09:53:32 -05:00
Sebastien Pouliot 74fe26f901 [tests][xtro] Add optional generation of bindings for API in xtro's Makefile (#1732) 2017-03-28 09:46:11 -05:00
Sebastien Pouliot cb576d53a9 Revert "[tests] Adjust monotouch-test not to crash on an Apple bug. Fixes #52162 (#1699)"
This reverts commit b502bd71a1.
2017-03-28 09:45:24 -05:00
Vincent Dondain dd54bc4509 [spritekit] Update for Xcode 8.3 beta 1 - part 3 (#1705)
- Fixes bug #52568: Missing SpriteKit API
(https://bugzilla.xamarin.com/show_bug.cgi?id=52568)

xtro revealed that some selectors were still missing after the "part 2" fix.

* [spritekit] Add missing selectors and clean up common.pending

Fixes bug #34946: [spritekit] Missing selectors
(https://bugzilla.xamarin.com/show_bug.cgi?id=34946)

Also as per https://github.com/xamarin/xamarin-macios/pull/1705#pullrequestreview-22328496
we find that there's more value in exposing those static methods (SKUniform::uniformWithName:*) than hiding them.

https://bugzilla.xamarin.com/show_bug.cgi?id=37727 was already fixed but we didn't remove
the added selectors from common.pending

The following selectors were already bound:
!missing-selector! +SKActions::falloffTo:duration: not bound
!missing-selector! +SKVideoNode::videoNodeWithFileNamed: not bound
!missing-selector! +SKVideoNode::videoNodeWithURL: not bound
2017-03-28 09:43:54 -05:00
Vincent Dondain 13972a104b [opengles] Add version check to EAGLContext.PresentRenderBufferTest (#1706)
Fix bug #52456: [iOS]EAGLContextTest.PresentRenderBufferTest failed on lower versions of iOS
(https://bugzilla.xamarin.com/show_bug.cgi?id=52456)
2017-03-28 09:42:24 -05:00
Sebastien Pouliot f261d901b1 [tests] Adjust monotouch-test not to crash on an Apple bug. Fixes #52162 (#1699)
iOS 10.3 simulator (i386 only) will crash executing CTLineTests.
EnumerateCaretOffsets test case.

This does not happen on 64 bits (simulator) or on device builds,
including 32 bits builds. Running iOS 10.1 simulator (with Xcode 8.3)
also runs without problems.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=52162
2017-03-28 09:38:18 -05:00
Sebastien Pouliot bcf27ce090 [security] Add more SecCertificate* API from beta1. Fixes #52505 (#1695)
They were thought to be macOS only but xtro corrected me, they are
new in iOS 10.3 even if some existed previously.

references (xtro):
!missing-pinvoke! SecCertificateCopyCommonName is not bound
!missing-pinvoke! SecCertificateCopyEmailAddresses is not bound
!missing-pinvoke! SecCertificateCopyNormalizedIssuerSequence is not bound
!missing-pinvoke! SecCertificateCopyNormalizedSubjectSequence is not bound
!missing-pinvoke! SecCertificateCopyPublicKey is not bound
!missing-pinvoke! SecCertificateCopySerialNumber is not bound

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=52505
2017-03-28 09:34:52 -05:00
Vincent Dondain 6d7efb1405 [modelio] Fix common.unclassified for recent Xcode8.3 changes (#1692) 2017-03-28 09:31:10 -05:00
Sebastien Pouliot 375fd87f85 [tests][xtro] Run xtro comparison against the locally built assemblies, not the one installed on the system (#1691) 2017-03-28 09:30:55 -05:00
Sebastien Pouliot 25481f5af5 [security] Add new API for beta 1 (#1682)
There's a lot of noise from the header diff, e.g. tabs changed to spaces,
but very few actual changes.

Note that there's more macOS specific code to review but this PR
handles iOS, tvOS and watchOS changes.
2017-03-28 09:30:12 -05:00
Alex Soto 3a1276a992 [VideoToolbox] Updated to Xcode 8.3 Beta 1
* Updated API to reflect Xcode 8.3 beta 1 changes
* This commit also fixes availability metadata to avoid duplicating it
  by moving member availability metadata into its container class where
  possible.
* Enables VideoToolbox tests for tvOS.
2017-03-28 09:29:36 -05:00
Sebastien Pouliot 63c98bcbde [metal] Add new MTL* API from Xcode 8.3 beta1 (#1666)
Covers iOS, tvOS and macOS (no Metal on watch yet)

Most new members are _marked_ as @required (but are not really) by
Apple. We cannot make them `abstract` as it would be a breaking change.
2017-03-28 09:28:53 -05:00
Sebastien Pouliot b05b55a8ed [tvos][mediaplayer] Update xtro definitions (#1654)
The new field and both selectors are not really part of tvOS.

The field is not used anywhere (from available API).

The selectors are on a category on a type that is not part of tvOS.
Sadly they do not get annotated directly and require external data.
2017-03-28 09:28:40 -05:00
Sebastien Pouliot 53645cc336 [tvos][storekit] Adjust StoreKit beta 1 bindings for tvOS (#1646) 2017-03-28 09:26:23 -05:00
Vincent Dondain b15d2e256b [mediaplayer] Update for iOS 10.3 beta 1 (#1627)
* introspection-ios

MPMusicPlayerControllerMutableQueue and MPMusicPlayerControllerQueue's headers show no trace of NSCoding, NSSecureCoding or NSMutableCopying therefore we're skipping them.
2017-03-28 09:24:06 -05:00
Vincent Dondain b7dd01c770 [modelio] Update for iOS 10.3 beta 1 (#1601) 2017-03-28 09:22:27 -05:00
Sebastien Pouliot f4fccb09d7 [tvos][videotoolbox] Enable VideoToolbox.framework on tvOS (#1626)
This is just a build enablement to see xtro results. API adjustments,
including availability attributes, remains to be done.
2017-03-28 09:22:10 -05:00
Alex Soto f7b72669ec [PassKit] Update to iOS 10.3 beta 1 2017-03-28 09:16:49 -05:00
Sebastien Pouliot 2ee5201b84 [tests][monotouch] Generalize some tests to be independent of iOS version. Fixes #51801 (#1598)
The exact values are not what we need to test for and varies with
different OS versions - making tests fails for no good reason (i.e.
they are not canary used to detect changes)

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=51801
2017-03-28 09:16:08 -05:00
Alex Soto 4d9774eeb1 [CoreVideo] Update to iOS 10.3 beta 1 2017-03-28 09:13:31 -05:00
Vincent Dondain f3cd4a50d4 [opengles] Update to iOS 10.3 beta 1 (#1576) 2017-03-28 09:12:08 -05:00
Rolf Bjarne Kvinge 69e99dee6c [tests] Use the iPhone 6 simulator instead of the iPhone 5s simulator for 64-bit testing. (#1920)
Apparently Xcode 8.3 does not like the iPhone 5s simulator, and deletes it.

Every time Xcode is updated.

Which is slightly annoying when it affects the bots, since then iPhone 5s have
to be re-created on every bot.

So succumb to the pressure, and switch to using the iPhone 6 simulator instead.
2017-03-28 14:38:09 +02:00
Alex Soto 28ad23d142 [generator] Remove [Async] members from [Model] classes, fixes bug 53076.
https://bugzilla.xamarin.com/show_bug.cgi?id=53076

When [Async] was used on a member of a [Model][Protocol][Basetype]
interface the ModelClass ended up with additional FooAsync methods that
are not really part of the Model.

This commit removed any instances of FooAsync members from model classes
and also fixes any breaking changes in the currently bound classes.

Added test case using Model.

build diff:
https://gist.github.com/dalexsoto/75cb8424f2462bd6b513049f00bba6a8
2017-03-25 00:35:36 -06:00
Alex Soto 340ade8c68 [generator] Turn [Async] methods inside [Protocol] into extension methods
Partial fix for:
https://bugzilla.xamarin.com/show_bug.cgi?id=53076

We currently generate extension methods for optional members decorated
with [Async] inside a [Protocol] but we ignore the required methods
decorated with [Async]. This commit fixes this issue and we now
generate extension methods for required members.

Lets take the following API definition

```csharp
[Protocol]
interface MyFooProtocol {

	[Abstract]
	[Async]
	[Export ("requiredMethod:completion:")]
	void RequiredMethod (int arg1, Action<NSError> err);

	[Async]
	[Export ("optional:completion:")]
	void OptionalMethod (int arg1, Action<NSError> err);
}
```

This generates:

```csharp
public static partial class MyFooProtocol_Extensions {
	[CompilerGenerated]
	public unsafe static void OptionalMethod (this IMyFooProtocol This, int arg1, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<NSError> err)
	{
		if (err == null)
			throw new ArgumentNullException ("err");
		BlockLiteral *block_ptr_err;
		BlockLiteral block_err;
		block_err = new BlockLiteral ();
		block_ptr_err = &block_err;
		block_err.SetupBlock (Trampolines.SDActionArity1V0.Handler, err);

		global::ApiDefinition.Messaging.void_objc_msgSend_int_IntPtr (This.Handle, Selector.GetHandle ("optional:completion:"), arg1, (IntPtr) block_ptr_err);
		block_ptr_err->CleanupBlock ();

	}

	[CompilerGenerated]
	public unsafe static Task OptionalMethodAsync (this IMyFooProtocol This, int arg1)
	{
		var tcs = new TaskCompletionSource<bool> ();
		This.OptionalMethod(arg1, (obj_) => {
			if (obj_ != null)
				tcs.SetException (new NSErrorException(obj_));
			else
				tcs.SetResult (true);
		});
		return tcs.Task;
	}

	[CompilerGenerated]
	public unsafe static Task RequiredMethodAsync (this IMyFooProtocol This, int arg1)
	{
		var tcs = new TaskCompletionSource<bool> ();
		This.RequiredMethod(arg1, (obj_) => {
			if (obj_ != null)
				tcs.SetException (new NSErrorException(obj_));
			else
				tcs.SetResult (true);
		});
		return tcs.Task;
	}

}
```

Adds unit test

Build diff:
https://gist.github.com/dalexsoto/75290d1ffa1fdfb529cc30b9e66de5f2
2017-03-25 00:25:45 -06:00
Alex Soto 155e414e9c [generator] Disable CS0219 when using AsyncAttribute to avoid warning
Currently we get a CS2019 warning whenever we use AsyncAttribute
because we ignore the `result` variable on methods whose return
type is != `void` which is the expected behaviour.

This is specially more annoying on third party bindings,
the generated code did not disable this warning so you get
an "unfixable" warning on the generated code and the user
has no way to fix this on their own.

We now disable and restore CS2019 in the generated code as needed.
Nobody likes warnings that are not their fault.

Added unit test.

Build diff:

https://gist.github.com/dalexsoto/6f57d3f84b039b9fda863e2f8cfcf365
2017-03-24 21:08:40 -06:00
Alex Soto 577d0119df [generator] Remove Async members from internal BaseWrapper derived types
Currently we generate FooAsync members inside internal BaseWrapper
derived types used by protocol support. This generated Async members
are useles so we remove them to avoid extra metadata.

Old generated code

```csharp
internal sealed class MyFooDelegateWrapper : BaseWrapper, IMyFooDelegate {
	[Preserve (Conditional = true)]
	public MyFooDelegateWrapper (IntPtr handle, bool owns)
		: base (handle, owns)
	{
	}

	[Export ("stringMethod:completion:")]
	[CompilerGenerated]
	public unsafe void StringMethod (int arg1, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<NSError> err)
	{
		if (err == null)
			throw new ArgumentNullException ("err");
		BlockLiteral *block_ptr_err;
		BlockLiteral block_err;
		block_err = new BlockLiteral ();
		block_ptr_err = &block_err;
		block_err.SetupBlock (Trampolines.SDActionArity1V0.Handler, err);

		global::ApiDefinition.Messaging.void_objc_msgSend_int_IntPtr (this.Handle, Selector.GetHandle ("stringMethod:completion:"), arg1, (IntPtr) block_ptr_err);
		block_ptr_err->CleanupBlock ();

	}

	[CompilerGenerated]
	public unsafe Task StringMethodAsync (int arg1)
	{
		var tcs = new TaskCompletionSource<bool> ();
		StringMethod(arg1, (obj_) => {
			if (obj_ != null)
				tcs.SetException (new NSErrorException(obj_));
			else
				tcs.SetResult (true);
		});
		return tcs.Task;
	}

}
```

new generated code:

```csharp
internal sealed class MyFooDelegateWrapper : BaseWrapper, IMyFooDelegate {
	[Preserve (Conditional = true)]
	public MyFooDelegateWrapper (IntPtr handle, bool owns)
		: base (handle, owns)
	{
	}

	[Export ("stringMethod:completion:")]
	[CompilerGenerated]
	public unsafe void StringMethod (int arg1, [BlockProxy (typeof (ObjCRuntime.Trampolines.NIDActionArity1V0))]global::System.Action<NSError> err)
	{
		if (err == null)
			throw new ArgumentNullException ("err");
		BlockLiteral *block_ptr_err;
		BlockLiteral block_err;
		block_err = new BlockLiteral ();
		block_ptr_err = &block_err;
		block_err.SetupBlock (Trampolines.SDActionArity1V0.Handler, err);

		global::ApiDefinition.Messaging.void_objc_msgSend_int_IntPtr (this.Handle, Selector.GetHandle ("stringMethod:completion:"), arg1, (IntPtr) block_ptr_err);
		block_ptr_err->CleanupBlock ();

	}
}
```

Added unit test.

build diff for this change:

https://gist.github.com/dalexsoto/eeaefc9d86e37b0c5ce5fe6d5d091383
2017-03-24 17:40:55 -06:00
Alex Soto 7bc52a12bd [test][introspection] Remove check for void return type on AsyncCandidates test (#1909)
We do support the use of [Async] on methods that do not return void,
we generate an overload with am out parameter to retrieve the returned value

```csharp
[CompilerGenerated]
public unsafe virtual Task BarStringAsync (int arg1)
{
	var tcs = new TaskCompletionSource<bool> ();
	var result = BarString(arg1, (obj_) => {
		if (obj_ != null)
			tcs.SetException (new NSErrorException(obj_));
		else
			tcs.SetResult (true);
	});
	return tcs.Task;
}

[CompilerGenerated]
public unsafe virtual Task BarStringAsync (int arg1, out string result)
{
	var tcs = new TaskCompletionSource<bool> ();
	result = BarString(arg1, (obj_) => {
		if (obj_ != null)
			tcs.SetException (new NSErrorException(obj_));
		else
			tcs.SetResult (true);
	});
	return tcs.Task;
}
```

Modified the introspection test to repor this, updated documentation
and update API definitions reported by introspection.
2017-03-24 11:02:07 -06:00
Rolf Bjarne Kvinge 563f395cac Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-23 15:33:38 +01:00
Rolf Bjarne Kvinge a6b9c28975 [monotouch-test] Fix randomly crashing SystemSoundTest.FromFile to not get a callback after the sound was disposed. Fixes #52903. (#1893)
SystemSoundTest.FromFile was requesting to be called back when the sound
completed playback. This causes problems when the sound is disposed after it
has started playing, because in that case disposing it won't prevent the
callback from being called, but instead random InvalidCastExceptions / crashes
would occur.

https://bugzilla.xamarin.com/show_bug.cgi?id=52903

* SystemSound.PlaySystemSound doesn't work in the simulator.

https://stackoverflow.com/a/24973240/183422
2017-03-22 16:55:55 -05:00
Rolf Bjarne Kvinge d942fcff14 [tests][generator] Simplify mac tests a bit and fix new tests when using IKVM-based bgen.
Simplify mac tests by using different variables for the various flavors of mac
generators, and use these new flavors so that all tests pass when using the
IKVM-based bgen.
2017-03-22 16:22:33 +01:00
Rolf Bjarne Kvinge 8a29f0deae Merge remote-tracking branch 'origin/master' into generator-ikvm 2017-03-22 14:11:00 +01:00
Alex Soto ebcb4ac034 [generator] Fix bug 52573 - Add nowarn and warnaserror to btouch/bmac (#1882)
https://bugzilla.xamarin.com/show_bug.cgi?id=52573

* Added nowarn and warnaserror to btouch/bmac
* Throw a BI0026 if bad args and added error to doc
* Added generator tests
2017-03-22 07:52:24 -05:00
Alex Soto c04b8465d9 [test][fsharp] Add F# test for bug 52866 (#1892)
https://bugzilla.xamarin.com/show_bug.cgi?id=52866
2017-03-22 07:47:57 -05:00
Alex Soto 818c20b19a [generator] The [Advice] attribute doesn't make it to the generated code. Fixes #42742 (#1887)
* [generator] Fix bug 42742 The advice attribute doesn't make it to the generated code

https://bugzilla.xamarin.com/show_bug.cgi?id=42742

The Advice attribute used in our bindings was not making
into the generated code. This fixes it.

Also added unit test for it

* [generator] Merged PrintFooAttributes into one

Merged PrintPlatformAttributes, PrintPreserveAttribute and
PrintAdviceAttribute into a single method PrintAttributes.
This is due to sometimes we call three times in a row the same method:

```csharp
PrintPlatformAttributes (pi.GetGetMethod ());
PrintPreserveAttribute (pi.GetGetMethod ());
PrintAdviceAttribute (pi.GetGetMethod ());
```

We now do

```csharp
PrintAttributes (pi, platform:true, preserve:true, advice:true);
```

Also removed a not used instance (internal field) of AdviceAttribute
2017-03-21 09:20:05 -06:00
Timothy Risi 35ff3ed182 [macos][test][xammac_tests]Automate some of the previously manual mac tests (#1715) 2017-03-17 16:28:16 -08:00
Timothy Risi f17c63ef16 [macos] Allow passing null to CGLContext.CurrentContext. Fixes #53273 2017-03-16 11:34:53 -08:00
Rolf Bjarne Kvinge 001790ff4e Merge remote-tracking branch 'origin/master' into generator-ikvm 2017-03-16 19:09:33 +01:00
Rolf Bjarne Kvinge 2380389278 [Darwin] Fix kqueue/kevent bindings to actually work. (#1871)
* [Darwin] Fix kqueue/kevent bindings to actually work.

Fix kqueue/kevent bindings to actually work. The P/Invoke signatures were
badly broken (missing an argument), so there's no way this could ever have
worked.

Additionally obsoletes kevent signatures that return bool (they're ignoring
vital information: how many events were actually returned from kevent), and
add overloads that do the right thing.

* [Darwin] Improve input validation and add more tests.
2017-03-15 07:50:05 +01:00
Alex Soto 78052430ab [generator] Fixes bug 52570 - [generator] warn when [Static] is used in a [Category] (#1862)
https://bugzilla.xamarin.com/show_bug.cgi?id=52570

In some cases you will find **static** members inside categories like in the following example:

```objc
@interface FooObject (MyFooObjectExtension)
+ (BOOL)boolMethod:(NSRange *)range;
@end
```

This will lead to an **incorrect** Category C# interface definition:

```csharp
[Category]
[BaseType (typeof (FooObject))]
interface FooObject_Extensions {

	// Incorrect Interface definition
	[Static]
	[Export ("boolMethod:")]
	bool BoolMethod (NSRange range);
}
```

This is incorrect because in order to use the `BoolMethod` extension you need an instance of `FooObject` but you are binding an ObjC **static** extension, this is a side effect due to the fact of how C# extension methods are implemented.

The only way to use the above definitions is by the following ugly code:

```csharp
(null as FooObject).BoolMethod (range);
```

The recommendation to avoid this is to inline the `BoolMethod` definition inside the `FooObject` interface definition itself, this will allow you to call this extension like it is intended `FooObject.BoolMethod (range)`.

```csharp
[BaseType (typeof (NSObject))]
interface FooObject {

	[Static]
	[Export ("boolMethod:")]
	bool BoolMethod (NSRange range);
}
```

We will issue a warning (BI1117) whenever we find a `[Static]` member inside a `[Category]` definition. If you really want to have `[Static]` members inside your `[Category]` definitions you can silence the warning by using `[Category (allowStaticMembers: true)]` or by decorating either your member or `[Category]` interface definition with `[Internal]`.
2017-03-14 13:03:13 -06:00
Rolf Bjarne Kvinge 65ad42cce0 Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-14 19:25:11 +01:00
Rolf Bjarne Kvinge b41307bb7f Merge commit '2272efbb189d457dc6c599cefd875425baad92a5' into framework-sdk 2017-03-14 19:24:07 +01:00
Rolf Bjarne Kvinge a719e1f480 Merge remote-tracking branch 'origin/master' into generator-ikvm 2017-03-14 17:59:45 +01:00
Chris Hamons abf0f4a2d9 [XM] Improve XM msbuild support and add roslyn netstandard test case (#1846)
- Significant changes to target file under msbuild, ImplicitFacade processing in particular
- Tests are disabled due to https://bugzilla.xamarin.com/show_bug.cgi?id=53164 where we can't tests local target files only global
- Requires a mono msbuild with 95ab657a90 for tests to pass
- Until then, this is a workaround:
    sudo cp /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/Roslyn/System.Reflection.Metadata.dll /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/
2017-03-14 11:08:04 -05:00
Marek Safar 2272efbb18 [tests] Fixes linker test project release configuration to use csc optimization (#1847) 2017-03-13 08:54:19 -05:00
Alex Soto 0ada7dedce [generator] Fixes bug 42855 generator should report an error for [Protocol] without a [Model] that specify a [BaseType] (#1859)
https://bugzilla.xamarin.com/show_bug.cgi?id=42855

We had some logic to catch this but we did not do anything with it.
We now error out with BI1060 whenever we find [Model] but no [BaseType]
added test case.

I am using BI1060 because Rolf reserved today the missing ones in PR
https://github.com/xamarin/xamarin-macios/pull/1849
2017-03-10 09:52:32 -06:00
Rolf Bjarne Kvinge 1d5f432d4f [tests][generator] Add support for running tests with the IKVM-based generator. 2017-03-09 12:47:57 +01:00