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

4208 Коммитов

Автор SHA1 Сообщение Дата
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
Alex Soto a97cb69cc2 [StoreKit] Update to Xcode 9.3 Beta 2 (#3436) 2018-02-09 14:11:12 -05:00
Alex Soto 13b196ec6b [Appkit] Update to Xcode 9.3 beta 2 (#3433) 2018-02-09 14:10:41 -05: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
Sebastien Pouliot f6c1a7656b
[macos][imagekit] Add a deprecation warning on IKImageBrowserView (#3437)
It's a _early_ warning since it mention 10.14
2018-02-09 09:05:17 -05: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
Sebastien Pouliot 8c73211776
[webkit] Add NSUserInterfaceValidations conformance to WebView and WKWebView (#3431)
Fix remaining xtro todo on webkit
2018-02-08 08:35:53 -05:00
Sebastien Pouliot ec5b1b7a32
[xtro][passkit] Clean xtro todo for a missing designated initializer (#3432)
it's already fixed in master
2018-02-08 08:35:06 -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
Sebastien Pouliot 8e9284f355
Bump ObjectiveSharpie to a version that supports choosing its Xcode. (#3409) (#3428)
Bump ObjectiveSharpie to a version that supports choosing which Xcode to use,
and also change xtro to do exactly that.

Fixes https://github.com/xamarin/maccore/issues/627.
2018-02-07 23:19:48 -05:00
Xamarin Release Engineering 1c6f300ef2 Updated reference to mono/mono@da1e498 (#3426) 2018-02-07 21:50:24 -05:00
Sebastien Pouliot bc80460409
[imageio] Update for xcode 9.3 beta 2 (#3411)
Two constants with `__IPHONE_NA` were changed to `__IPHONE_11_3`.

Also decorate with [TV] and [Watch] attributes since they are implicit,
i.e. not in the headers but available in tvOS 11.3+ and WatchOS 4.3+
and, without our attributes, would seems to have been available much
earlier
2018-02-07 21:35:56 -05:00
Rolf Bjarne Kvinge 337335a5dd
[xharness] Run xtro tests when Make.config changes. (#3408) 2018-02-07 22:09:06 +01:00
Rolf Bjarne Kvinge 6f59487700
[AudioToolbox] Fix filename casing. (#3413) 2018-02-07 22:08:41 +01:00
Rolf Bjarne Kvinge 728df13622
Quiet build. (#3415) 2018-02-07 22:07:35 +01:00
Rolf Bjarne Kvinge 3ab627cb78
Fix solution after some test projects moved. (#3416) 2018-02-07 22:06:26 +01:00
Rolf Bjarne Kvinge 3b8bfdb3ed
[simlauncher] Link with the IdentityLookup framework. (#3418)
This makes it possible to use types from the IdentityLookup when using
simlauncher.
2018-02-07 22:05:45 +01:00
Rolf Bjarne Kvinge 42317cfe12
Fix code to compile in csc. (#3414)
This is an mcs bug, where it incorrectly compiles invalid code (see
https://github.com/mono/mono/issues/6829).
2018-02-07 22:03:17 +01:00
Alex Soto 5bf7f0c542
[SceneKit] Adds NullAllowed to ISCNSceneRenderer.OverlayScene (#3410) (#3423)
Fixes xamarin/xamarin-macios#3392

It seems swift has this property listed as an optional[0] and
an Apple sample[1] sets this to null so `ISCNSceneRenderer.OverlayScene`
needs to have `[NullAllowed]` even if ObjC headers do not have
nullability information.

[0]: https://developer.apple.com/documentation/scenekit/scnscenerenderer/1524051-overlayskscene
[1]: https://github.com/xamarin/xamarin-macios/issues/3392
2018-02-07 15:02:30 -06:00
Rolf Bjarne Kvinge 12d2a28adc
[Foundation] Fix selectors for a few NSValue members. (#3422)
A refactoring (83b81ca9f4) caused this
regression, because of some non-obvious bindings (same methods bound to
different selectors between iOS and macOS).

Fixes https://github.com/xamarin/maccore/issues/630.
2018-02-07 21:54:27 +01:00
Rolf Bjarne Kvinge 0b32ac8852
[src] Update csproj templates for platform assemblies to build correctly. (#3417)
Now that we don't use pmcs anymore, VSfM can actually understand our source code.

So in order to make the editing experience in VSfM better:

* Include all the source files in the csprojs.
* Make sure to not build into the same directories as the normal build
  process, since the csproj don't build the official version of the
  assemblies.
* Misc other fixes to make it all build.
2018-02-07 21:51:50 +01:00
Alex Soto 8dbd20000c
[SceneKit] Adds NullAllowed to ISCNSceneRenderer.OverlayScene (#3410)
Fixes xamarin/xamarin-macios#3392

It seems swift has this property listed as an optional[0] and
an Apple sample[1] sets this to null so `ISCNSceneRenderer.OverlayScene`
needs to have `[NullAllowed]` even if ObjC headers do not have
nullability information.

[0]: https://developer.apple.com/documentation/scenekit/scnscenerenderer/1524051-overlayskscene
[1]: https://github.com/xamarin/xamarin-macios/issues/3392
2018-02-07 12:36:41 -06:00
Rolf Bjarne Kvinge 309b8d08b6
[runtime] Make const what can const be. (#3412)
This might make the compiler able to put the data in read-only memory.
2018-02-07 19:28:59 +01:00
Rolf Bjarne Kvinge 662d78b08c
[ObjCRuntime] Remove unused function. (#3419) 2018-02-07 19:28:18 +01:00
Rolf Bjarne Kvinge 44041f6863
Bump ObjectiveSharpie to a version that supports choosing its Xcode. (#3409)
Bump ObjectiveSharpie to a version that supports choosing which Xcode to use,
and also change xtro to do exactly that.

Fixes https://github.com/xamarin/maccore/issues/627.
2018-02-07 19:21:49 +01:00
Rolf Bjarne Kvinge 838f31f522
[tests] Tweak the new IntPtrSizeTest for release builds. Fixes #3395. (#3397)
Fixes https://github.com/xamarin/xamarin-macios/issues/3395.
2018-02-07 12:05:18 +01:00
Vincent Dondain 60a17f1c11 Bump Xcode to 9.3 beta 2 (#3405) 2018-02-07 04:44:58 -05:00
Chris Hamons 46382d86b8
[ImageIO] Update to Xcode 9.3 Beta 1 (#3339) 2018-02-06 11:51:06 -06:00
Rolf Bjarne Kvinge 97230c28e1
Optimize calls to BlockLiteral.SetupBlock to inject the block signature. (#3391)
* [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature.

Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block
signature at build time, and inject it into the call site.

This makes block invocations 10-15x faster (I've added tests that asserts at
least an 8x increase).

It's also required in order to be able to remove the dynamic registrar code in
the future (since calculating the block signature at runtime requires the
dynamic registrar).

* [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning.

Add support for reporting errors/warnings that point to the code line causing
the error/warning by adding ErrorHelper overloads that take the exact
instruction to report (previously we defaulted to the first line/instruction
in a method).

* [tests] Add support for asserting filename/linenumber in warning messages.

* Make all methods that manually create BlockLiterals optimizable.

* [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test.

* [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization.

* [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization.

* [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice.

* [tests][linker] Don't execute linkall-only tests in linksdk.

The optimization tests only apply when the test assembly is linked, and that
only happens in linkall, so exclude those tests in linksdk.

* [tests][mmptest] Update test according to mmp changes.

Fixes these test failures:

    1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch")
    The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
    	Message #1 did not match:
    		actual:   'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
    	Message #2 did not match:
    		actual:   'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'

    2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo")
    The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
    	Message #1 did not match:
    		actual:   'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
    	Message #2 did not match:
    		actual:   'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'

* [tests][linker] Fix typo.

Fixes this test failure:

    1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate)
         Counter
      Expected: 1
      But was:  2

* [registrar] Minor adjustment to error message to match previous (and better) behavior.

Fixes this test failure:

    1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes
    The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output:
    	Message #1 did not match:
    		actual:   'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
    		expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''

* [docs] mmp shows MM errors/warnings.

* [docs] Improve according to reviews.

* [tests] Fix merge failure causing test duplication.
2018-02-06 07:08:15 +01:00