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

4132 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge a6106fb3a6 [monotouch-test] Second attempt to find protocols available everywhere. 2018-02-14 14:29:06 +01:00
Rolf Bjarne Kvinge 2afed0342c [monotouch-test] Use protocols available in all platforms in ProtocolTest. 2018-02-14 09:35:25 +01:00
Rolf Bjarne Kvinge e14aa74c70 [linker] Move XI/XM shared code from MobileSweepStep to a new CoreSweepStep class. 2018-02-14 09:27:12 +01:00
Rolf Bjarne Kvinge 8e4b763d0e [static registrar] Fix finding derived [Export] attributes. 2018-02-14 09:19:31 +01:00
Rolf Bjarne Kvinge 3c0ba1b86a [tests] Fix typo. 2018-02-14 09:19:00 +01:00
Rolf Bjarne Kvinge 7956559d43 [ObjCRuntime] Avoid unnecessary loop, as recommended in review. 2018-02-14 01:38:10 +01:00
Rolf Bjarne Kvinge 1206d7bf49 [docs] Update according to review. 2018-02-14 01:37:51 +01:00
Sebastien Pouliot 3355fdfc6e
[appkit] Change some NSOpenGL* types to be thread safe. Fixes #60826 (#3476)
Our thread safe checks ensure we're running on the main thread. This is
not the model used by OpenGL where the "same thread" must be used by
the context (but it does not need to be the main one)

https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_threading/opengl_threading.html#//apple_ref/doc/uid/TP40001987-CH409-SW1

