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

4489 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 9f0d2f52f5
[apidiff] Update XML references with 15.8 as the new base (master) (#4673) 2018-08-27 18:29:44 -04:00
Rolf Bjarne Kvinge 7e8ffdf2ec
Document how to run API comparison locally. (#4699) 2018-08-27 16:46:22 +02:00
Rolf Bjarne Kvinge 3e661ae5f2
Make the bgen build respect the BUILD_DIR variable. Fixes maccore#959. (#4700)
* [src] Fix bgen build to support custom output directory for api comparison. Fixes maccore#959.

This broke in 87c27e0c3f, which made bgen
compile using a project file (I forgot to verify that it wouldn't affect the
API comparison, and the PR build didn't complain because problems with the API
comparison typically show up in subsequent PRs).

https://github.com/xamarin/maccore/issues/959

* [src] Fix response file usage to use BUILD_DIR, so that API comparison can redirect as expected.

* [src] Fix generation of generator.csproj's dependency file to use BUILD_DIR, so that API comparison can redirect as expected.

* [src] Fix bgen.exe's dependencies.

* Use full paths to create-makefile-fragment.sh.
2018-08-27 16:46:01 +02:00
Rolf Bjarne Kvinge 87c27e0c3f
Merge pull request #4683 from rolfbjarne/issue-4384
[mtouch/mmp/generator] Build using project file instead of manually creating compiler command line. Fixes #4384.
2018-08-23 17:32:06 +02:00
Rolf Bjarne Kvinge 759c3f22b4 [mtouch] Build using csproj instead of manual csc command. Partial fix for #4384.
* Make sure mtouch.csproj builds using the same compiler arguments as the makefile used.
* Build mtouch.exe using msbuild in the makefile, and clean up the resulting unused make logic.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/4384.
2018-08-23 13:49:40 +02:00
Rolf Bjarne Kvinge 0d6c74e3d0 [mmp] Build using csproj instead of manual csc command. Partial fix for #4384.
* Make sure mmp.csproj builds using the same compiler arguments as the makefile used.
* Clean up mmp.csproj by removing stuff that was left over from when it was a Xamarin.Mac project.
* Build mmp.exe using msbuild in the makefile, and clean up the resulting unused make logic.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/4384.
2018-08-23 13:49:40 +02:00
Rolf Bjarne Kvinge 3472a17b21 [generator] Build using csproj instead of manual csc command. Partial fix for #4384.
1. Put the source files into generator.csproj, and stop generating it.
2. Build bgen.exe using msbuild in the makefile.

Partial fix for https://github.com/xamarin/xamarin-macios/issues/4384.
2018-08-23 13:49:40 +02:00
Rolf Bjarne Kvinge 03075f1142 Add a tool that can list all inputs for a given csproj, and create a corresponding make variable. 2018-08-23 13:49:40 +02:00
Rolf Bjarne Kvinge 80430df393 [src] Use generated rsp files when executing the generator.
This is step 1 in not having to generate generator.csproj, since we can
reference the rsp files statically instead of injecting the actual command
line arguments to the generator for the debugging run configurations.

It also makes sure the project's run configurations are always up to date,
since they're using the exact same input as the command line build.
2018-08-23 13:38:32 +02:00
Rolf Bjarne Kvinge e955a489f8 Move generator-ikvm.csproj.in -> generator.csproj.in. 2018-08-23 13:38:32 +02:00
Rolf Bjarne Kvinge dea087332e [src] Simplify the IOS_TARGETS_template template to have fewer variables.
Turns out we only need a single variable now.
2018-08-23 13:38:32 +02:00
Rolf Bjarne Kvinge ab4b6fa8d9 [src] Expand the IOS_GENERATOR_template template, since it's only used once.
No need to have complicated template code when it's only instantiated once.
2018-08-23 12:59:03 +02:00
Rolf Bjarne Kvinge 508ecd16c8 [src] Remove make targets for SRE-based generators.
They're not used anymore.
2018-08-23 12:53:22 +02:00
Rolf Bjarne Kvinge 30af5e34ad Remove unneeded solution to simplify things / avoid confusion. 2018-08-23 12:32:57 +02:00
Rolf Bjarne Kvinge 53b88bfd7f Remove unusued project configuration ('DebugStaticRegistrar') from Xamarin.iOS.sln. 2018-08-23 12:32:09 +02:00
Rolf Bjarne Kvinge 51c16e4fdc Fix mtouch's Release configuration to build the right Cecil assemblies. 2018-08-23 12:31:24 +02:00
Rolf Bjarne Kvinge 91fcb31688 Fix mmp's Release configuration to build the right Cecil configuration. 2018-08-23 12:30:10 +02:00
Manuel de la Pena 8012d4cd54
[Runtime] Small fix for the runtime.h exposed by Emb-4000. Fixes #4442 (#4663)
This fixes issue #4442 by fixing a small struct issues.

https://github.com/xamarin/xamarin-macios/issues/4442
2018-08-22 11:16:27 +02:00
Rolf Bjarne Kvinge 5995833903
[tests] Improve F# test's assert message. (#4649)
Before in case of failure:

    [FAIL] FSharpTest.SprintfTest :   Expected: True
        But was:  False
    	  at fsharp.FSharpTest.SprintfTest () [0x00052] in /work/maccore/mono-master/xamarin-macios/tests/fsharp/FSharpTests.fs:34
    	  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)

After in case of failure:

    [FAIL] FSharpTest.SprintfTest :   String lengths are both 24. Strings differ at index 10.
      Expected: "1111 2222 3333 4444 5555"
      But was:  "1111 2222 4444 3333 5555"
      ---------------------^
    at fsharp.FSharpTest.SprintfTest () [0x00044] in /work/maccore/mono-master/xamarin-macios/tests/fsharp/FSharpTests.fs:33
    at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
2018-08-20 19:06:01 +02:00
Jeffrey Stedfast 2d25af6412 [msbuild] pass --target-platform=<platform> to copySceneKitAssets (#4630)
The copySceneKitAssets program has a poor command-line options
parser that cannot handle --target-platform and its argument
being 2 separate arguments, they have to be combined with an '='.

Fixes https://github.com/xamarin/xamarin-macios/issues/4467
2018-08-20 08:40:11 -04:00
Rolf Bjarne Kvinge a619226b36
[msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237. (#4512)
* [msbuild] Set 'CopyNuGetImplementations' to true for app extensions. Fixes #4235 and #4237.

In Xamarin.iOS.Common.targets, just before the _CompileToNative target, we
modify the mtouch references to ensure that we get the lib assemblies for
nugets, and not the ref references:

9e31d07ecc/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets (L784-L791)

This logic removes nuget references, and then re-adds any copy-local dll
references.

This works fine in executable projects, but not in library projects (aka
extensions), because nugets aren't copied for library projects:

cf4b0a12cf/src/Microsoft.NuGet.Build.Tasks/Microsoft.NuGet.targets (L86)

So we need to set the CopyNuGetImplementations variable to 'true' for our
library projects.

Fixes https://github.com/xamarin/xamarin-macios/issues/4235.
Fixes https://github.com/xamarin/xamarin-macios/issues/4237.

* [tests] Redirect MSBuildExtensionsPath to MSBuildExtensionsPathFallbackPathsOverride when running msbuild for package reference tests.

This fixes a problem where nuget restore would fail for projects with
PackageReferences, because a variable would be empty and msbould would try to
write to /:

    nuget restore ../MyAppWithPackageReference/MyAppWithPackageReference.csproj
    MSBuild auto-detection: using msbuild version '15.0' from '/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/msbuild/15.0/bin/'.
    Restoring packages for /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/msbuild/tests/MyAppWithPackageReference/MyAppWithPackageReference.csproj...
    Committing restore...
    Generating MSBuild file /MyAppWithPackageReference.csproj.nuget.g.props.
    Path / is a directory

This will become unnecessary when PR #4111 is merged.

* Add Xamarin.Mac test showing that fix is not needed (?!?)

* Add AppExtension test with packagereference

* Make extension actually have json code generated

* Fix ProjectTypeGuids of checked in extension projects, as they were not openable in VSfM

* XM extension test now correctly fails

* Now that we have a failing test, fix XM same as rest of platforms

* Disable XM tests due to msbuild redirect sadness

* Disable iOS tests as well due to #4110

* Disable iOS tests by using the Ignore attribute.

Disable tests by using the Ignore attribute, because just commenting out the
TestCase attributes makes the test fail:

    1) NotRunnable : Xamarin.iOS.Tasks.ProjectReferenceTests.BasicTest
       No suitable constructor was found
2018-08-20 13:43:48 +02:00
Rolf Bjarne Kvinge 7e368e1264
Bump maccore to get fix for VSTS #616528. (#4637)
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/616528.

Diff: f4e3e7c1f9...9937926f56
2018-08-20 08:57:29 +02:00
Rolf Bjarne Kvinge 1bbfbd26ff
[F# tests] Default to LinkSdk for device builds. (#4643)
Makes device builds (and uploads) much faster.

I've checked all other tests, and this was the only one not using LinkSdk
(except tests that don't on purpose, such as linker tests).
2018-08-20 07:42:32 +02:00
Rolf Bjarne Kvinge 8ff0dccad0
Try to fix random make failure in src/ by not using pattern rules. (#4639)
Randomly make 3.81 says this:

    error CS0006: Metadata file 'build/ios/reference/MonoTouch.Dialog-1.dll' could not be found

The makefile seems fine, and it also doesn't happen when using make 4.21, so
this looks like a make bug.

So rewrite the troublesome rule to not be a pattern rule, and cross some fingers.
2018-08-18 00:44:36 +02:00
Rolf Bjarne Kvinge c94553f253
[tests] Re-add [Test] attribute accidentally removed in 3f16223deb. (#4626) 2018-08-17 11:07:18 +02:00
Chris Hamons ecfc5ce917
Order additional arguments after response file (#4607)
- https://github.com/xamarin/xamarin-macios/issues/4594
- There were being adding _before_ the response file which meant options that were overriding defaults were not being honored
2018-08-13 13:09:31 -05:00
Vincent Dondain c067f64efa
[scenekit] Add advice to SCNMatrix4 (#4605)
In relation to https://github.com/xamarin/xamarin-macios/issues/4525, adding an "advice" to remind everyone this is a row major matrix.
2018-08-13 09:38:18 -04:00
Sebastien Pouliot c982db842a
Bump XI/XM versions after 15.9 branch (#4593) 2018-08-08 14:16:53 -04:00
Sebastien Pouliot 745ac8f1db
[foundation] Override Message property in NSErrorException. Fixes #4133 (#4176)
The default `Message` property is not every helpful. Better information
is available inside the `Error` property but it's not general (nor cross
platform) when dealing with exception.

Include unit tests (on an existing test checking NSError values)

https://github.com/xamarin/xamarin-macios/issues/4133
2018-08-01 09:18:04 -04:00
Sebastien Pouliot a1396d69e5
Update mono to head of 2018-04 before branching for 15.9 (#4538) 2018-07-31 22:57:43 -04:00
Rolf Bjarne Kvinge 2e2fe92986 [tests] Change the MT4134 test to only expect device builds to fail. (#4526)
As an unintended side effect of 215ab7fc1a, we
stopped reporting MT4134 errors ("Your app is using framework X, which means
you must update your Xcode") for simulator builds.

This can be either good (people's simulator builds now succeed when the
previously didn't) or bad (people's simulator builds don't always match their
device builds, since they may still get the MT4134 error for device builds).

This patch assumes we want the improved simulator builds, and adjusts the
corresponding test accordingly.
2018-07-30 21:59:48 -04:00
Jeffrey Stedfast 415d55dd2d [msbuild] Make PropertyListEditor.Value a property like it should be (#4522) 2018-07-30 19:35:42 -04:00
Rolf Bjarne Kvinge d871a503f5
Specify when iOS got headers for MetalPerformanceShaders. (#4524)
Fixes this problem in the MT4134 test:

    Process exited with code 1, command:
    /Applications/Xcode83.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -Wno-receiver-forward-class -Wno-objc-missing-super-calls -gdwarf-2 -I/Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/include -isysroot /Applications/Xcode83.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -Qunused-arguments -fobjc-legacy-dispatch -fobjc-abi-version=2 -mios-simulator-version-min=11.4 -arch x86_64 -c -o /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory513/mtouch-test-cache/x86_64/registrar.o -x objective-c++ /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory513/mtouch-test-cache/registrar.m
    In file included from /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory513/mtouch-test-cache/registrar.m:2:
    /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tests/mtouch/bin/Debug/tmp-test-dir/Xamarin.Tests.BundlerTool.CreateTemporaryDirectory513/mtouch-test-cache/registrar.h:47:9: fatal error: 'MetalPerformanceShaders/MetalPerformanceShaders.h' file not found
    #import <MetalPerformanceShaders/MetalPerformanceShaders.h>

Note that the error is because the test is building with Xcode 8.3 (and this
is also why the problem wasn't found by the PR bots: they don't have older
Xcodes installed to run this particular test).
2018-07-30 16:11:11 +02:00
Rolf Bjarne Kvinge fd05ba6a79
[mtouch] Show warnings when we can't find referenced assemblies. (#4511)
* [mtouch] Show warnings when we can't find referenced assemblies.

This would have helped track down #4235.

* Improve MT0137 warning to indicate the type of the attribute causing the warning.
2018-07-30 10:55:23 +02:00
Rolf Bjarne Kvinge 69eb5cf1a7
[mtouch] Rename method that clashes with new method in base class to fix compiler warning. (#4516)
Rename a method that clashes with a new method in a base class to avoid a
compiler warning about hidden inherited members.

Fixes:

    xamarin-macios/tools/linker/MobileSweepStep.cs(41,26): warning CS0114: 'MobileSweepStep.SweepAssembly(AssemblyDefinition)' hides inherited member 'SweepStep.SweepAssembly(AssemblyDefinition)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.
2018-07-27 17:06:27 +02:00
Rolf Bjarne Kvinge 215ab7fc1a
[mtouch] Unify code to detect and handle frameworks that aren't supported in the simulator. Fixes #4422. (#4510)
Unify the code to detect frameworks that aren't supported in the simulator (we
had switches in two places, now this data is stored per framework).

Also remove some of the Metal frameworks for some of the platforms from these
lists (since they're now available in the simulator in some cases), which
fixes #4422.

It also seems CoreAudioKit is now available in the simulator (it wasn't in the
first Xcode 7 beta, but apparently added in a later beta. This made our
exclusion incorrect, but we never noticed).

https://github.com/xamarin/xamarin-macios/issues/4422
2018-07-27 16:30:08 +02:00
Rolf Bjarne Kvinge 923b93309c
[mmp] Bump project file to v4.6 to fix compiler error when building in VSfM. (#4515)
Fixes:

    xamarin-macios/external/mono/external/linker/linker/Linker.Steps/MarkStep.cs(310,60,310,73): error CS0117: 'Array' does not contain a definition for 'Empty'
2018-07-27 16:29:27 +02:00
Rolf Bjarne Kvinge 9e31d07ecc [mtouch] Fix build from csproj. (#4503) 2018-07-25 15:43:38 -04:00
Marek Safar 10d98e67d8 [mtouch] Pass features not available on iOS to linker (#4426) 2018-07-24 22:30:18 -04:00
Jeffrey Stedfast 21936948bb [msbuild] Xcode10 changed the copySceneKitAssets command-line arguments (#4469)
Fixes https://github.com/xamarin/xamarin-macios/issues/4467
2018-07-24 14:05:07 -04:00
Rolf Bjarne Kvinge 26b500ab27
[msbuild] Don't put gcc/linker flags in the response file, since Mono.Options doesn't support escaping quotes. Fixes vsts#649776. (#4495)
Mono.Options doesn't (yet) support escaped quotes when parsing response files,
which becomes a problem because escaped quotes are necessary when passing
paths with spaces as gcc/linker flags.

So don't write gcc/linker flags in the response file, and instead pass them as
normal command line arguments, and to be on the safe side, do the same thing
for all extra arguments passed to mmp/mtouch.

Also add tests.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/649776.
2018-07-24 19:49:33 +02:00
Alex Soto 08a9bdcc18
Merge pull request #4411 from drailan/nshttpcookiestorage-notifications
Correcting NSHttpCookieStorage notifications mapping
2018-07-10 18:04:56 -05:00
iain f1c90e8f1a [Runtime] Emit the AssemblyRegistration event (#4414)
- A typo was preventing it from being emitted.
2018-07-10 11:28:40 -05:00
Denis Railan f23d292687 Cookie changed notification was mapped to accept policy, and vice versa - correcting the mapping. 2018-07-06 10:13:22 -04:00
Alex Soto 4f0bac5161
[Foundation] Adds missing [Static] attribute in NSDistributedNotificationCenter.DefaultCenter (#4383)
Fixes the mlaunch build:


	Xamarin.Hosting/SimulatorApplication.cs(183,51): error CS0120: An object reference is required for the non-static field, method, or property 'NSDistributedNotificationCenter.DefaultCenter'
	Xamarin.Hosting/SimulatorApplication.cs(231,51): error CS0120: An object reference is required for the non-static field, method, or property 'NSDistributedNotificationCenter.DefaultCenter'
	Xamarin.Hosting/Services.cs(1058,51): error CS0120: An object reference is required for the non-static field, method, or property 'NSDistributedNotificationCenter.DefaultCenter'
2018-07-03 12:47:05 -05:00
P3PPP c1f759ee56 Fix NSDistributedNotificationCenter.DefaultCenter return value
- As we can't change NSDistributedNotificationCenter.DefaultCenter return value outside of XAMCORE_4_0 add NSDistributedNotificationCenter.GetDefaultCenter () and point people to that for now.
- Fixed in XAMCORE_4_0 without the hack
2018-06-29 13:27:53 -07:00
Rolf Bjarne Kvinge e110612118
[registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360)
* Convert it into a MM8027/MT8027 error (with documentation).
* Add information about the selector and managed method that triggered the error.

Now the problem reported in issue #4254 shows up as:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).
> Additional information:
> 	Selector: popoverController:willRepositionPopoverToRect:inView:
> 	Method: UIKit.UIPopoverController+_UIPopoverControllerDelegate.WillReposition(UIKit.UIPopoverController, CoreGraphics.CGRect ByRef, UIKit.UIView ByRef)

instead of just:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).

which makes it much easier to understand, track down, and fix/work around,
both for customers and ourselves.
2018-06-29 14:38:28 +02:00
Rolf Bjarne Kvinge d79bef79a0
[ObjCRuntime] Make Class.GetHandle not handle byref types. Fixes #4254. (#4361)
* [ObjCRuntime] Make Class.GetHandle not handle byref types. Fixes #4254.

This is a regression between d15-6 and d15-7: it's an unindented consequence
of the changes required to link away the dynamic registrar.

This unindented consequence is non-obvious: it made Class.GetHandle
successfully look up byref types, since we're now using metadata tokens to
look up a Class from the managed Type, and it turns out the metadata tokens
are the same for byref types as the corresponding non-byref type, so
Class.GetHandle treats them identically.

This was not the behavior for Class.GetHandle in d15-6, and other code relied
on this behavior (in particular calling isKindOfClass: in Runtime.GetNSObject
with a nil class returns false, and we'd end up in a different code path that
would not try to create the managed peer with a byref type).

So make sure Class.GetHandle doesn't change its behavior compared to d15-6 by
special-casing byref types to return IntPtr.Zero.

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

* Move byref check earlier to get identical behavior when the dynamic linker is optimized away.

Also add checks for pointer and array types for the same reason.
2018-06-29 14:33:55 +02:00
Rolf Bjarne Kvinge 0a24bd603d
[runtime] Always release blocks on the main thread. Fixes #4130. (#4312)
Fixes https://github.com/xamarin/xamarin-macios/issues/4130.
2018-06-29 10:42:25 +02:00
Rolf Bjarne Kvinge a28fa8b56f
[docs] Fix bugzilla link to file bugs for Xamarin.Mac for mmp errors. (#4358) 2018-06-29 09:47:14 +02:00