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

2100 Коммитов

Автор SHA1 Сообщение Дата
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 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
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
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 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 ea1d8cc861 [tests] Fix mlaunch path, it's no longer shipped with Xamarin Studio. (#1842) 2017-03-08 20:01:10 +01:00
Rolf Bjarne Kvinge 24dacc6d02 [runtime] Don't look in shared memory for debug data in normal apps (#1841)
* Bump maccore to get fix for launching the simulator for app extensions.

* [runtime] Don't look in shared memory for debug data in normal apps.

Don't look in shared memory for debug data in normal apps, because it
interferes when debugging extensions from the same solution as a container
app:

Example, for a keyboard extension:

1. Run extension in XS.
2. Manually launch the extension's container app (which contains a textbox
   that can be used to launch the keyboard).
3. The container app reads the debug data in shared memory which was intented
   for the extension, and takes over the debugger.
4. Launch keyboard, which will not be able to connect to the IDE because the
   container app already connected to the IDE.
2017-03-08 20:00:58 +01:00
Jeffrey Stedfast 15fa18eda3 [msbuild] Added logging for all of the overridden MSBuild default tasks (#1829) 2017-03-07 17:40:26 -05:00
Jeffrey Stedfast bfa5a9da56 [msbuild] ALWAYS log ibtool/actool exitCode != 0 as an error (#1840)
Log this as an error even if the log file does not exist and/or
is parseable.

Previously, it was possible that if the log file didn't exist
or it was perfectly validly formatted, we would never log that
error code and so it's possible that we wouldn't log *any*
error at all (e.g. empty log file).
2017-03-07 17:38:25 -05:00
Vincent Dondain 87955d1d6f [msbuild] Fix metal targets for Xcode8 (#1838)
Fixes bug #52982: [iOS]Metal samples fail to build with Xcode8.3
(https://bugzilla.xamarin.com/show_bug.cgi?id=52982)

Basically with Xcode8 Apple stopped using an intermediary step to generate the
default.metallib. This was what our `_ForgeMetal` target was doing, generate a `default.metal-ar`
file which was used as input for `_TemperMetal` and then generate the default.metallib.

Instead with Xcode8 you can just give Shaders.air directly to the metallib tool.

The fix in this commit is made in such a way that it still supports Xcode7.

if !Xcode8 then don't change anything.
if Xcode8+ then have `_ForgedMetal` output equal `@(_SmeltedMetal)` (basically skip the _ForgeMetal target).
2017-03-07 15:30:31 -05:00
Rolf Bjarne Kvinge 77fca2393d [msbuild] Fix error when building Xamarin.Mac binding projects. (#1834)
Xamarin.Mac binding projects would show this error:

> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.ObjcBinding.CSharp.targets: error : Unknown target framework identifier: Xamarin.Mac.

while at the same time not actually failing the build (so nothing broke,
making it harder to notice).

The error is printed in BTouchTaskBase, which was previously only used for
Xamarin.iOS. Now we're using it for both Xamarin.iOS and Xamarin.Mac (in which
case it's subclassed), so make sure to not validate the
TargetFrameworkIdentifier according to only valid TargetFrameworkIdentifiers
for Xamarin.iOS.

This is accomplished by adding a new virtual overload to validate (and get the
right /target-framework argument for the generator), and override that method
in Xamarin.Mac's BTouch subclass.
2017-03-07 19:57:54 +01:00
Rolf Bjarne Kvinge 28d2216afb Bump maccore to get partial fix for bug #52710. (#1835)
* Bump maccore to get partial fix for bug #52710.

Bump maccore to get partial fix for bug #52710 (can't launch/debug today
extensions more than once).

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

* Bump maccore to make the (partial) fix for #52710 work on device as well.
2017-03-07 19:57:33 +01:00
Sebastien Pouliot bbde20c697 [uikit] Mark NSFileProviderExtension as [ThreadSafe]. Fixes #53075 (#1836)
Even if it's in UIKit, this is not a UI type and does not _suffer_ from
the UI thread restriction. In fact it's used with file coordination which
implies threading is required.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=53075
2017-03-07 19:56:55 +01:00
Sebastien Pouliot 829a71dbbc Add some missing *Async version for existing API (#1527)
Taken out of our Xcode8 post-mortem: it's easy to forget (while adding)
or miss (while auditing) a `[Async]` attribute on the API that would
benefit from them.

API that are decorated with either:
* [Obsolete] (managed); or
* [Obsoleted] or [Deprecated] (native)
are not to be added *Async methods (or at least be reported as missing)

This also includes updated introspection tests that found the missing *Async API., ensuring that future API addition will immediately notice is an `[Async]` sounds useful.
2017-03-07 13:55:37 -05:00
Rolf Bjarne Kvinge 9581bbb0f6 Bump Xamarin Studio to get fix for bug #52648. (#1833)
Bump Xamarin Studio to get fix for bug #52648 causing build failures.
2017-03-07 14:13:58 +01:00
Sebastien Pouliot 315fbdc295 [mapkit] Add MKLocalSearchRequest initWithCompletion: in unified. Fixes #53083 (#1832)
It was left out by mistake when added (to classic only). Since then macOS
also added support for the API.

references
bugzilla: https://bugzilla.xamarin.com/show_bug.cgi?id=53083
xtro: common.unclassified:!missing-selector! MKLocalSearchRequest::initWithCompletion: not bound
2017-03-07 07:41:30 +01:00
Jeffrey Stedfast f205a8cfe6 [msbuild] Run the _ComputeTargetArchitectures target before cleaning (#1828)
Some of the Clean steps need the _ComputeTargetArchitectures
target to run before they can properly do their thing because
they depend on DeviceSpecific paths.

Also added logic to rm -rf extension *.dSYM and framework *.dSYM
dirs in the container app bin dir (which fails on xbuild due to
a bug in xbuild... yay!)

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=53007
2017-03-07 07:15:14 +01:00
Sebastien Pouliot 42ac681c27 [mono] Bump to fix "Could not AOT the assembly error". Fixes #53066. (#1831)
commit 5aba8a05f147ab1d12414c8f072657531b1c97f1
Author: Zoltan Varga <vargaz@gmail.com>
Date:   Mon Mar 6 02:31:49 2017 -0500

    [jit] Fix an assert in mono_unwind_ops_encode_full () caused by an off-by-one error. Fixes #53066.
2017-03-06 21:48:44 -05:00
Rolf Bjarne Kvinge 4f7df26a98 [generator] Remove the non-generic API in AttributeManager in favor of the generic versions. (#1824)
The generic versions result in nicer code, and it's also less logic to port to IKVM.

Generator diff: https://gist.github.com/rolfbjarne/c70664b59c915040ed7cf95dba68c1d6 (no related changes)
2017-03-06 14:28:43 +01:00
Rolf Bjarne Kvinge a1c2ab8ea7 [generator] Xamarin.Mac/Classic needs a reference to System.Drawing.dll unless one is specified. (#1825) 2017-03-06 14:28:35 +01:00
Sebastien Pouliot 68946f5b74 [generator] Fix native enum in native delegates return types. Fixes #53058 (#1823)
A `[Native]` enum is either 32 bits or 64 bits depending on the CPU,
i.e. it's a `NS[U]Integer`. However the managed representation is
*always* 64 bits, a `long` enum, which means it cannot be used
directly (without a cast) when declaring code that match native.

This also enable us to remove the hack from PR1751 to ignore some
generated trampoline code.

reference:
* https://bugzilla.xamarin.com/show_bug.cgi?id=53058
* generated code diff: https://gist.github.com/spouliot/f6196aa892a7a33257fe2cf421fffc2e
2017-03-06 08:17:50 +01:00
Sebastien Pouliot 679af70feb [tests][intro] Add validation for methods decorated with [MonoPInvokeCallback] (#1751)
Presently we're looking if enums decorated with [Native] are used, just
like we do for p/invokes and delegate types decorated with a
[MonoNativeFunctionWrapper] attribute.

Testing properly required to add a property to MonoPInvokeCallbackAttribute
so we can get back the type given as it's argument.

* Also check for generics in delegates, ref: #42699

* Ignore failures filed as https://bugzilla.xamarin.com/show_bug.cgi?id=53058
2017-03-04 19:40:35 -05:00
Alex Soto b52d067558 [runtime] Fix bug 52308 Console.WriteLine text is not showing in Device Log. (#1821)
https://bugzilla.xamarin.com/show_bug.cgi?id=52308

Apple moved to os_log[1] in iOS 10 / macOS 10.12 / tvOS 10 / watchOS 3.0
whenever you call NSLog we used to rely on NSLog parsing "%S" but
it seems broken. We now just create a NSString from the unicode str
and give that to NSLog when not in watch (NSLog in watch is broken yay).

[1]: https://developer.apple.com/reference/os/logging?language=objc
2017-03-03 14:19:23 -06:00
Sebastien Pouliot 984d4e2ab6 [generator] Allow basic support of nullable inside our trampolines. Fixes #42699 (#1820)
We cannot use generics in native signatures but, with some care (and
generator work), we can still expose nullable on our public delegate API.

AUImplementorStringFromValueCallback is presently the only case of such
an API.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=42699
2017-03-03 14:01:33 -05:00
Sebastien Pouliot bedfdd4ec1 [coregraphics] Add CGRect.Null and Infinite properties. Fixes #43628 (#1819)
Apple has both an Empty and Null constants. Our implementation is largely
done in managed code and, for historical reasons [1], match System.Drawing
behaviour. Still the constant is useful for other (e.g. 3rd party) APIs.

Also add CFRect.Infinite for the missing CGRectInfinite symbol.

[1] In the original classic we only provided RectangleF not CGRect

references:
* https://bugzilla.xamarin.com/show_bug.cgi?id=43628
* xtro
	common.unclassified:!missing-field! CGRectNull not bound
	common.unclassified:!missing-field! CGRectInfinite not bound
2017-03-03 09:04:32 -05:00
Rolf Bjarne Kvinge c997b773c5 [generator] Don't ask for inherited attributes. (#1815)
IKVM doesn't have API that supports looking for inherited attributes (we'd
have to implement the logic ourselves if we needed it), so I decided to check
if we really need to fetch inherited attributes.

Turns out we don't: removing all lookup for inherited attributes does not
change the generated output, nor does it fail any of our tests.

A few more reasons I think this is fairly safe:

* For events and properties, the `inherits` flag is ignored according to MSDN,
  so removing it does not change anything at all.
* Fields can't be inherited (they're not virtual), so asking for inherited
  attributes doesn't even make sense.
* Our binding syntax generally does not use inheritance (a base type is
  expressed by putting the `[BaseType]` attribute on the binding interface,
  not making the binding interface actually inherit from its alleged base
  type).
* Even when the syntax does use inheritance (to inline protocols), the inlined
  protocols do not use inheritence themselves, so none of the members in the
  inlined protocols will override base class member (since there is no base
  class).

Generator diff: https://gist.github.com/rolfbjarne/6a767517a9db76e415827039885c6b09 (all changes are unrelated)
2017-03-03 07:28:31 +01:00
Jeffrey Stedfast dd834eeeb0 [msbuild] Make sure to codesign appex dylibs (#1812)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52745

Added a new CodesignNativeLibraries task that scans for
and then codesigns each *.dylib and *.metallib in the
app bundle (minus those in the PlugIns and Watch dirs).
2017-03-02 13:25:06 -05:00
Rolf Bjarne Kvinge 73cc729fa0 Bump maccore to get a potential fix for #52968. (#1814)
Bump maccore to get a potential fix for #52968 (random timeouts when launching
watchOS apps on Wrench).

https://bugzilla.xamarin.com/show_bug.cgi?id=52968
2017-03-02 14:59:52 +01:00
Rolf Bjarne Kvinge a10349e5be [generator] Don't cast the return value from AttributeManager.GetCustomAttributes. (#1813)
The IKVM version won't return an array of the exact attribute type, so casting doesn't work.

Use the generic version instead, which returns an array of the right type
directly, and works with both IKVM and Reflection.

Generator diff: https://gist.github.com/rolfbjarne/06c3ff20dc90631d345aeebd54790018 (all changes unrelated)
2017-03-02 14:59:42 +01:00
Rolf Bjarne Kvinge 5353607f53 [generator] Don't define 'GENERATOR', since IKVM sources use the same name (for something else). (#1811)
Generator diff: https://gist.github.com/rolfbjarne/fa9d91f13a6421135e089bed8e1ccefe
2017-03-02 07:13:10 +01:00
Rolf Bjarne Kvinge ae7fc187b0 Bump maccore to get improved mlaunch logging. (#1808)
Bump maccore to get improved logging to track down random launch failures for watchOS apps on wrench.
2017-03-01 16:40:31 +01:00
Jeffrey Stedfast 5ba38492d5 [msbuild] sanity check TargetiOSDevice property for conflicts (#1799)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=52847

If the device archs do not match the configuration, don't
do a device-specific build.
2017-03-01 10:22:41 -05:00
Jeffrey Stedfast 1b2d24ed2c [msbuild] Remove an unused enum that causes confusion (#1798) 2017-03-01 10:21:52 -05:00
Rolf Bjarne Kvinge 0708ce5348 [generator] Add a TypeManager.GetUnderlyingNullableType to abstract away ikvm and reflection differences. (#1801)
Generator diff: https://gist.github.com/rolfbjarne/1ff230ac03cad6b81061c2814a5a895e
2017-03-01 14:59:52 +01:00
Rolf Bjarne Kvinge c93d1fb9e1 [generator] Don't use Type.GetType to look in all loaded assemblies, look directly in the right assembly. (#1805)
'Type.GetType' doesn't work the same with IKVM as with Reflection, so refactor
to code that works the same (and just as correctly) for both IKVM and
Reflection.

In particular there's no need to use 'Type.GetType' with an assembly qualified
typename when we already have the assembly we need to look in: just use the
type's FullName to look up the type in the assembly instead.

Generator diff: https://gist.github.com/rolfbjarne/a3da6c9df53383c4225483f89e16d156
2017-03-01 14:58:48 +01:00