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

2767 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 74f1bb0acc [mmptest] Delay test directory cleanup until next test run. (#2115)
Use our Cache.CreateTemporaryDirectory method which will clean up the test
directories on the next test run (instead of when a test is done).

This makes it easier to inspect temporary test files after a test has
completed.
2017-05-22 17:44:06 +02:00
Rolf Bjarne Kvinge 9b872a154a [mmp] Fix release builds when not embedding mono. (#2114)
The generated registrar code must be built with -DDYNAMIC_MONO_RUNTIME so that
it references our local mono functions which do a dynamic function lookup.

This fixes an issue where release builds that don't embed mono fails to link,
because there are numerous unresolved externals pointing to mono symbols.
2017-05-22 07:39:10 +02:00
Rolf Bjarne Kvinge fafaa91790 [tests] Update tests-mac.sln to make sure configurations are right. (#2113)
I don't quite understand VSfM's problem with the existing configuration (it
wouldn't build mmptest, claming an invalid solution configuration), but
hopefully these will work fine.
2017-05-22 07:36:51 +02:00
Alex Soto e8aa3db9cb [msbuild] Remove BTouchReferencePath in order to fix bug 56317 (#2105)
https://bugzilla.xamarin.com/show_bug.cgi?id=56317

BTouchReferencePath scans for satellite assemblies and brings
dlls that are not referenced from within the binding project and
this causes compiler error CS1704 when dlls that contain
localized resources and said dlls are named equally.

* [msbuild][tests] Add testcase for bug 23674 to avoid regresions

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

* [msbuild][tests] Add testcase for bug 56317

https://bugzilla.xamarin.com/show_bug.cgi?id=56317
2017-05-19 15:34:05 -04:00
Alex Soto b75f8eda31 [generator] Create CVPixelBuffer using GetINativeObject so its usable from 3rd party bindings (#2111)
* [generator] Create CVPixelBuffer using GetINativeObject so its usable from 3rd party bindings

Complements https://bugzilla.xamarin.com/show_bug.cgi?id=52665
and PR #2102

CVPixelBuffer was created using the internal handle ctor, this
did not allow 3rd party bindings to bind it correctly since it
generated not compilable code.

We now use Runtime.GetINativeObject<CVPixelBuffer> (ptr, false); just
like the base ctor https://git.io/vHvLj.

* [tests] Add IntPtr.Zero check and fix link in code

* [generator] Make comment easier to find
2017-05-19 11:10:22 -05:00
Rolf Bjarne Kvinge 0c87730ff1 [mtouch] Fix linking with the same third-party framework from both extension and container app. Fixes #56635. (#2112)
If both an extension and the container app (or multiple extensions) reference
the same binding assembly for a framework, then we'd error out with an
internal error when trying to copy the framework from both locations to the
container app.

So instead detect when we're trying to copy multiple identical (by comparing
the on-disk contents) frameworks, and only copy one of them.

We'll still show an error if the frameworks are different, but now a nice
MT1035 error with a proper error description instead of an internal error.

https://bugzilla.xamarin.com/show_bug.cgi?id=56635
2017-05-19 17:05:38 +02:00
Rolf Bjarne Kvinge 9466ae5080 [registrar] Support 'out' parameters from NULL pointers. Fixes #54919. (#2106)
[registrar] Support 'out' parameters from NULL pointers. Fixes #54919.

Native code doesn't have the 'out' and 'ref' distinction C# has, and passes
NULL around left and right.

So make sure the generated code from the static registrar doesn't write to such NULLs.

https://bugzilla.xamarin.com/show_bug.cgi?id=54919
2017-05-19 12:07:12 +02:00
Timothy Risi 3d560803b4 [macos][webkit] Bind WebView.SetSelectedDomRange Fixes #32612
https://bugzilla.xamarin.com/show_bug.cgi?id=32612
2017-05-18 11:05:04 -08:00
Alex Soto 9621842016 [generator] Deriving from certain protocol interfaces generates uncompilable code. Fixes bug 52665 (#2102)
Some namespaces are missing on generated files, causing error CS0246
The type or namespace name `Foo` could not be found.

While fixing this another error arose, by enabling the following test

[Protocol] interface C140 : ICIImageProcessorInput {}

some codepaths leads to CVPixelBuffer creation which our code
tries to invoke the handle ctor and fails to find it because it
is internal. This will be fixed in a different commit.
2017-05-18 12:42:57 -04:00
Sebastien Pouliot ba06a4c8f4 [macos][mmp] Fix RemoveSelectors when generics are used, Fix #55693 (#2104)
This XM-only RemoveSelectors works on FieldDefinition but in some cases,
e.g. inside a generic types, it's FieldReference that are encoded. This
meant the static constructor was not re-written correctly and would throw
a TargetInvocationException (since the fields were removed correctly)

https://bugzilla.xamarin.com/show_bug.cgi?id=55693
2017-05-18 08:45:23 -04:00
Sebastien Pouliot 5c98306c86 [linker] Fix OptimizeGeneratedCodeSubStep when used with csc without /optimize. Fix #53872 (#2101)
`csc` without `/optimize` generates different IL, including additional
and not required load and store instructions. We previously ignored them
but that could leave the stack unbalanced leading to runtime exceptions.
We are now nop'ing the extraneous instructions (same as the rest of the
unneeded branch code)

This fixes #53872 [1] and also the known parts of #56209 (the other parts
are still NEEDINFO and could, possibly, be unrelated).

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=53872
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=56209#c2
2017-05-18 08:43:07 -04:00
Sebastien Pouliot 6f68ab6f79 [tests][security] Re-enable some tests inside KeyTest. Fix #51277 (#2103)
The minimum size for RSA keypairs is 1024 bits on macOS while it is
512 bits on iOS. Some tests using the minimum size (because we test the
API not the security) were disable on macOS. This re-enables them using
the platform minimum.

https://bugzilla.xamarin.com/show_bug.cgi?id=51277
2017-05-17 21:59:35 -04:00
Sebastien Pouliot 19d06fbcfc [macos][appkit] Provide a better API for NSWindow.EndSheet (and obsolete the existing one) (#2100) 2017-05-17 09:31:12 +02:00
Sebastien Pouliot 845f365c91 [mmp] Add support for linking only the platform (Xamarin.Mac.dll) assembly on the full profile (#1990)
Replace https://github.com/xamarin/xamarin-macios/pull/1973 expect that
the test parts are still needed.

* Add XM SDK + LinkSkip test

* [macos] Add platform linking support to msbuild

* [macos] Add full SDK test

* [macios] Diable classic from using linkplatform

- Extended test infrastructure change to allow classic projects that include bundling
- Setting linkplatform in MonoBundlingExtraArgs since we don't even read project setting LinkMode - Platform for classic
2017-05-16 18:05:26 -04:00
Timothy Risi cdbe2ff040 [macos] Add hybrid-aot feature string (#2041) 2017-05-16 15:11:38 -04:00
Rolf Bjarne Kvinge 8936a2f605 [ObjCRuntime] Only use a 'BundleFinder' class when we don't have another internal type we can use. Fixes #56255. (#2099)
* [ObjCRuntime] Only use a 'BundleFinder' class when we don't have another internal type we can use. Fixes #56255.

Inside our platform assemblies, we can use the NSObject.NSObject_Disposer
class to find the bundle (this class is not binding an existing Objective-C
class, which would make it unusable for this purpose, and it's also needed
always, which means we're not adding unnecessary bloat to linked platform
assemblies).

However, for System.Net.Http.dll, I couldn't find any publicly visible type
that would fit those criteria, so we're still using a custom 'BundleFinder'
class.

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

* [ObjCRuntime] Use an InternalsVisibleTo attribute to always use NSObject_Disposer to find the bundle.

Make our platform internals visible to System.Net.Http.dll so that we an use the NSObject_Dispose type there as well.
2017-05-16 20:50:10 +02:00
Chris Hamons 562560d936 Fixup Xamarin.Mac Hybrid AOT and improve testing (#1995)
- Actually enable hybrid AOT by adding argument in right location
- Hybrid AOT and stripping does not play well currently with partial AOT
- Fix AOT makefile to work with nuget nunit
- https://bugzilla.xamarin.com/show_bug.cgi?id=55041
2017-05-16 13:29:08 -05:00
Chris Hamons 30cf1fd626 [macos] Fix Multiple Native References (#2073)
- https://bugzilla.xamarin.com/show_bug.cgi?id=56098
- "%(NativeReference) was invoking mmp task multiple times incorrectly, move to what XI is doing
2017-05-16 09:59:55 -05:00
Rolf Bjarne Kvinge 4785dedb52 Bump Touch.Unit to get a hopefully helpful debug message. (#2084)
commit spouliot/Touch.Unit@055659f10a
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Wed May 10 16:23:43 2017 +0200

    [TouchRunner] Print something before exiting. (#45)

    This might help us narrow down https://bugzilla.xamarin.com/show_bug.cgi?id=56162.
2017-05-16 12:48:37 +02:00
Rolf Bjarne Kvinge 425274ac2f [runtime] Fix the executable name we use for embedded. (#2095)
We need to know the executable name to deduce the assembly name for the main assembly.
2017-05-16 12:46:51 +02:00
Rolf Bjarne Kvinge a4214e9c95 [build] Fix dependencies for various files to rebuild more intelligently when needed. (#2094)
* [src] Rebuild Constants.cs when Make.config.inc changes.

Also unify the makefile targets/dependencies for the various Constants.cs recipes.

* [build] Fix dependencies for various installed files.

Some auto-generated installed files with version numbers must depend on
Make.config.inc, since that's where the revision number is stored.

Make.config.inc depends on Makefile, so there's no need to depend on Makefile
as well.

* [build] Fix build error.
2017-05-15 20:13:02 -04:00
Rolf Bjarne Kvinge f8885d00df [runtime] Print any dialogs messages to the console as well. (#2090)
I've spent way too much time looking at the console waiting for things to
appear, all the while a dialog has hid away beneath other windows on my
system, waiting indefinitely for my attention.
2017-05-15 20:12:34 -04:00
Chris Hamons f64184cbbb Remove NSFileManagerUnmountOptions and unmountVolumeAtURL:options:completionHandler: from XI (#2078)
- "Code behind" files such as src/Foundation/Enum.cs are not processed by the generator and [NoiOS] are not skipped. #if are needed
2017-05-15 13:09:07 -05:00
Chris Hamons 18c5e14d98 [macos] Remove linking / registrar restrictions on extensions (#2092)
- [Preserve] on Init is all that is needed now (unsure if additional fixes happened in time since extensions were added)
- https://bugzilla.xamarin.com/show_bug.cgi?id=43197
2017-05-15 13:06:08 -05:00
Sebastien Pouliot f7a689c239 Bump versions after the //build preview (#2093) 2017-05-11 13:02:27 -04:00
Rolf Bjarne Kvinge 5350fc3cd8 [runtime] Rework initialization for Xamarin.Mac extensions. (#2091)
* [runtime] Fix broken indentation to make code less confusing.

* [runtime] Rework initialization for Xamarin.Mac extensions.

1. Delay the Application.Init execution from step 6 in the initialization
   sequence, to when we'd run the managed Main function for a normal app. This
   makes the code a bit easier to reason about, since both code paths behave
   more similar. It's also matches the initialization documentation better
   (step 6 is "find the executable", not "find the executable and run
   Application.Init").

2. Install custom callbacks for mono's logging function just before calling
   Application.Init. We already install these custom callbacks in
   xamarin_initialize, but that doesn't help much if something goes wrong
   before xamarin_initialize is called (and there's no harm in doing this
   twice).

3. Treat the extension dll as an entry assembly, make the path to the entry
   assembly available to managed code, and load this assembly if
   Assembly.GetEntryAssembly can't find it (which happens for extensions,
   since there's no entry point as Assembly.GetEntryAssembly defines an entry
   assembly).

This fixes launching of Xamarin.Mac extensions.

* [runtime] Spaces -> tabs.
2017-05-11 17:44:58 +02:00
Rolf Bjarne Kvinge c3cecd577f [runtime] Fix XM extension launch mode. (#2086) 2017-05-11 10:28:56 +02:00
Rolf Bjarne Kvinge 47319eb878 [mtouch] Strip less when running in embeddinator mode. (#2085)
Passing -x (not remove global symbols) to strip seems to work fine.
2017-05-11 10:27:27 +02:00
Rolf Bjarne Kvinge e7918cc9f8 [ObjCRuntime] Remove superfluous $ in error message. (#2087) 2017-05-11 10:18:33 +02:00
Rolf Bjarne Kvinge 938c7fae93 Bump MonoTouch.Dialog to get compiler warning fix. (#2080)
commit migueldeicaza/MonoTouch.Dialog@c2c64825ba
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Wed May 10 11:09:16 2017 +0200

    Fix tvOS compiler warning.

    Fix never assigned warning by conditionally remove all usages and the
    definition of the variable (instead of just some usages):

    > MonoTouch.Dialog/MonoTouch.Dialog/DialogViewController.cs(47,15): warning CS0649: Field 'DialogViewController.searchBar' is never assigned to, and will always have its default value null
2017-05-10 17:18:10 +02:00
Rolf Bjarne Kvinge d395249480 [xharness] Set the test name correctly so that macOS and iOS variations of the same tests are grouped together in the html report. (#2082)
This affects introspection-ios/introspection-mac (which are now grouped in an
`introspection` test), and dontlink-mac (which now shows up in the `dont link`
tests).
2017-05-10 17:17:39 +02:00
Rolf Bjarne Kvinge c58996b604 [xharness] Remove duplicated code. (#2083)
This chunk of code is repeated 30 lines below.
2017-05-10 17:17:10 +02:00
Rolf Bjarne Kvinge d5a69906c1 [xharness] Make sure different variations of the xammac tests aren't run in parallel. Fixes #56161. (#2081)
We run the xammac tests both in Debug and Release mode now, but those two
modes can't be run in parallel, so make sure they don't.

https://bugzilla.xamarin.com/show_bug.cgi?id=56161
2017-05-10 17:16:40 +02:00
Rolf Bjarne Kvinge 3ab52d9cb7 [mk] Explain how to skip version checks when version checks fail. (#2079) 2017-05-10 16:40:31 +02:00
Rolf Bjarne Kvinge a3264f64d6 Merge pull request #2074 from rolfbjarne/mmp-framework
[Xamarin.Mac] Add support for building to a framework for the embeddinator.
2017-05-10 12:02:51 +02:00
Rolf Bjarne Kvinge d811ef4c39 [mtouch] Fix stripping of embeddinator frameworks. (#2075) 2017-05-10 10:10:49 +02:00
Rolf Bjarne Kvinge 469133a8fd [ObjCRuntime] Remove XM limitation. Fixes #55857. (#2076)
* [ObjCRuntime] Remove XM limitation. Fixes #55857.

I can't remember why I added this limitation, and git history provides now
clues.

Everything compiles without the limitation, and the bug is fixed, so I can't
see a reason not to fix it.

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

* [tests] Run xammac tests both in Debug and Release configurations.
2017-05-10 10:08:56 +02:00
Rolf Bjarne Kvinge 477f5dc561 [mmp] The partial static registrar can't be used with custom managed exception marshaling. Fixes #55870. (#2064)
This is because the generated output from the static registrar depends on the
managed exception marshaling mode, and the partial static registrar executes
with the default managed exception marshaling mode.

https://bugzilla.xamarin.com/show_bug.cgi?id=55870
2017-05-10 07:24:53 +02:00
Sebastien Pouliot 7571635efb [apidiff] Update the current references to d15-2 branch (#2077) 2017-05-09 13:59:55 -04:00
Rolf Bjarne Kvinge 98777d5774 [runtime] Teach our runtime about where things are when in embeddinator mode on macOS. 2017-05-09 08:12:39 +02:00
Rolf Bjarne Kvinge c95034fb2a [mmp] Add support for building to a framework for the embeddinator. 2017-05-09 08:12:39 +02:00
Rolf Bjarne Kvinge 79cb93155e [mmp] Add support for creating an Info.plist when building a framework for the embeddinator. 2017-05-09 08:12:39 +02:00
Rolf Bjarne Kvinge 6f512bfd36 [ObjCRuntime] We must look in all loaded libraries for internal symbols when in embeddinator mode.
With the embeddinator the xamarin symbols are not in the main executable, so
we need to look in all libraries for them.
2017-05-09 08:12:39 +02:00
Rolf Bjarne Kvinge 462cff5680 [AppKit] We require Application.Init always.
For the embeddinator there might not be anybody calling Application.Init,
which means the linker will remove it.

However our runtime needs it (and asserts if it can't be found), so make sure
it's always available.
2017-05-09 08:12:39 +02:00
Rolf Bjarne Kvinge ad3a4a12eb [runtime] Store the launch mode in a static variable.
Store the launch mode in a static variable instead of storing if we're an
extension (since the launch mode also contains that information).

Also pass the launch mode around in Xamarin.Mac's initialization data.
2017-05-09 08:12:39 +02:00
Rolf Bjarne Kvinge 0a6dba5bba [xharness] Reduce code duplication a bit. (#2071) 2017-05-09 07:34:11 +02:00
Rolf Bjarne Kvinge 03589db5ba [mmp/mtouch/ObjCRuntime] Calculate the path to the runtime-options.plist using NSBundle's ResourcePath. (#2072)
* [mmp/mtouch/ObjCRuntime] Calculate the path to the runtime-options.plist using NSBundle's ResourcePath.

The anatomy of apps and frameworks differ between iOS and macOS:

* iOS: we put runtime-options.plist in the root directory of the app.
* macOS:
  * for apps we put runtime-options in foo.app/Contents/Resources
  * for frameworks we put runtime-options in foo.framework/Versions/Current/A/Resources

Luckily NSBundle's ResourcePath property returns exactly this path, so change
our logic to use this property.

Also calculate the NSBundle using an exported type we know we have (using the
main bundle won't work when we're a framework).

* [tests] Add mmp/mtouch tests to verify the default HttpClientHandler according to build arguments.

* [ObjCRuntime] Use a custom class for finding the bundle.

Use a self-defined custom class to find the bundle where our resources are.
Using the internal NSObject.NSObject_Disposer class doesn't work when this
file (RuntimeOptions.cs) is compiled into System.Net.Http.dll.
2017-05-08 17:58:21 +02:00
Rolf Bjarne Kvinge 336dc74fa2 [tests] Convert mmp tests to a standard NUnit test library. (#2067)
* [tests] Convert mmp tests to a standard NUnit test library.

* [xharness] Add support for restoring nugets before building projects.

And restore nugets for tests-mac.sln before building mac test projects.
2017-05-08 13:20:01 +02:00
Rolf Bjarne Kvinge 73c56ba4f5 [mmp] Accept the same paths for --sdkroot as mtouch accepts. (#2065)
Given Xcode.app in /Applications/Xcode.app, mmp now accepts:

* --sdkroot=/Applications/Xcode.app
* --sdkroot=/Applications/Xcode.app/Contents
* --sdkroot=/Applications/Xcode.app/Contents/Developer

All were accepted in mtouch, but only the last one was previously accepted in
mmp.
2017-05-05 10:44:32 -04:00
Rolf Bjarne Kvinge 6c98ed2956 [tests] Fix spleling. (#2066) 2017-05-05 15:11:11 +02:00