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

2390 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot a7b517351c [foundation] Make sure NSUrlSessionConfiguration.TLSMinimumSupportedProtocol is set (#1890)
During the investigation for a System.Configuration race in bug #53461 [1]
it was found that we did not pass the computed value for
`TLSMinimumSupportedProtocol` based on `ServicePointManager.SecurityProtocols`
to the `NSUrlSession`, in effect allowing what the OS does, by default,
and not what the application requested.

This replace an earlier attempt to fix the race in PR #1889

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=53461
[2] https://github.com/xamarin/xamarin-macios/pull/1889
2017-03-22 07:58:27 -05: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 1f81d9d13f [mmp] Add mmp support for AOT options in XS (#1818) 2017-03-17 09:55:43 -08:00
Jeffrey Stedfast 061e8ba6fe [Versions-ios.plist.in] added sgen-concurrent-gc (#1873)
* [Versions-ios.plist.in] added sgen-concurrent-gc

Partial fix for bug #53316

* Added sgen-concurrent-gc key for Mac as well

* Added other feature keys supported by Xamarin.Mac

* [Versions-mac.plist.in] Drop "activation" as a Feature

* [Versions-*.plist.in] Synced up and renamed modern-http-client
2017-03-17 11:54:27 -04:00
Sebastien Pouliot e884b914d9 [mono] Bump to head of mono-4.8.0-branch (#1885) 2017-03-16 23:34:59 -04:00
Sebastien Pouliot 88d2045014 [mtouch][mmp] Clarify that -sgen-conc is currently experimental (#1881)
Clarification to match discussion in trello [1]. Another PR [2] is
handling XS UI.

references:
[1] https://trello.com/c/FbbxRyCG/2772-qa-xi-xm-mac-and-ios-samples-with-concurrent-gc-enabled#comment-58c9d05510a888ccd219639f
[2] https://github.com/xamarin/md-addins/pull/1578
2017-03-16 18:14:42 -04:00
Timothy Risi 7cf9a64656 [mmp] Correctly handle/report unexpected exception during execution
- Add extra logging in StaticRegistrar to help track down exceptions during generation
2017-03-16 12:21:45 -08:00
Timothy Risi f17c63ef16 [macos] Allow passing null to CGLContext.CurrentContext. Fixes #53273 2017-03-16 11:34:53 -08:00
Jeffrey Stedfast 8b376efa4b [msbuild] Use stamp files to force container app's _CompileToNative (#1878)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53303
2017-03-16 15:32:04 -04: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 7c8007e4f2 [docs] Add a document for generator error messages. (#1877)
This is the first step for documenting the error messages in the generator:
create a document for the error messages.

The entries in the document are the same as the ones listed in the error.cs
file (which I've now removed to prevent duplication), with some very minor
editing.

The document is not yet published to the documentation repository (since this
is just the first step).
2017-03-16 07:38:56 +01:00
Vlad Brezae af02f7b31a Make sure we pass gc options if using concurrent sgen (#1867)
When using debug simulator we don't generate main.m so we were not passing the gc options.

The MONO_GC_PARAMS variable is not in app.EnvironmentVariables (which only contains environment variables passed to mtouch using --setenv), which is why the above condition does not trigger.
2017-03-15 16:59:08 -04:00
Rolf Bjarne Kvinge f27ad3d413 [mtouch] Fix bundling frameworks in WatchKit 1 extensions.
No frameworks should be bundled in WatchKit 1 extensions, they should be
bundled in the container (iOS) app.

This broke when merging the equivalent fix for master into the framework-sdk
branch (i.e. a broken merge).
2017-03-15 18:34:32 +01:00
Alex Soto ba3413ce4d [Contacts] Better API for CNContainer_PredicatesExtension and CNGroup_PredicatesExtension categories. Fixes #52571 (#1874)
* [Contacts] Fix bug 52571 - Missing API due to binding error

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

Unfortunately [Static] methods inside [Category] lead to bad code
I have exposed alternative methods that call the static extensions
and when XAMCORE_4_0 is a thing they will get inlined in their
respective class
2017-03-15 09:59:27 -06:00
Sebastien Pouliot 7f6f2bf81d [uikit] Fix contest between UITextField.Ended[WithReason] events. Fixes #53174 (#1875)
iOS 10 added a new `textFieldDidEndEditing:reason:` to `UITextField`. It
gets called, if set, before the older `textFieldDidEndEditing`.

This cause a problem for code that does add events for both since the
internal `*Delegate` does override both (to allow events) so the call
might be "lost" without additional logic.

This fix makes sure that even using one (or the two) events will work
across all versions of iOS.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=53174
2017-03-15 07:44:01 -05: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 d96c2bc4a3 Add two missing Paragraph related NSString methods (#1866) 2017-03-14 11:08:45 -05: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
Jeffrey Stedfast af51e23ec7 [mlaunch] Added feature keys to Versions-ios.plist.in (#1865)
Partial fix for https://bugzilla.xamarin.com/show_bug.cgi?id=53279
2017-03-14 07:20:25 +01:00
Rolf Bjarne Kvinge aaee3a93d7 [generator] Use Array.Empty<T> to avoid allocating many empty arrays. 2017-03-14 07:18:47 +01:00
Rolf Bjarne Kvinge ff9bae7bbc [mtouch] Don't put frameworks in WatchKit 1 extensions. Fixes #53232. (#1864)
The frameworks go into the container app's Frameworks directory.

https://bugzilla.xamarin.com/show_bug.cgi?id=53232
2017-03-13 17:34:27 -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
Jeffrey Stedfast 15a97c7f2d [msbuild] Fixed PathUtils.AbsoluteToRelative() logic (#1861)
* [msbuild] Fixed PathUtils.AbsoluteToRelative() logic

Don't require the 'absolute' path argument to be a FullPath.

The code already calls Path.GetFullPath() on the 'absolute'
path anyway.

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

* Fixed ResolveSymbolicLinks() to return the input path if realpath() fails
2017-03-12 14:51:28 -04: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
Emanuel 982f71da11 [msbuild] Ensure the MainAssembly path is absolute (#1857)
Fixes bug #52758 (https://bugzilla.xamarin.com/show_bug.cgi?id=52758)

For appex the MainAssembly path should be absolute, since mtouch will generate a build-arguments.txt file that then will be used to build the extension in the same mtouch process than the container app. Due to this, if the path stored is relative mtouch won't be able to find the assembly.
2017-03-10 12:41:27 +01:00
Rolf Bjarne Kvinge 3eadab7baf Bump mono to get fix for bug #52846. (#1851)
https://bugzilla.xamarin.com/show_bug.cgi?id=52846
2017-03-09 18:37:05 +01:00
Rolf Bjarne Kvinge 9dc3a0b615 [generator] Flip the switch. 2017-03-09 12:48:17 +01:00
Rolf Bjarne Kvinge 7837d5d4e0 Bump maccore to get fix for IKVM-based generator. 2017-03-09 12:48:17 +01:00
Rolf Bjarne Kvinge 449bcd32db [msbuild] Add support for IKVM-based generator. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge b7794b0eb7 [builds] Don't install mono binaries for the generator if we're using the IKVM-based generator. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 119ae2286f Add a section about the generator to the README, and document some code. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 5dc2a52d0b [generator] We don't need to redirect System.Console when using IKVM, since we're always using the system corlib. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 5caa0e4884 [generator] Implement IKVM support. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 93569ecd5a [generator] Add IKVM usings pointing to IKVM types instead of reflection types. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 4582a2cd01 [generator] Remove logic from the attribute assemblies. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 9be1d2d172 [generator] Remove unused usings. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 7dcadeb8ca [generator] Pass the expected assemblies to TypeManager. 2017-03-09 12:47:57 +01: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
Rolf Bjarne Kvinge fe9bcb0dbd [generator] Build an assembly containing the binding attributes for each platform. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 3b555164c3 [generator] Build an IKVM-based generator (bgen.exe). 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 51bb3bdec1 [generator] Add a project file for the IKVM-based generator. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge 0215993ba5 [generator] Add Makefile logic to build an IKVM-version of the generator. 2017-03-09 12:47:57 +01:00
Rolf Bjarne Kvinge ea1d8cc861 [tests] Fix mlaunch path, it's no longer shipped with Xamarin Studio. (#1842) 2017-03-08 20:01:10 +01:00