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

3971 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
Manuel de la Pena 62480fb0e2
[Metal] If the device is not supported, skip certain tests. Fixes #3389 (#3444)
* [Metal] If the device is not supported, skip certain tests. Fixes #3389
2018-02-09 18:21:22 +01:00
Rolf Bjarne Kvinge 4ae5a87622
Automatically rerun 'make reset[-versions]' if the maccore dependency was reset. (#3442) 2018-02-09 15:20:06 +01:00
Rolf Bjarne Kvinge 7ca5b70e0e
[src/apidiff] Don't hardcode input/output/build directories. (#3435)
* [src] Don't hardcode the build directory.

* [apidiff] Don't hardcode the input/output directories.
2018-02-09 13:07:22 +01:00
Alex Soto 894d018bf7 Revert "bump maccore to deprecate docs' classic dependency" (#3440)
This reverts commit 95d1968856.

Unfortunately with this commit our build fails with

```
[5:06:58] GEN      XamMac.CFNetwork.xml
[5:06:58] install: ../../../../xamarin-macios/external/macios-binaries/docs/macOS/classic/XamMac.xml: No such file or directory
[5:06:58] install: ../../../../xamarin-macios/external/macios-binaries/docs/macOS/classic/XamMac.CFNetwork.xml: No such file or directory
[5:06:58] make[6]: *** [../../../../xamarin-macios/external/macios-binaries/docs/macOS/classic/XamMac.xml] Error 71
[5:06:58] make[6]: *** Waiting for unfinished jobs....
[5:06:58] make[6]: *** [../../../../xamarin-macios/external/macios-binaries/docs/macOS/classic/XamMac.CFNetwork.xml] Error 71
```
2018-02-09 12:19:35 +01:00
Joel Martinez 0c60e9e1f9
Merge pull request #3434 from xamarin/marj-classic-deprecation
bump maccore to deprecate docs' classic dependency
2018-02-08 16:09:03 -05:00
Joel Martinez 95d1968856
bump maccore to deprecate docs' classic dependency 2018-02-08 11:56:06 -05:00
Rolf Bjarne Kvinge bf8787c748
[ObjCRuntime] Add support for getting the native ObjC class for a given System.Type without using the dynamic registrar. (#3424)
* [ObjCRuntime] Add support for getting the native ObjC class for a given System.Type without using the dynamic registrar.

* The static registrar now generates a table of any types that skipped
  registration (which is currently used for generic types, such as
  `NSArray<T>`), that allows us to look up the corresponding native type.

* In Runtime.Class now look in the tables generated by the static registrar to
  find the native ObjC class for any given System.Type.

* Store the results in a dictionary so that the lookup isn't slower than
  before (in fact it's ~4x faster now).

* [registrar] Elevate debug spew into a proper error.

* [registrar] Don't process 64bit-only skipped types on 32-bits.

This also requires fixing the registrar's parsing of the new [iOS] and [Mac]
availability attributes
2018-02-08 15:28:01 +01:00
Sebastien Pouliot 1c3f56b926
[src] Add a few missing [RequiresSuper] attributes. Fix #3253 (#3429)
Those were missed because xtro did not scan ObjC categories for
`objc_requires_super` attributes.

Fixing the naming mapping (to consider inlined categories) also
uncovered a few API with extraneous [DesignatedInitializer] attributes
Those were deprecated (API) and moved into categories so xtro missed
the designated initializer was removed.

All your `base`, well `super` in ObjC, now belong to us :)

https://github.com/xamarin/xamarin-macios/issues/3253
2018-02-08 08:44:36 -05:00
Sebastien Pouliot dda9019f07
[uikit] Add [Advice] on UIImage.FromBundle to mention it was not thread safe before iOS9 (#3430)
This is related, but not a direct fix, to bug
https://bugzilla.xamarin.com/show_bug.cgi?id=40520

The original fix was made, a long time ago, in
maccore/e39d21e26dd863d019269117d4c110c3ac8ce9f5
2018-02-08 08:39:39 -05:00
Rolf Bjarne Kvinge 0e66298a15
[xharness] Clone XM projects. (#3427)
* [tests][xammac] Fix a few path calculations to not be hardcoded.

* [xharness] Clone XM projects.

Cloning projects before building them will also clone project references,
which will make it possible to build multiple projects in parallel, when those
projects have common project references.

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

* [xharness] Fix XM project cloning

* Don't clone Classic projects (they're solutions, and xharness doesn't understand them).
* Clonee projects properly when cloning execution tasks.

* [xharness] GuiUnit needs specialized cloning.

The GuiUnit project uses relative paths to write to files outside the project
directory, which means that multiple GuiUnit project files may write to the
same location.

So special-case GuiUnit cloning to make those paths subdirectories of the
project's directory instead.

* [xharness] Process imported targets when cloning projects.

Also make the msbuild-mac's custom targets file independent of the location of
the project file by making all paths relative to the custom targets file.
2018-02-08 14:32:48 +01:00
Rolf Bjarne Kvinge 6f59487700
[AudioToolbox] Fix filename casing. (#3413) 2018-02-07 22:08:41 +01:00