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

3936 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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
Alex Soto dca6d79881
[generator] Teach generator about WrapAttribute on Getters and Setters (#3388)
* [generator] Teach generator about WrapAttribute on Getters and Setters

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

`WrapAttribute` can now be used in property getters and setters,
this allows to Wrap virtually anything the way you need, for example
smart enums, consider the following API definition:

```csharp
// Smart enum.
enum PersonRelationship {
	[Field (null)]
	None,

	[Field ("FMFather", "__Internal")]
	Father,

	[Field ("FMMother", "__Internal")]
	Mother
}
```

```csharp
// Property definition.

[Export ("presenceType")]
NSString _PresenceType { get; set; }

PersonRelationship PresenceType {
	[Wrap ("PersonRelationshipExtensions.GetValue (_PresenceType)")]
	get;
	[Wrap ("_PresenceType = value.GetConstant ()")]
	set;
}
```

* Fix Feedback

* Fix doc error

* Update error message
2018-02-05 21:14:08 -06:00
Sebastien Pouliot e390fefe08
[linker] Mark all TypeConverter if TypeDescriptor is used. Fixes #3372 (#3396)
Moving to reference sources added a few, new converters so the existing
logic to preserve them was not complete.

This update the list of converters, sorted like the reference sources
(RS) for easier reviews.

It also adds:
* a canary test in "dont link" that will fail it the RS code change
or is replaced;
* more complete unit tests to ensure all cases works

https://github.com/xamarin/xamarin-macios/issues/3372
2018-02-05 21:19:46 -05:00
Rolf Bjarne Kvinge 9c2010e440
[registrar] Register models in the static registrar. (#3386)
* [registrar] Register models in the static registrar.

This also means we need to quiet a few types of warnings:.

* Models declares virtual methods of required protocol members. We don't
  export virtual methods (only when they're overridden are they exported),
  which results in numerous warnings about protocol members not being
  implemented:

        Xamarin.Mac.registrar.mobile.x86_64.m:37827:17: warning: method 'deviceBrowserView:selectionDidChange:' in protocol 'IKDeviceBrowserViewDelegate' not implemented [-Wprotocol]
        @implementation ImageKit_IKDeviceBrowserView__IKDeviceBrowserViewDelegate {
                        ^
        /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework/Headers/IKDeviceBrowserView.h:29:1: note: method 'deviceBrowserView:selectionDidChange:' declared here
        - (void)deviceBrowserView: (IKDeviceBrowserView *)deviceBrowserView selectionDidChange: (ICDevice *)device;

* These two are the same as above, just for properties instead of methods.

        Xamarin.Mac.registrar.mobile.x86_64.m:31988:17: warning: auto property synthesis will not synthesize property 'boundingMapRect' declared in protocol 'MKOverlay' [-Wobjc-protocol-property-synthesis]
        @implementation MKOverlay {
                        ^
        /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/MapKit.framework/Headers/MKOverlay.h:24:43: note: property declared here
        @property (nonatomic, readonly) MKMapRect boundingMapRect;
                                                  ^
        Xamarin.Mac.registrar.mobile.x86_64.m:32002:1: note: add a '@synthesize' directive
        @end
        ^

        Xamarin.Mac.registrar.mobile.i386.m:28957:17: warning: property 'repeatCount' requires method 'repeatCount' to be defined - use @synthesize, @dynamic or provide a method implementation in this class implementation [-Wobjc-property-implementation]
        @implementation CAMediaTiming {
                        ^
        /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h:58:17: note: property declared here
        @property float repeatCount;
                ^

* [AVFoundation] Special-case AVCaptureDataOutputSynchronizer[Delegate] in the registrar for macOS.

This class and protocol were incorrectly added to our macOS bindings, but
since we can't remove them because it would break backwards compatibility, we
must skip them manually in the registrar, since the registrar would otherwise
produce uncompilable code:

    In file included from Xamarin.Mac.registrar.full.x86_64.m:2:
    ./Xamarin.Mac.registrar.full.x86_64.h:2929:63: error: 'AVCaptureDataOutputSynchronizerDelegate' is unavailable: not available on macOS
    @interface AVCaptureDataOutputSynchronizerDelegate : NSObject<AVCaptureDataOutputSynchronizerDelegate> {
                                                                  ^
    /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDataOutputSynchronizer.h:101:11: note: 'AVCaptureDataOutputSynchronizerDelegate' has been explicitly marked unavailable here
    @protocol AVCaptureDataOutputSynchronizerDelegate <NSObject>
              ^
    In file included from Xamarin.Mac.registrar.mobile.x86_64.m:2:
    ./Xamarin.Mac.registrar.mobile.x86_64.h:3370:63: error: 'AVCaptureDataOutputSynchronizerDelegate' is unavailable: not available on macOS
    @interface AVCaptureDataOutputSynchronizerDelegate : NSObject<AVCaptureDataOutputSynchronizerDelegate> {

* [AVFoundation] Stub out AVCaptureDataOutputSynchronizer[Delegate] on macOS.

AVCaptureDataOutputSynchronizer[Delegate] were incorrectly added to our macOS
bindings, which makes the static registrar's life difficult. So remove those
bindings, and re-implemented them as normal classes, without any attributes,
which makes the static registrar ignore them (to a certain extent: enough to
not generate uncompilable code at least).

* [registrar] Remove more model exclusion code.

* [xtro] Update ignored entries.
2018-02-05 22:19:34 +01:00
Chris Hamons c0202e0e2b
PMCS Removal (#3197)
You were the preprocessor we wished C# had natively

Removing PMCS requires these changes:
* Remove XamCore from src/
* Remove XamCore from tools/
* Remove XamCore from runtime/
* nint/nuint enum conversion
* _compat_ enum conversion
* NSAction conversion
* Hand fix single API incorrectly converted by PMCS to unbreak compatibility
   - Due to a bug in PMCS, the nuint was incorrectly converted in this API.
   - However, as that ship as sailed, we must "fix" it until XAMCORE_4_0
* Update readme
* Bump macios-binaries
2018-02-05 10:26:29 -05:00
Rolf Bjarne Kvinge 597be76231
[ObjCRuntime] Add [Flags] to the InitializationFlags enum. (#3390)
After all, that's what it is.
2018-02-05 15:58:59 +01:00
Rolf Bjarne Kvinge 6b5870d668
[tests] Move linker tests to match introspection directory layout. (#3365)
* [tests] Move linker tests to match introspection directory layout.

Move linker tests to match introspectio directory layout: tests/linker/ios and
tests/linker/mac instead of tests/linker-ios and tests/linker-mac.

This creates a logical place for shared linker files (tests/linker).

* [tests] Fix path to GuiUnit_NET_4_5.csproj in sln as well.

This is the path used to find referenced projects when building Classic.

Fixes this build problem:

    warning: Referenced project 'GuiUnit_NET_4_5' not found in the solution.
    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(11,7) : error CS0246: The type or namespace name `GuiUnit' could not be found. Are you missing an assembly reference?
    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(64,42) : error CS0246: The type or namespace name `IMainLoopIntegration' could not be found. Are you missing an assembly reference?
    /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/common/mac/MacTestMain.cs(75,34) : error CS0246: The type or namespace name `InvokerHelper' could not be found. Are you missing an assembly reference?
2018-02-05 15:09:04 +01:00
Rolf Bjarne Kvinge 5319266503
[static registrar] Compute the conversion methods for smart enums and embed those as token references in the generated code. (#3385)
Converting to and from smart enums and their corresponding native value
requires knowing the conversion function, since each smart enum has its own
conversion function.

The dynamic registrar can do this at runtime, but it's something that can be
computed in the static registrar at build time, so do that. The static
registrar will now embed the metadata token (as a token reference) in the
generated code, which can be used at runtime to find the conversion method,
without requiring anything from dynamic registrar.

This requires some refactoring in the conversion methods to allow passing more
information around (the `context` parameter in the conversion functions, which
the smart enum conversion methods now use for the token reference).

It turns out this is a massive improvement (although the scenarios where this
is relevant are rare): a simple test case [1] is 300x faster (from ~30s to
0.1s).

[1]: https://gist.github.com/rolfbjarne/961af28d1c2727b256fbcdfd6aa65e98
2018-02-05 07:54:13 +01:00
Sebastien Pouliot bec116c273
Bump mono to 2010-10 head (#3384)
This fix #3241 on master (already bumped on 15.6)

Commit list for mono/mono:

* mono/mono@38502063ca Revert "[mini] Align stack when resuming to catch handler" (#6744)
* mono/mono@3c3e692887 Bump linker

Diff: ab882c0c3d...38502063ca
2018-02-02 14:50:50 -05:00
Rolf Bjarne Kvinge 98edb545c9
[xharness] Store a computed make variable in a temporary variable to avoid computing it many times. (#3382)
This makes `make` in (with nothing to do) run 18x faster in tests/ (from 1.3s to 0.07s).
2018-02-02 17:17:59 +01:00
Rolf Bjarne Kvinge 15c44504ad
[generator] The generated block code is also generated, so add the corresponding attributes. (#3381)
Generator diff: https://gist.github.com/rolfbjarne/269ab7f24060ccd844fa1c140f43fec8
2018-02-02 17:17:26 +01:00
Rolf Bjarne Kvinge 1a260e542b
[tests] Build the native test library for macOS and create a binding project for it. (#3373)
* [tests] Build the native test library for macOS and create a binding project for it.

Also add the new binding project to the xammac and link all XM test projects,
which allows us to stop excluding tests that require the native library and
the corresponding bindings.

* [tests] Include more tests in xammac_tests.

* [tests] Correctly ignore the ObjC exception tests in release mode.
2018-02-02 11:14:44 +01:00
Rolf Bjarne Kvinge f905427739
[tests] Share supporting code between the mtouch and mmp tests. (#3374)
* [tests] Share supporting code between the mtouch and mmp tests.

Create a new class 'BundlerTool', which now contains most of the code in
MTouchTool that's also applicable to mmp (and the new MmpTool class).

This will make it easier to share tests between the mtouch and mmp tests.

Some tweaks are still probably required, but this should get us most of the
way.

* [tests] Fix generator tests after changes in shared test code.

* [tests] Add new file to the MSBuild/XM tests.
2018-02-02 07:09:04 +01:00
Rolf Bjarne Kvinge 32ea9bd930
[tests] Fix compiler warning. (#3375)
This file is included in several projects, some projects use property, some
don't (and report the warning). There's no harm in not setting this property
(it's expected), ignore the warning.
2018-02-01 19:07:23 +01:00
Rolf Bjarne Kvinge 83c8ba688a
[tests] Enable LLVM for all Release|Device configurations. (#3376)
This won't affect device tests on the bots (because those already set LLVM
manually when testing Release), but it becomes less confusing when trying to
reproduce any problems locally, since now the project configuration on disk
matches the tested configuration.
2018-02-01 17:59:40 +01:00
Rolf Bjarne Kvinge c3560bf726
[mmptest] Fix compiler warning by not including code we get from a reference. (#3366)
Fixes this:

    tests/common/mac/ProjectTestHelpers.cs(154,22): warning CS0436: The type 'StringUtils' in 'tests/mmptest/../../tools/common/StringUtils.cs' conflicts with the imported type 'StringUtils' in 'mmp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/mmptest/../../tools/common/StringUtils.cs'.
    tests/common/Configuration.cs(162,53): warning CS0436: The type 'StringUtils' in 'tests/mmptest/../../tools/common/StringUtils.cs' conflicts with the imported type 'StringUtils' in 'mmp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'tests/mmptest/../../tools/common/StringUtils.cs'.
2018-02-01 07:35:35 +01:00
Rolf Bjarne Kvinge 83b81ca9f4
[Foundation] Simplify NSValue code to use [No*] instead of ifdefs. (#3364)
* [Foundation] Simplify NSValue code to use [No*] instead of ifdefs.

Also enable the MKCoordinateSpan and CLLocationCoordinate2D values for NSValue
in macOS, since they're now available (since macOS 10.9).

    Type Changed: Foundation.NSValue

    Added properties:

        public virtual MapKit.MKCoordinateSpan CoordinateSpanValue { get; }
        public virtual CoreLocation.CLLocationCoordinate2D CoordinateValue { get; }

* [Foundation] Mark the new NSValue selectors as 64-bit only.
2018-02-01 07:31:52 +01:00
Jeffrey Stedfast a61c7dc2ca
[msbuild] Use the proper MM vs MT error code prefix (#3360)
* [msbuild] Use the proper MM vs MT error code prefix

* Removed unused variable (artifact of debugging)
2018-01-31 09:56:45 -05:00
Rolf Bjarne Kvinge 48813af819
[generator] Ensure we don't generate code that creates pointers to local variables that then go out of scope. (#3362)
Instead of generating the following:

    var converted = IntPtr.Zero;
    if (value.HasValue) {
    	var v = value.Value;
    	converted = new IntPtr (&v);
    }
    // now 'converted' points to a local variable that is out of scope

do this:

    var converted = IntPtr.Zero;
    var v = default (float);
    if (value.HasValue) {
    	v = value.Value;
    	converted = new IntPtr (&v);
    }
    // now 'converted' points to a local variable that's still in scope

so that we don't store a pointer to a local variable and use that pointer
after the local variable has gone out of scope.

I'm not entirely sure this really is a problem in C#, but it doesn't hurt to
be on the safe side.

Also add newlines to the generated code to make it look nicer.

Generator diff: https://gist.github.com/rolfbjarne/225d920b7fa28d07fbeab13754cebd2a
2018-01-31 14:57:33 +01:00
Rolf Bjarne Kvinge 6fc7b1ea89
[tests] Run dont link, link all and link sdk tests in both Debug and Release in the simulator. Fixes #53181. (#3363)
* [xharness] Add support for running XI projects with different platform configurations.

* [xharness] Run dont link, link all and link sdk tests in both Debug and Release in the simulator. Fixes #53181.

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

* [tests] Fix dont link to always optimize C# code in release mode.

* [tests] No need to weak link GameController anymore in dont link.

This was removed long ago from the Debug configurations, so remove it from the
Release configuration as well.
2018-01-31 14:56:22 +01:00
Jeffrey Stedfast cb51d9364d
[msbuild] Removed old logging conven ience method (#3352) 2018-01-30 13:51:01 -05:00
Rolf Bjarne Kvinge b632c2348e
[xharness] Don't discriminate iPods, they can be useful too. (#3355) 2018-01-30 17:11:04 +01:00
Rolf Bjarne Kvinge f786a88636
[tests] Make linker-ios tests look like they're from this century. (#3356) 2018-01-30 17:10:54 +01:00
Rolf Bjarne Kvinge 52c1a6127a
[AVFoundation] Mark NSExtensionRequestHandling as 64-bit only. (#3334)
* [AVFoundation] Mark NSExtensionRequestHandling as 64-bit only.

The correct binding already existed, but for some reason it was
incorrectly duplicated/readded and marked as available in 32-bit here:
https://github.com/xamarin/xamarin-macios/commit/ca028ea15#diff-7ea102419ab3567d665e35d010e90a58R11401

So simplify the bindings by removing the incorrect version.

* [Foundation] Remove superfluous availability attribute.
2018-01-30 10:28:21 +01:00