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

2607 Коммитов

Автор SHA1 Сообщение Дата
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 3fbaef107c [WebKit] Update to iOS 10.3 beta 1 2017-03-28 09:14:32 -05:00
Alex Soto 19872ff117 [WatchKit] Update to iOS 10.3 beta 1
Unfortunately adding the setter to CurrentTime property is a breaking
change so added a XAMCORE_4_0 check
2017-03-28 09:14:21 -05:00
Alex Soto 66b6bae037 [LocalAuthentication] Update to iOS 10.3 beta 1 2017-03-28 09:14:10 -05:00
Alex Soto 4d9774eeb1 [CoreVideo] Update to iOS 10.3 beta 1 2017-03-28 09:13:31 -05:00
Vincent Dondain 0e8521c9da [homekit] Update to iOS 10.3 beta 1 (#1584) 2017-03-28 09:13:15 -05:00
Alex Soto 8cfc8cdbf6 [iAd] Update to iOS 10.3 beta 1 2017-03-28 09:12:58 -05:00
Alex Soto 9cca3c9e7c [Contacts] Update to iOS 10.3 beta 1 2017-03-28 09:12:44 -05:00
Alex Soto e24788d46a [StoreKit] Update to iOS 10.3 beta 1 2017-03-28 09:12:33 -05:00
Vincent Dondain f3cd4a50d4 [opengles] Update to iOS 10.3 beta 1 (#1576) 2017-03-28 09:12:08 -05:00
Vincent Dondain 01039c8679 [foundation] Update to iOS 10.3 beta 1 (#1562) 2017-03-28 09:09:07 -05:00
Vincent Dondain 294f8185af [cfnetwork] Update for iOS 10.3 beta 1 (#1561) 2017-03-28 09:09:01 -05:00
Vincent Dondain 1bef4bbbd3 [callkit] Update to iOS 10.3 beta 1 (#1560) 2017-03-28 09:08:38 -05:00
Vincent Dondain 82fd0ea4c8 [Photos] Update to iOS 10.3 beta 1 2017-03-28 09:08:24 -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
Marek Safar decec3ee6e Bump mono 2017-03-28 11:18:03 +02:00
Rolf Bjarne Kvinge 8415874826 Bump system mono to get fix for #53481.
https://bugzilla.xamarin.com/show_bug.cgi?id=53481
2017-03-28 08:28:15 +02:00
Marek Safar d53bbd6b09 Bump mono 2017-03-27 23:49:13 +02:00
Alex Soto 57cfbb25c7 Merge pull request #1913 from dalexsoto/noasyncinternal
[generator] Fix and enhance [Async] attribute on [Protocol] definitions. Fixes bug 53076
2017-03-27 11:13:58 -06:00
Rolf Bjarne Kvinge 3b30fc2191 Bump maccore to get fix for bug #40287. (#1914)
https://bugzilla.xamarin.com/show_bug.cgi?id=40287
2017-03-27 15:22:52 +02:00
Alex Soto 0f76f0a873 [generator] Avoid CS0219 when using [Async] by removing unused var
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 remove the unused `result` varibale to avoid the warning.
Nobody likes warnings that are not their fault.

build diff:
https://gist.github.com/dalexsoto/313f913c394d8eb46f95200524eae2e2
2017-03-27 01:27:54 -06:00
Sebastien Pouliot 3d4595750f Bump mono to include fix for bug #53481 2017-03-26 09:33:46 -05:00
Vincent Dondain 2302931ceb [doc] Add XIA0004 Missing64BitSupportRule to xamarin-ios-analysis (#1912)
- Also update reference to maccore with the xamarin-analysis bump that includes XIA0004.
2017-03-25 13:02:54 -04: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
Rolf Bjarne Kvinge 34f6ec90c0 [src] Fix a makefile dependency for generated mac code. (#1910)
Fix a makefile dependency for generated mac code to make sure the attribute
assemblies are built before we try to generate the binding code.
2017-03-24 18:45:04 +01:00
Rolf Bjarne Kvinge 26aa29ebd0 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-24 18:09:24 +01: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 9f0fd32330 Merge pull request #1680 from rolfbjarne/framework-sdk
Implement support for sharing code between apps and extensions
2017-03-24 17:52:25 +01:00
Rolf Bjarne Kvinge 7411c033fb Merge remote-tracking branch 'origin/master' into framework-sdk 2017-03-24 14:44:54 +01:00
Rolf Bjarne Kvinge d48d0452e5 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-24 13:56:03 +01:00
Rolf Bjarne Kvinge b982503052 Bump max mono version to the d15.2 mono. (#1907) 2017-03-24 13:55:09 +01:00
Rolf Bjarne Kvinge 1dc8c86e5b Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-24 13:54:07 +01:00
Jeffrey Stedfast aaa401f78b bump Xamarin.MacDev to point to latest HEAD (#1905) 2017-03-24 12:52:48 +01:00
Rolf Bjarne Kvinge 6bdef66f37 Fix a few compiler warnings. (#1897)
Fixes these compiler warnings:

	Foundation/ExportAttribute.cs(96,10): warning CS0618: `XamCore.Foundation.ExportAttribute.ExportAttribute()' is obsolete: `Every exported selector must include a name'
	Foundation/ExportAttribute.cs(102,10): warning CS0618: `XamCore.Foundation.ExportAttribute.ExportAttribute()' is obsolete: `Every exported selector must include a name'
2017-03-24 12:40:57 +01:00
Matt Sylvia acb9b93e39 [d15-2 prep] bump macdev maccore 2017-03-24 00:14:06 -04:00
Marek Safar 105ee26509 Merge remote-tracking branch 'origin/master' into mono-2017-02 2017-03-23 23:13:43 +01:00
Marek Safar 2125275acf Mono bump 2017-03-23 23:07:11 +01:00
Manuel de la Pena df29ecfff2 [Foundation] Ensure that if a request is canceled we cancel the NSUrlSessionTask (#1900)
If the request is canceled, the inflight data is cleaned up. That allows
us to know that the NSUrlSessionTask should be canceled, which will
execute the DidCompleteWithError that will take care of the cleanup of
resources and will ensure that everything is back to a known situation.

* Do check for managed cancelations in the GetInflightData so that it is check in all handlers.
2017-03-23 16:42:04 -05:00
Jeffrey Stedfast 1a2cdbf26d [msbuild] Implemented GetFiles and GetFullPath tasks to fix the vs build (#1895)
* [msbuild] Implemented GetFiles and GetFullPath tasks to fix the vs build

Hopefully fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53410

* [msbuild] Added GetDirectories task and fixed GetFiles to handle Path not existing
2017-03-23 15:54:46 -04:00
Marek Safar 0a11320a7f Update linker tests after appletls merge 2017-03-23 19:14:01 +01:00
Alex Soto 272a5ef53e [generator] Turn BI1060 into a warning instead of an error (#1896)
0ada7dedce (commitcomment-21338196)

We wanted this to be an error first[0] but this could lead
to break our user's code just by updating so making it a warning

[0]: https://bugzilla.xamarin.com/show_bug.cgi?id=42855
2017-03-23 08:34:01 -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 411bf55cd1 [generator] Generate generator-ikvm.csproj automatically. (#1898) 2017-03-23 14:25:37 +01:00
Rolf Bjarne Kvinge cdf845425e [generator] Bump .NET version for the generator's project file. (#1899)
Array.Empty<T> did not exist in earlier versions of .NET, so this would build
fine on the command-line (which builds using the system's latest .NET
version), but not with the project file (which apparently defaults to .NET 4.5
unless otherwise specified).

So bump the .NET version in the project file so that compilation works the
same in both cases.
2017-03-23 14:24:23 +01:00
Marek Safar a11f70dfe8 Remove TlsProviderFactoryCallback 2017-03-23 11:32:58 +01:00
Marek Safar d8667414c2 Bump mono 2017-03-23 00:11:44 +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