https://bugzilla.xamarin.com/show_bug.cgi?id=60826
2018-02-13 19:34:38 -05:00
Rolf Bjarne Kvinge 18e30331a4 [linker] The static registrar may need information about types that have been linked away, so make sure we can get that information by storing it somewhere. 2018-02-14 01:26:58 +01:00
Rolf Bjarne Kvinge ed886f6181 [tests] Refactor several tests to use new-style syntax.
Failure are reported much better, and the testing is more accurate and extensive.
2018-02-14 01:13:17 +01:00
Rolf Bjarne Kvinge 84b6e8a405 [registrar] Don't use a @protocol reference for CAMetalDrawable in the simulator (there's no header for this protocol). 2018-02-14 01:12:55 +01:00
Rolf Bjarne Kvinge 564e433bbd [tests] Adjust tests after new optimization was implemented. 2018-02-14 01:12:26 +01:00
Rolf Bjarne Kvinge 9e9e479ab2 [monotouch-test] Adjust new test to not try to reference IMDLComponent on watchOS (where it doesn't exist). 2018-02-14 01:11:44 +01:00
Manuel de la Pena 7472c8237d
[Foundation] Add not bound NSDateComponentUndefined. Fixes 60740 (#3471)
Added the value and provided tests that show the API usage. Value was
inferred from the headers:

NSDateComponentUndefined = NSIntegerMax
2018-02-13 20:38:24 +01:00
Rolf Bjarne Kvinge 5b53c134d8 [xharness] Run monotouch-test with all optimizations enabled as well. 2018-02-13 19:38:35 +01:00
Rolf Bjarne Kvinge 35f4e7230a [linker] Check stored attributes as well. 2018-02-13 19:38:35 +01:00
Rolf Bjarne Kvinge 927f044bb2 [registrar] Collect protocols from base models as well. 2018-02-13 19:38:35 +01:00
Rolf Bjarne Kvinge 1de94d444b [static registrar] Create a table of interface -> protocol in the static registrar.
Create a table of interface -> protocol in the static registrar, since we need
to be able to look up a protocol given a managed type without looking at the
(possibly linked away) [Protocol] attribute.
2018-02-13 19:38:35 +01:00
Rolf Bjarne Kvinge 6aec487461 [mmp] Set Target.LinkContext earlier so that the static registrar has access to it when needed. 2018-02-13 19:38:35 +01:00
Rolf Bjarne Kvinge 0af9a6744d [xharness] Add a new test variation for xammac tests: release with all optimizations enabled. 2018-02-13 19:38:34 +01:00
Rolf Bjarne Kvinge ea3316465b [tests] Add a test to make sure the protocol attributes are properly removed. 2018-02-13 19:38:34 +01:00
Rolf Bjarne Kvinge 8485e7f4bb [mtouch/mmp] Move some code to be shared. 2018-02-13 19:38:34 +01:00
Rolf Bjarne Kvinge 1c77da63cf [tests][mtouch] Update a few tests according to recent changes. 2018-02-13 19:38:34 +01:00
Rolf Bjarne Kvinge 28ac9c42df [mtouch/mmp] Don't report MX2003 more than once for each option. 2018-02-13 19:38:34 +01:00
Rolf Bjarne Kvinge 58908ce406 Merge remote-tracking branch 'origin/master' into HEAD 2018-02-13 19:38:08 +01:00
Manuel de la Pena 1ae3156da1
[UIKit] Fix typo. Fixes bug #54544 'Binding typo DarkerSystemColosEnabled' (#3470) 2018-02-13 18:58:14 +01:00
Rolf Bjarne Kvinge 3d87b5318f
[registrar] Skip informal protocols when enumerating the protocols a type implements. (#3467)
* [registrar] Skip informal protocols when enumerating the protocols a type implements.

This prevents the registrars from generating this (`NSMenuValidation` is an informal protocol):

    @interface __monomac_internal_ActionDispatcher : NSObject<NSMenuValidation> {
    }
    @end

which is not correct.

* [registrar] Don't skip real protocols implemented by informal protocols.

* [generator] Propagate the IsInformal value to [Protocol] attributes on models.

We shouldn't put [Protocol] attributes on models in the first place, but at
least do it right if we do it.

* [NSObject] Don't conform to informal protocols.
2018-02-13 18:30:29 +01:00
Rolf Bjarne Kvinge 5933c2d32f
[mmp] Restrict the blockliterla-setupblock optimization to Unified. Fixes maccore #636. (#3468)
XamMac.dll is not built anymore, so it doesn't have the new managed API to make the optimization work.

Fixes https://github.com/xamarin/maccore/issues/636.
2018-02-13 17:20:53 +01:00
Rolf Bjarne Kvinge 883038788a
[tests] Fix relative paths in mmptest and make cloned XM nunit projects work properly. (#3464)
* [tests] Fix relative paths in mmptest and make cloned XM nunit projects work properly.

Fixes this build problem with mmptest:

    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/mmptest/CustomBuildActions.targets: error : Command 'make bin/SimpleClassDylib.dylib bin/SimpleClassStatic.a bin/Mobile-static/MobileBinding.dll' exited with code: 255.

Fixes https://github.com/xamarin/maccore/issues/633.

* [mmp] Improve Driver.IsDefaultMarshalingManagedExceptionMode to work before MarshalManagedException has been initialized.

Fixes this test failure:

    1) Failed : Xamarin.MMP.Tests.MMPTests.UnifiedDebugBuilds_ShouldLinkToPartialStatic_UnlessDisabled
      Debug build should use partial static registrar
      Expected: True
      But was:  False

This regressed in 0561618460, where we wouldn't
properly select the partial static registrar because the initialization order
changed and we'd do it before selecting the default exception marshaling mode.

Changing Driver.IsDefaultMarshalingManagedExceptionMode to work before
MarshalManagedException has been initialized to its default value fixes the
problem.
2018-02-13 17:19:31 +01:00
Rolf Bjarne Kvinge cb9f97b46d
[src] Fix installing pdbs for MonoTouch.Dialog and MonoTouch.NUnitLite. (#3459)
* [src] Fix installing pdbs for MonoTouch.Dialog and MonoTouch.NUnitLite.

The pdb rules I've removed here didn't do anything (no recipe, only a
dependency, which meant that the rule to install them wouldn't execute because
of some reason only make understands).

Instead implement this correctly: one command (running the C# compiler)
produces both the dll and the pdb, and the way to express this in a makefile
is to use a pattern rule [1] with two targets (the dll and the pdb), and both
targets having with the same stem (it can be anything, I chose the path
separator because that was simplest, even though it looks somewhat strange).

[1]: https://www.gnu.org/software/make/manual/html_node/Pattern-Examples.html#Pattern-Examples

* [src] Make sure that the output is always a dll.

In the previous commit I changed these rules to state that the same recipe
would build both the dll and the pdb.

A problem arises when the file that ends up executing the recipe is the pdb,
in which case we can't say that the output from the compilation is the target
(`-out:$@`), because that would write the assembly with the pdb's filename.

So change the output to be a dll instead.
2018-02-13 15:51:29 +01:00
Rolf Bjarne Kvinge 86753c8276
[tests] Produce a better test failure message when verifying the number of warnings. (#3465) 2018-02-13 15:01:34 +01:00
Rolf Bjarne Kvinge 1ec2c2a30b
[mmp] Don't store the current registrar in multiple places. (#3466) 2018-02-13 14:32:00 +01:00
Rolf Bjarne Kvinge da7fbcb2df
Add scripts to calculate API diffs and generated code diff between the current build and another revision. (#3447) 2018-02-13 07:47:47 +01:00
Sebastien Pouliot 7c45477e40
[foundation][uikit] Add missing [DesignatedInitializer] on default constructor (#3454)
Like reported by xtro (data files updated)
using the new, simpler `[DesignatedDefaultCtor]` attribute
2018-02-12 22:52:33 -05:00
Rolf Bjarne Kvinge 6be77427f3 [mtouch/mmp] Register complete protocol information in the static registrar, and link away unneeded metadata/code.
Improved linker to:

* Not mark protocol interfaces by the mere virtue of having a type that
  implements them. This is implemented by not marking protocol interfaces when
  they're implementing a class, but instead when a method implementation is
  found to implement a method from a protocol interface.
* Mark the wrapper type for protocols (this allows us to remove the Protocol
  attribute, since that's the link between the protocol and its wrapper type).
* Remove the [Protocol], [ProtocolMember] and [Adopts] attributes.

The static registrar still needs some of the information linked away, so a few
changes are required to make it available post linker.
2018-02-12 14:46:01 +01:00
Rolf Bjarne Kvinge 2b76428a16 [mtouch/mmp] Generate table of protocols and their corresponding wrapper type in the static registrar.
Generate table of protocols and their corresponding wrapper type in the static
registrar, so that we don't have to look for this information using the
dynamic registrar at runtime.
2018-02-12 14:46:00 +01:00
Rolf Bjarne Kvinge e5cae0a82e [mtouch/mmp] Fix warning about ignored optimizations to include 'register-protocols'.
Fix warning about ignored optimizations to include 'register-protocols', since
it has conditions not in other optimizations (both the static registrar and
the linker must be enabled).
2018-02-12 14:45:59 +01:00
Rolf Bjarne Kvinge 14daaad78e [registrar] Make the generated static registrar code implement protocols from [Adopts] attributes.
Make the generated static registrar code implement protocols from [Adopts]
attributes, so that we can just query the ObjC runtime to see if a type
implements a protocol instead of keeping this information around ourselves.
2018-02-12 14:45:22 +01:00
Rolf Bjarne Kvinge 0fa2aa0fb5 [mtouch/mmp] Add a 'register-protocols' optimization option. 2018-02-12 14:45:21 +01:00
Rolf Bjarne Kvinge 3b62ade289 [static registrar] Refactor code to look in saved attributes as well. 2018-02-12 14:45:21 +01:00
Rolf Bjarne Kvinge a2afb8597f
[xharness] Don't try to connect to unusable devices. (#3456) 2018-02-12 14:43:16 +01:00
Rolf Bjarne Kvinge ecc5d05433
[static registrar] Simplify code a little bit to not create an array unless needed. (#3460) 2018-02-12 14:42:55 +01:00
Rolf Bjarne Kvinge 0561618460
[mtouch/mmp] Simplify and unify the code to select/create the static registrar. (#3461)
There's only one static registrar now, so there's no need for code to select
which one, just create the one and only.

Also unify this code between mtouch and mmp.
2018-02-12 14:42:19 +01:00
Rolf Bjarne Kvinge 4422045626
[xharness] Fixing cloning of XM projects with custom elements. (#3458)
Fixes various build errors in the System.IdentityModel,
System.IO.Compression[.FileSystem], System.Security and System.ServiceModel
tests.
2018-02-12 14:15:55 +01:00
Rolf Bjarne Kvinge 8da06d7c55
[xharness] Adjust (add) which files cause the generator tests to execute slightly. (#3457) 2018-02-12 14:15:30 +01:00
Sebastien Pouliot 0df4274918
Update CODEOWNERS files (#3455) 2018-02-12 08:13:44 -05:00
Sebastien Pouliot c820fc2b56
[generator] Reuse the [RequiresSuper] attribute from the platform assemblies. (#3453)
Bindings trying to override members with that attribute would produce a

```
error BI1055: bgen: Internal error: failed to convert type 'ObjCRuntime.RequiresSuperAttribute, Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. Please file a bug report (https://bugzilla.xamarin.com) with a test case.
```

Fixes https://github.com/xamarin/maccore/issues/632
2018-02-12 08:10:02 -05:00
Sebastien Pouliot 12cf6e3350
[generator] Add support for [DesignatedInitializer]. Fix #3247 (#3451)
Add an easier syntax for automatically generated default .ctor/init
what needs to be decorated with `[DesignatedInitializer]`.

The current way of doing this requires a bit too much work.
More details in:
https://github.com/xamarin/xamarin-macios/issues/3247

Generator diff: https://gist.github.com/spouliot/2675be8ce15ab473ed7c573403d7eb47

Note that this includes the Foundation and UIKit fixes (reported
by xtro). Those will be committed separately once this is merged.
2018-02-11 10:53:05 -05:00
Sebastien Pouliot 05891c2b97
[generator] Fix .csproj files targets so we can debug from VS (#3450)
This was broken when removing pmcs support and will need to be
updated once we switch to csc (roslyn).
2018-02-10 12:02:07 -05:00
Manuel de la Pena d0037ddc42
[Tests] Ensure that tests do not fail due to the locale. Fixes #3445 (#3448) 2018-02-09 21:14:57 +01:00