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

3881 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 779dffcb7c
[registrar] watchOS got headers for GameKit in watchOS 3.2 (#3333)
See https://trello.com/c/Okdw58IO/51-27476259-gamekit-header-files-are-missing-for-watchsimulator
2018-01-29 11:08:30 +01:00
Curtis Wensley 3a493154a5 Make NSScreen nullable in NSWindow.ConstrainFrameRect (#3335)
When overriding this method, the framework can feed us a null screen, e.g. when calling `NSWindow.SetFrame()`

An example stack trace:

```
2018-01-26 10:08:17.580 Rhinoceros[2975:238051] System.ArgumentNullException: Value cannot be null.
Parameter name: screen
  at AppKit.NSWindow.ConstrainFrameRect (CoreGraphics.CGRect frameRect, AppKit.NSScreen screen) [0x0000c] in <5dd442fafc4842c391a0a802c0c12c43>:0 
  at System.Windows.Forms.FormHelper.ConstrainFrameRect (CoreGraphics.CGRect frameRect, AppKit.NSScreen screen) [0x00017] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:85 
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_CGRect_bool (intptr,intptr,CoreGraphics.CGRect,bool)
  at AppKit.NSWindow.SetFrame (CoreGraphics.CGRect frameRect, System.Boolean display) [0x00031] in <5dd442fafc4842c391a0a802c0c12c43>:0 
  at System.Windows.Forms.Form.UpdateBounds (AppKit.NSView super) [0x00055] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:529 
  at System.Windows.Forms.Control.SetBoundsInternal (System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height) [0x0001c] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.Cocoa.cs:570 
  at System.Windows.Forms.Control.SetBounds (System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height, System.Windows.Forms.BoundsSpecified specified) [0x0005a] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:2370 
  at System.Windows.Forms.Control.set_Location (System.Drawing.Point value) [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:1483 
  at System.Windows.Forms.Form.set_Location (System.Drawing.Point value) [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cs:3179 
  at Grasshopper.GUI.GH_DocumentEditor.RestoreDialogPositionData () [0x0006d] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/GUI/GH_DocumentEditor.cs:168 
  at Grasshopper.GUI.GH_DocumentEditor.DocumentEditorFormLoad (System.Object sender, System.EventArgs e) [0x0002d] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/GUI/GH_DocumentEditor.cs:60 
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x0001f] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cs:2146 
  at System.Windows.Forms.Form.CallLoad () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:583 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:CallLoad ()
  at System.Windows.Forms.FormHelper.CallLoad () [0x0000f] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:134 
  at System.Windows.Forms.FormHelper.BecomeKeyWindow () [0x00008] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:146 
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_bool (intptr,intptr,bool)
  at AppKit.NSWindow.set_IsVisible (System.Boolean value) [0x00030] in <5dd442fafc4842c391a0a802c0c12c43>:0 
  at System.Windows.Forms.Form.set_VisibleInternal (System.Boolean value) [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:486 
  at System.Windows.Forms.Control.set_Visible (System.Boolean value) [0x00012] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.Cocoa.cs:1348 
  at System.Windows.Forms.Control.InternalShow () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:2377 
  at System.Windows.Forms.Form.InternalShow () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:367 
  at System.Windows.Forms.Control.Show () [0x00001] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Control.cs:2382 
  at System.Windows.Forms.Form.Show (System.Windows.Forms.IWin32Window parent) [0x000ad] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/MonoMac.Windows.Form/MonoMac.Windows.Forms/System.Windows.Forms/Form.cocoa.cs:416 
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Form:Show (System.Windows.Forms.IWin32Window)
  at Grasshopper.Plugin.Commands.ShowGrasshopperEditor (System.Boolean showUponLoad) [0x001ee] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/Plugin/GH_GrasshopperCommands.cs:73 
  at Grasshopper.Plugin.Commands.Run_Grasshopper () [0x0001f] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/Grasshopper/Plugin/GH_GrasshopperCommands.cs:139 
  at GrasshopperPlugin.GrasshopperCommand.RunCommand (Rhino.RhinoDoc doc, Rhino.Commands.RunMode mode) [0x00010] in /Users/curtis/Projects/McNeel/rhino/src4/rhino4/Plug-ins/Grasshopper_osx/GrasshopperPlugin/GrasshopperCommands.cs:17 
  at Rhino.Commands.Command.OnRunCommand (System.Int32 commandSerialNumber, System.UInt32 docSerialNumber, System.Int32 mode) [0x00035] in /Users/curtis/Projects/McNeel/rhino/src4/DotNetSDK/rhinocommon/dotnet/rhino/rhinosdkcommand.cs:311 
```
2018-01-29 11:02:33 +01:00
Jeffrey Stedfast d86b0822a4 [msbuild] Always codesign libraries and frameworks (#3341)
Fixes issue #3289
2018-01-29 10:56:03 +01:00
Rolf Bjarne Kvinge a3b425bf97
[AVFoundation] Remove AVCaptureDataOutputSynchronizer[Delegate] from macOS. (#3336)
This class and protocol were incorrectly added to our macOS bindings.

The catch is that we can't remove them because it would break backwards
compatibility, so mark them for removal in XAMCORE_4_0.
2018-01-29 07:39:06 +01:00
Rolf Bjarne Kvinge b2bcad7a94
Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299)
* [ObjCRuntime] Add a BindingImplAttribute.

* [linker] Make ProviderToString an extension method on ICustomAttributeProvider to make it more discoverable.

* [generator] Use [BindingImpl] instead of [CompilerGenerated].

The entire diff is big (89MB), so it can't be gisted. However, most of it is
either removal of `using System.Runtime.CompilerServices;` or the change from
`[CompilerGenerated]` to `[BindingImpl (...)]` like this:
https://gist.github.com/rolfbjarne/8bfda3ed37b956d0342a1c1e9b079244

If I remove those parts of the diff, there's nothing significant left:
https://gist.github.com/rolfbjarne/4156164d6bdb1376366200394eb8a091

* [linker] Teach the linker about the new [BindingImpl] attribute.

In addition to the existing logic where the linker would optimize some
[CompilerGenerated] code (sometimes with additional requirements), it will now
also optimize all [BindingImpl (Optimizable)] code (without any additional
requirements).

* [tests] Add tests to make sure [BindingImpl (Optimizable)] works as expected.

* [linker] Check for [BindingImpl] before [CompilerGenerated] and stop checking for [CompilerGenerated] in XAMCORE_4_0.

Check for [BindingImpl] before checking for [CompilerGenerated], since the
former is more common.

Also stop checking for [CompilerGenerated] (at least to mean that code is
optimizable) in our next non-compatible evolutionary leap (XAMCORE_4_0):

* [introspection] Impl a better typo check.
2018-01-26 18:38:23 +01:00
Rolf Bjarne Kvinge f0b2c254c7
[registrar] Merge the SharedStatic class into the StaticRegistrar class. (#3309)
The SharedStatic class is a leftover from when there were two static
registrars: the old one (OldStaticRegistrar) and the new one
(StaticRegistrar).

Since there's only one static registrar left (the old one died some time ago),
all the SharedStatic code can be put into the StaticRegistrar class.

There are no functional changes in this PR, only this refactoring.
2018-01-26 07:48:42 +01:00
Rolf Bjarne Kvinge 7d0c4d5b09
[tests] Skip High Sierra image filters in Classic tests. Fixes #622. (#3308)
Skip High Sierra image filters in Classic introspection tests, since the
Classic bindings won't be updated.

https://github.com/xamarin/maccore/issues/622
2018-01-26 07:46:54 +01:00
Rolf Bjarne Kvinge 61d3d399c8
[xharness] Don't try to parse inexistent or empty files. (#3306) 2018-01-26 07:39:05 +01:00
Marius Ungureanu b7230a1176 [Mmp] Allow multiple assemblies to be passed to generate the registrar (#3129)
By convention, the first assembly is the target platform assembly

* Add support for recursive extra search directories.
2018-01-25 19:57:44 -05:00
Rolf Bjarne Kvinge 8fb757fec6
[tests] Allow 11 frameworks in linked XM apps. Fixes maccore GH #615. (#3302)
Fixes this test failure:

    1) Failed : Xamarin.MMP.Tests.MMPTests.UnifiedWithLinking_ShouldHaveFewFrameworkClangLines
      Found more framework entries in clang invocation then expected - Foundation AppKit QuartzCore CoreData Quartz CoreFoundation CoreServices Security Carbon CloudKit
    		xcrun -sdk macosx clang -mmacosx-version-min=10.7 -arch x86_64 -fobjc-runtime=macosx -Wno-unguarded-availability-new -ObjC -framework Foundation -framework AppKit -framework QuartzCore -framework CoreData -framework Quartz -framework CoreFoundation -framework CoreServices -framework Security -framework Carbon -weak_framework CloudKit -u _xamarin_timezone_get_data -u _xamarin_get_block_descriptor /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac.a -o /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/bin/Debug/UnifiedExample.app/Contents/MacOS/UnifiedExample -D_THREAD_SAFE -I/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/pkgconfig/../../include/mono-2.0   /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/pkgconfig/../../lib/libmonosgen-2.0.a -liconv -x objective-c++ -I/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/include /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/obj/Debug/mmp-cache/registrar.m -fno-caret-diagnostics -fno-diagnostics-fixit-info -isysroot /Applications/Xcode92.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk /work/maccore/master/xamarin-macios/tests/mmptest/bin/Debug/tmp-test-dir/Xamarin.MMP.Tests.MMPTests.RunMMPTest/obj/Debug/mmp-cache/main.m
      Expected: less than 10
      But was:  10

This regressed in 4da8016db4, where new API is
partially unremovable by the linker, and as such causes XM to link with more
frameworks at build time.

This is expected, so change the test to accept more frameworks (11).

Fixes https://github.com/xamarin/maccore/issues/615.
2018-01-25 17:59:19 +01:00
Rolf Bjarne Kvinge 3910c7943a
[tests] Fix apitest to ignore CoreSpotlight on 32-bit since it's 64-bit only. (#3300)
Fixes this test failure on High Sierra:

    Xamarin.Mac.Tests.EveryFrameworkSmokeTests.ExpectedLibrariesAreLoaded: CoreSpotlightLibrary (/System/Library/Frameworks/CoreSpotlight.framework/CoreSpotlight) failed to load but this was not expected
2018-01-25 17:55:51 +01:00
Rolf Bjarne Kvinge b1d3a9109b
[registrar] Don't skip models when registering assemblies. (#3301)
Unfortunately models are not abstract, and users can create instances of them.
This means that the type must be registered - and that's exactly what happens
when the app tries to create such an instance: the dynamic registrar will
register it.

However, previously we didn't register the type when registering all the types
in an assembly, the type would only be registered when it was needed. This
prevents the static registrar from registering it, and it always ends up using
the dynamic registrar, which means the dynamic registrar will always be
required.

By not excluding models when registering all types in an assembly these types
are also included in the generated code from the static registrar, and we're
one step closer to being able to remove the dynamic registrar when using the
static registrar.
2018-01-25 15:45:12 +01:00
Manuel de la Pena b35b479cea
[Harness] Add the System.IdentityModel bcl tests. (#3295) 2018-01-25 10:19:41 +01:00
Rolf Bjarne Kvinge 90a2ac27b1
[linker] Implement a generic method of storing attributes the linker removes. (#3280)
* [linker] Implement a generic method of storing attributes that may be removed by the linker.

Implement a generic method of storing attributes that may be removed by the
linker, so that those attributes can be accessed after the linker has linked
them away.

* [linker] Store availability attributes using the new generic location.

* [linker] Store the CompilerGenerated attribute using the new generic location.
2018-01-24 15:58:47 +01:00
Rolf Bjarne Kvinge 45e01cf36b
[docs] Fix typo (MM -> MT). (#3293) 2018-01-24 15:58:25 +01:00
Manuel de la Pena 35806edb5a
[Harness] Add System.ServiceModel tests to the bcl tests. (#3238)
* [Harness] Add System.ServiceModel tests from the bcl.
2018-01-24 12:56:20 +01:00
Rolf Bjarne Kvinge 98993c467a
Update docs about build optimizations. (#3285)
* Show final link to official documentation in error help.
* Add makefile targets to copy docs to the documentation repo.
2018-01-24 07:26:09 +01:00
Rolf Bjarne Kvinge 03d78d13f3
[tests][mtouch] Simplify code to fetch symbols from a binary (nm). (#3286)
Simplify/refactor code to fetch symbols from a binary to reuse an existing
function instead of manually calling `nm` every time.
2018-01-24 00:31:32 +01:00
Rolf Bjarne Kvinge 77aac2ceef
[tests] Package linker tests too for the packaged XM tests. (#3287)
Make sure to package the linker tests when packaging XM tests (this broke
recently because the dontlink tests were moved).

Fixes this problem when running the packaged tests:

    make[2]: linker-mac/dont link/bin/x86/Debug/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-classic-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unified/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unified-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unifiedXM45/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unifiedXM45-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unified-32/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unified32-dont link] Error 1
    make[2]: linker-mac/dont link/bin/x86/Debug-unifiedXM45-32/dont link.app/Contents/MacOS/dont link: No such file or directory
    make[2]: *** [exec-mac-unifiedXM4532-dont link] Error 1
    exec-mac-classic-dont\ link failed
    exec-mac-unified-dont\ link failed
    exec-mac-unifiedXM45-dont\ link failed
    exec-mac-unified32-dont\ link failed
    exec-mac-unifiedXM4532-dont\ link failed
    make[1]: *** [exec-mac-dontlink] Error 1
2018-01-23 23:47:53 +01:00
Sebastien Pouliot ca06526793
[tests][monotouch] Remove the ignore on MPVolumeView added in xcode9 beta 3 - it seems to work fine now (#3284) 2018-01-23 08:27:18 -05:00
Rolf Bjarne Kvinge af03020eef
[mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp. (#3242)
* [mtouch/mmp] Give users more control over optimizations, and share more code between mtouch and mmp.

1. Add an --optimize flag to mtouch/mmp that allows users to select which
   optimizations to apply (or not). This makes it easier to add future
   optimizations, and allow users to disable any optimization that causes
   problems without having to disable many other features.

2. Share as much optimization code as possible between mtouch and mmp. This
   immediately gives a benefit to mmp, which has three new optimizations only
   mtouch had: NSObject.IsDirectBinding inlining, IntPtr.Size inlining and
   dead code elimination.

   This results in ~6kb of disk space saved for a linked Xamarin.Mac app:

   * link sdk: [Debug][1], [Release][2]
   * link all: [Debug][3], [Release][4]

Testing also verifies that monotouchtest ([Debug][5], [Release][6]) has not
changed size at all, which means that no default optimizations have changed
inadvertedly.

[1]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--debug
[2]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-sdk-mac--release
[3]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--debug
[4]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#link-all-mac--release
[5]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonedebug64
[6]: https://gist.github.com/rolfbjarne/6b731e3b5ca6170355662e6505c3d492#monotouchtest-iphonerelease64

* [tools] Don't enable the IsDirectBinding optimization by default for Xamarin.Mac apps, it's not safe.

* Fix whitespace issues.

* [doc] Document optimizations.

* Officially support optimizations by adding them to the Versions.plist.

* [linker] Improve IntPtr.Size inliner + dead code eliminatior and add tests.

* Properly handle operands for the ldc_i4_s instruction (they're sbyte).
* Fix less-than condition to actually do a less-than comparison.
* Make sure to look up the bitness in the Target, not the Application, since
  the Application's value will be incorrect when building fat apps (both
  Is32Build and Is64Build will be true).
* Remove unnecessary checks for the IntPtr.Size inliner: this optimization
  does not depend on other instructions than the IntPtr.get_Size call, so
  remove the checks that verify surrounding instructions. This makes the
  IntPtr.Size inliner kick in in more scenarios (such as the new tests).
* Add tests.

* [tests] Add mmp tests for optimizations.

* [tests] Fix XM optimization tests.

* [tests] Fix test build error.
2018-01-23 11:33:48 +01:00
Sebastien Pouliot e8e196673b
[foundation] Fix typo in INSFilePresenter.P[r]esentedItemOperationQueue. Fixes #3272 (#3281)
Sadly that was not enough to trigger the typo detector test. It's also
part of a protocol, which means a .net interface so it cannot be fixed
without a breaking change. As such the fix is under `XAMCORE_4_0`

Fixes https://github.com/xamarin/xamarin-macios/issues/3272
2018-01-22 21:45:28 -05:00
Rolf Bjarne Kvinge 398f430a55
[msbuild] Fix Makefile warning by removing duplicate target. (#3277)
Fixes this warning:

> Makefile:317: target `/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/msbuild/iOS' given more than once in the same rule.

because the same directory was listed twice.
2018-01-22 22:30:27 +01:00
Rolf Bjarne Kvinge 369271d7b8
[runtime] Remove specialized function for getting the Selector/Class handle of a managed Selector/Class instance. (#3227)
* [runtime] Remove specialized function for getting the Selector/Class handle of a managed Selector/Class instance.

The existing function to get the handle of an INativeObject works just as fine.

* [runtime] Store and use a prebuilt XamMacLauncher.

Some changes in the runtime needs corresponding changes in XamMac.dll, but
since we're not changing XamMac.dll anymore, we can't change the runtime
either.

This means that we must add XamMacLauncher to the list of binaries we copy.

* [runtime] Store and use a prebuilt libxammac*.a as well.
2018-01-22 21:16:41 +01:00
Rolf Bjarne Kvinge dadf5ca6e6
[mtouch] Make sure the xamarin_localized_string_format* functions are available in simlauncher. Fixes #3265. (#3269)
* [mtouch] Make sure the xamarin_localized_string_format* functions are available in simlauncher. Fixes #3265.

Fixes https://github.com/xamarin/xamarin-macios/issues/3265.

* [mtouch] Add test for simlauncher symbols, add add more missing symbols.
2018-01-22 14:21:24 +01:00
Rolf Bjarne Kvinge 64e85fac75
[xharness] Fixup paths in the Exclude attribute of Include nodes in csprojs as well. (#3267)
Fixes this rather puzzling build problem when building monotouch-test using xharness:

    obj/iPhoneSimulator/Debug-unified/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs(2,12): error CS0579: Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute

It happens only on Wrench (where it consistently fails), but it didn't happen
in the PR when this broke, nor could I reproduce it locally at first.

Initial investigation proved frustrating (searching for the file name
`Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs` in the build log confirmed
that it was included multiple times on Wrench, but not locally), but after a
while I realized that there were multiple files with the same file name in the
build log:

     /Users/builder/data/lanes/1381/daf07005/source/xamarin-macios/tests/monotouch-test/obj/iPhone/Release64-unified/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs
     obj/iPhoneSimulator/Debug-unified/Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs

One full path, and one relative, and one is obviously wrong.

Even more so once I realized that the full path's Platform/Configuration
(`iPhone/Release64-unified`) doesn't match the relative path's
Platform/Configuration (`iPhoneSimulator/Debug-unified`).

It's not even a test configuration we execute on Wrench, so how come the file
got there in the first place?

But it made it possible to reproduce locally: I just had to build monotouch-
test for device first, using tests.sln. Then I could reproduce the build error
when executing monotouch-test from xharness, since now I had the extraneous
file on my file system.

xharness will clone project files (to avoid parallel issues when building
multiple projects in parallel, all projects are built in their own
directories), and it turns out we didn't properly fixup all paths.

In particular the following:

    <Compile Include="**\*.cs" Exclude="obj\**">
      <Link>%(RecursiveDir)%(Filename).cs</Link>
    </Compile>

would be transformed into:

    <Compile Include="\Users\builder\data\lanes\1381\daf07005\source\xamarin-macios\tests\monotouch-test\**\*.cs" Exclude="obj\**">
      <Link>%(RecursiveDir)%(Filename).cs</Link>
    </Compile>

which meant that we'd include all files recursively in the monotouch-test
directory, excluding files from the project file's obj sub directory. And
since the project file was cloned, it would be in a different directory, and
thus not able to exclude files from the original monotouch-test/obj directory.

And with this knowledge the simple oneliner to fix it was trivial.

One mystery remained though: how was the extraneous
`Xamarin.iOS,Version=v1.0.AssemblyAttribute.cs` file generated when we don't
execute device tests on Wrench? After a while I remembered that the MTouch
tests build monotouch-test for device, even though they're not executed.

And this explains why the problem happens on wrench only: Jenkins didn't
execute the MTouch tests.
2018-01-22 10:49:38 +01:00
Sebastien Pouliot f5df902049
[foundation] Add NSBundle.GetLocalizedString returning an NSString. Fixes #41292 (#3266)
The original, now obsoleted, `LocalizedString` API returned a .net
`string` which does not work in most cases.

Different versions of iOS seems to return different (public or internal)
subclasses of `NSString` that are understood by other API (like NSString
`localizedStringWithFormat:`) for further customization.

Our logic to convert NSString to string is correct but it cannot
recreate the custom, required subclass to continue the localization.

So the new API return an `NSString` publicly (which is actually a
subclass) that can do the required job.

Adding a test in monotouch-test is presently blocked by #3265 [2]

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=41292
[2] https://github.com/xamarin/xamarin-macios/issues/3265

* Add tests for new (and old) NSBundle API and adjust old ones since adding a Base.lproj directories changes things

* Add localization to xammac_tests since it shares the same, updated tests
2018-01-20 14:00:01 -05:00
Sebastien Pouliot dc7b19ce15
[tests] Confirm a device/sim support Metal before running MetalPerformanceShaders tests. Fixes #3237 (#3268)
https://github.com/xamarin/xamarin-macios/issues/3237
2018-01-19 11:21:21 -05:00
Vincent Dondain e6ee7c5e2f
[msbuild] Add missing {1} in LogMessage (#3262) 2018-01-19 10:27:14 -05:00
Rolf Bjarne Kvinge daf0700543
[xharness] No need to try to run (or even show) non-executable projects. (#3264) 2018-01-19 07:08:13 +01:00
Rolf Bjarne Kvinge 86a51076ed
[xharness] Adjust colors a bit. (#3263)
When determining the color for a collection of tests, first check if the
execution result is identical for all tests in the collection, in which case
just use the corresponding color for a single test.
2018-01-19 07:06:50 +01:00
Jeffrey Stedfast 7b663d11f1
[msbuild] Resolve a Provisioning Profile if needed for iOS Sim builds (#3244) 2018-01-18 16:29:14 -05:00
Jeffrey Stedfast 6d73e7634b
[msbuild] Fixed embedding of provisioning profiles for tvOS (#3255)
Instead of hard-coding the platform as iOS for the EmbedMobileProvision
task, use the SdkPlatform to determine the appropriate platform to use
in the MobileProvisionIndex query.

This is a follow-up fix with near identical changes to the
CompileEntitlements fix for tvOS.
2018-01-18 15:17:57 -05:00
Vincent Dondain 4da8016db4
[xtro] Report missing-protocol-conformance when protocols are defined… (#3187)
- Fixes bug #59272: [xtro] Report !missing-protocol-conformance! when protocols are defined in categories
(https://bugzilla.xamarin.com/show_bug.cgi?id=59272)
- Implemented missing protocol conformances based on tool's new data.
- Remove Internal check from VisitObjCCategoryDecl and VisitObjCInterfaceDecl
- Ignore previewItemTitle failure (normal since it's optional)
- Only skip UIStateRestoring for subclasses of UIViewController
- Ignore UIStateRestoring test on watchOS (UIViewController not available)
- Remove protocol conformances that generated wrong availability attributes (https://github.com/xamarin/xamarin-macios/issues/3213)
- Avoid new virtual or virtual when adding protocol conformance (https://github.com/xamarin/xamarin-macios/issues/3217)
2018-01-18 13:41:09 -05:00
Rolf Bjarne Kvinge 75e851fdda
[install-source] Add console runner from Nuget and fix xharness to restore nugets before attempting to build. (#3251)
xharness needs a solution in order to ask for a nuget restore, so make sure to
provide the path to the solution.

This fixes a build issue where the install source tests would fail to build
due to picking up the system's nunit.framework.dll because the nuget one
wasn't found/restored:

    MonoPathManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    XamarinSourcesPathManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    OpenTKManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    PathManclerFactoryTests.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    OpenTKManglerTest.cs(29,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(30,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(29,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(30,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(31,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(33,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(35,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(36,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(38,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(39,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(47,4): error CS0616: 'TestCase' is not an attribute class
2018-01-18 16:58:56 +01:00
Rolf Bjarne Kvinge eefdd17e15
[xharness] Fix Makefile generation of grouped targets with spaces. (#3250)
These targets will already be properly escaped (using backslash), so adding
quotes will cause make to treat the backslashes literally (and break).

Fixes an issue with package-tests:

    $ make package-tests
    [...]
    build-mac-classic-dont\ link failed
    build-mac-unified-dont\ link failed
    build-mac-unifiedXM45-dont\ link failed
    build-mac-unified32-dont\ link failed
    build-mac-unifiedXM4532-dont\ link failed
    build-mac-unified-link\ all failed
    build-mac-unified-link\ sdk failed
    make[4]: *** [build-mac] Error 1
    make[3]: *** [mac-test-package.zip] Error 2
    make[2]: *** [package-tests] Error 2
2018-01-18 09:08:20 +01:00
Rolf Bjarne Kvinge 034ce91212
[xharness] Add project configuration to run Jenkins-style tests. (#3249) 2018-01-18 07:16:24 +01:00
Rolf Bjarne Kvinge dee0fd984a
[xharness] Run monotouch-test both with and without the static registrar in the simulator. (#3236)
* [xharness] Run monotouch-test both with and without the static registrar in the simulator.

This way we catch (some) problems with the static registrar without having to run on device.

* [xharness] Add comments to explain extra test configurations.

* [xharness] Fix how projects are cloned.

Fix how projects are cloned so that xharness doesn't end up confused when
multiple test tasks share the same build task.

Previously xharness would iterate over all test tasks and modifying their
build tasks, now it will create the build tasks correctly in the first place.
2018-01-18 07:14:07 +01:00
Jeffrey Stedfast bb2a0faca4 [msbuild] Fixed provisioning profile lookups for tvOS (#3216) 2018-01-17 15:18:34 -05:00
Alex Soto daf74d664c [CoreImage] Enabled ImageRepresentation strong dictionary helpers, fixes bugzilla #59294 (#3240)
https://bugzilla.xamarin.com/show_bug.cgi?id=59294

This enables ImageRepresentation strong dictionary helpers.

--- A note about WrapAttribute

Whenever we use the `WrapAttribute` inside a `Category` we need to
include the `This` parameter as the first argument inside the Wrap
signature, like the following example:

```csharp

[Wrap ("WriteTiffRepresentation (This, image, url, format, colorSpace, options?.Dictionary, out error)")]
bool WriteTiffRepresentation (CIImage image, NSUrl url, CIFormat format, CGColorSpace colorSpace, CIImageRepresentationOptions options, out NSError error);
```
2018-01-17 08:59:01 -05:00
Rolf Bjarne Kvinge 580ad2b826
[ImageKit] Fix a few protocols to be informal. (#3235)
* [ImageKit] Fix a few protocols to be informal.

Both of these protocols have been informal (categories) since their
introduction in macOS 10.5 (and they've not been made real protocols either).

    $ git grep interface.*IKImageBrowserDataSource
    MacOSX10.5.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.6.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.8.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.9.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.10.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.11.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.12.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)
    MacOSX10.13.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserDataSource)

    $ git grep interface.*IKImageBrowserItem
    MacOSX10.5.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.6.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.7.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.8.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.9.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.10.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.11.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.12.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)
    MacOSX10.13.sdk/System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/Headers/IKImageBrowserView.h:@interface NSObject (IKImageBrowserItem)

* [xtro] Update ignored data.
2018-01-16 23:32:37 +01:00
Marius Ungureanu 6d9ea19cab [Registrar] Do less work when probing for assembly registration. (#3222)
If the assembly is registered in the static registrar, skip it before trying to probe whether it has a reference or not. A dictionary lookup is way faster than probing the referenced assemblies
2018-01-16 19:18:46 +01:00
Rolf Bjarne Kvinge b699a0b29c
[tests] Create 'link all' and 'link sdk' tests for XM. (#3234)
* [tests] Add 'link all' test for XM.

* [tests] Add 'link sdk' test for XM.

* [tests] Move dontlink-mac tests to linker-mac directory to have the same directory layout as linker-ios.
2018-01-16 19:15:59 +01:00
Sebastien Pouliot 761a382f01
[macos][mediatoolbox] Add a macOS specific API for XM (#3220)
- added unit test (not much to test)
- xtro data updated
2018-01-16 08:42:11 -05:00
Alex Soto 76dcf100b3 [generator] Support [Async] inside categories, fixes bugzilla #57531 (#3229)
https://bugzilla.xamarin.com/show_bug.cgi?id=57531

Adds support for [Async] inside categories.
2018-01-16 08:41:25 -05:00
Sebastien Pouliot 864e30516c
[macos][webkit] Allow a null DomRange inside WebView.SetSelectedDomRange. Fixes #3206 (#3232)
as documented in
https://developer.apple.com/documentation/webkit/webview/1408363-setselecteddomrange?language=objc

Reference:
https://github.com/xamarin/xamarin-macios/issues/3206
2018-01-16 08:39:45 -05:00
Manuel de la Pena a52748277d [CoreGraphics] Fix issue with the MakeMutable in CGPath where ref count was leaking. (#3228) 2018-01-15 16:35:05 -05:00
Rolf Bjarne Kvinge f43cb7eefa
Update .gitignore with directory newer versions of VSfM creates. (#3225) 2018-01-15 18:54:02 +01:00
Rolf Bjarne Kvinge 7079a0581f
[tests] Disable some old-style tests on wrench, long live the new-style tests. (#3226)
These were accidentally not disabled when we started running tests on Wrench
like we do on Jenkins.

So disable them, to avoid duplicate work on Wrench.
2018-01-15 18:53:52 +01:00
Rolf Bjarne Kvinge b4195aba9c
[runtime] Generate a header with the function declarations to call into managed code. (#3224)
We already have the information we need to generate these function
declaration, so this prevents the need for keeping information in two
different places up-to-date.
2018-01-15 15:08:59 +01:00