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

1899 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 1dbffeb3f8 [foundation] Return an empty NSArray that is valid for both managed and native side (#1473)
The existing code was cheating and returned a managed only instance with a `nil` handle. That was fine in many cases but some API (e.g. UISegmentedControl) don't like that (i.e. don't react like a normal, empty NSArray was supplied). It's also the right thing to do since the current behaviour is not guaranteed to remain identical on future updates of the OS.

Unit tests updated.
2017-01-11 19:32:16 -05:00
Sebastien Pouliot c98126eeda [passkit] Fix [Model] in public API w/workarounds 2017-01-11 17:34:48 -05:00
Sebastien Pouliot 9577b9ac42 [networkextension] Fix [Model] in public API w/workarounds 2017-01-11 16:17:41 -05:00
Chris Hamons ffe142d0b5 [XM] AOT support in Xamarin.Mac (#1340) 2017-01-11 14:10:39 -06:00
Rolf Bjarne Kvinge 8e229908df [runtime] Blocks must be copied, not just assigned. Fixes #44568. (#1471)
The completion handler block must be copied to the XamarinHttpConnection
instance, otherwise we'll just store a pointer to a stack block, and once we
invoke the block we'll access stack memory (probably from another thread),
which is really not what we want to do.

https://bugzilla.xamarin.com/show_bug.cgi?id=44568
2017-01-11 19:45:38 +01:00
Rolf Bjarne Kvinge c2e2e3d824 [mtouch] Include extracted frameworks from binding assemblies when listing the frameworks an extension needs. Fixes #45800. (#1461)
Include extracted frameworks from binding assemblies when listing the
frameworks an extension needs.

Fixes #45800 - comments 8-13.

https://bugzilla.xamarin.com/show_bug.cgi?id=45800
2017-01-11 16:50:07 +01:00
Alex Soto 045493b77c Merge pull request #1465 from dalexsoto/bug51212
[generator] Provide a better error than BI0000 when gets a TypeloadException in NeedStret
2017-01-10 17:54:09 -06:00
Sebastien Pouliot 33b7d2e23b [tests] Fix monotouch-test to execute when Link All is used (#1464)
Code inside the category needs to be preserved, since it's not
directly used by C# code.

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=51335
2017-01-10 17:28:19 -05:00
Timothy Risi b4266d66a8 Fix NSFormatter.IsPartialStringValid. Fixes #50407 (#1456)
https://bugzilla.xamarin.com/show_bug.cgi?id=50407
2017-01-10 16:41:41 -05:00
Sebastien Pouliot 1559248e49 [avfoundation] Fix [Model] in public API w/workarounds 2017-01-10 16:15:06 -05:00
Sebastien Pouliot 08c54f7914 [msbuild] Fix how UnpackLibraryResources handles mscorlib.dll (and potentially other framework assemblies) (#1011)
Target _UnpackLibraryResources:
	Task "UnpackLibraryResources"
		Using task UnpackLibraryResources from Xamarin.MacDev.Tasks.UnpackLibraryResources, Xamarin.MacDev.Tasks, Version=1.0.6128.15885, Culture=neutral, PublicKeyToken=null
		UnpackLibraryResources Task
		  Prefix: monotouch
		  IntermediateOutputPath: obj/iPhone/Debug/
		  NoOverwrite:
		    obj/iPhone/Debug/ibtool-link/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib
		    obj/iPhone/Debug/ibtool-link/LaunchScreen.storyboardc/Info.plist
		    obj/iPhone/Debug/ibtool-link/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib
		    obj/iPhone/Debug/ibtool-link/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
		    obj/iPhone/Debug/ibtool-link/Main.storyboardc/Info.plist
		    obj/iPhone/Debug/ibtool-link/Main.storyboardc/UIViewController-BYZ-38-t0r.nib
		  ReferencedLibraries:
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
		    /Users/poupou/Downloads/LinkingTest-2/RMSDKWrapper/bin/Debug//RMSDKWrapper.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
		    /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll
		  Skipping framework assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
		  Inspecting assembly: /Users/poupou/Downloads/LinkingTest-2/RMSDKWrapper/bin/Debug//RMSDKWrapper.dll
		  Inspecting assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
		  Inspecting assembly: /Users/poupou/git/xamarin/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS//mscorlib.dll
	Done executing task "UnpackLibraryResources"
	Done building target "_UnpackLibraryResources" in project "/Users/poupou/Downloads/LinkingTest-2/LinkingTest/LinkingTest.csproj".

The above log excerpt shows two issues:

1. mscorlib.dll is needlessly inspected as it's **not** considered a
   "framework" assembly.

   The current check was checking *how* it was resolved and not *where*
   it was resolved to. The later is the most important as it's possible
   for other assemblies to have direct paths references and we do not
   want to process them.

   This is fixed by comparing each assembly path with the (now) provided
   `TargetFrameworkDirectory`

2. mscorlib.dll is inspected twice

   That's because it's present two times in the task's input. That issue
   is upstream (not sure why) of the current task but it makes #1 twice
   as costly. The fix for #1 indirectly fix that too.

Future
------

It's worth investigating to move that logic into `mtouch`. The later must
already load all assemblies and is in charge of removing other embedded
data (e.g. native code from bindings) from the assemblies (so they are not
shipped both inside and outside the .dll in the final .app). This makes
this task seems extraneous work.

Considering that my current test case, `RMSDKWrapper.dll`, is 1.3GB in
size it's easy to see that the extra load (which has nothing to be
extracted wrt resources*) is quite visible in build time.

>  3268.201 ms  UnpackLibraryResources                                  1 calls

* it has for bindings but that's already handled by mtouch
2017-01-10 15:03:00 -05:00
Alex Soto 5f85ec618e [generator] Provide a better error than BI0000 when gets a TypeloadException in NeedStret
https://bugzilla.xamarin.com/show_bug.cgi?id=51212

Generator gets a TypeLoadException when the runtime can't load a
bad struct, we now provide a better error msg.
2017-01-10 13:43:13 -06:00
Jeffrey Stedfast 551c0be103 [msbuild] Use Xcode-specific versions of some command-line tools (#1462)
The `strip` command was already doing this, but `ar` and `dsymutil`
were using /usr/bin versions (which might not exist, depending on
the Xcode installation).
2017-01-10 13:58:22 -05:00
Rolf Bjarne Kvinge 6e987418f7 Bump maccore to get fix for launching watch apps in the simulator. (#1458) 2017-01-10 18:51:56 +01:00
Rolf Bjarne Kvinge f771761b32 Merge pull request #1444 from rolfbjarne/xharness-add-device-support
[xharness] Major rewrite (add server mode, add device support, add today extension support).
2017-01-10 17:29:37 +01:00
Sebastien Pouliot 8f2a05e6de [watchos] Fix API wrt new [Model] tests
references:
[FAIL] `NSUrlSession.FromConfiguration` includes a paramater of type `NSUrlSessionDelegate` which is a concrete type `[Model]` and not an interface `[Protocol]`
[FAIL] `NSFileCoordinator..ctor` includes a paramater of type `NSFilePresenter` which is a concrete type `[Model]` and not an interface `[Protocol]`
2017-01-10 10:51:49 -05:00
Sebastien Pouliot 5f72a25f5f Merge branch 'master' into intro-model 2017-01-10 09:05:07 -05:00
Jeffrey Stedfast 9c8a5fa28c [msbuild] Don't use a timestamped directory for the IPA (#1382)
* [msbuild] Don't use a timestamped directory for the IPA

After discussion with Mikayla Hutchinson and Madhuri Gummalla,
this naming convention is annoying to customers so just put
the *.ipa in the bin directory. This also has the added
benefit that the *.ipa will be cleaned up with /t:Clean

* [msbuild] Fixed wildcard expansion for deleting the *.ipa file

* [msbuild] Add the zipped *.ipa file to the FileWrites item group

* [msbuild] s/TaskProperty/TaskParameter/
2017-01-09 16:11:50 -05:00
Rolf Bjarne Kvinge c9d8c0af67 [jenkins] Automatically expand failed tests. 2017-01-09 20:30:11 +01:00
Rolf Bjarne Kvinge c1f4639025 [jenkins] List ignored tests in the list of test states. 2017-01-09 20:28:43 +01:00
Rolf Bjarne Kvinge be129af6da [jenkins] Rework javascript a bit to avoid eval.
`eval` isn't allowed in Jenkin's HTML publisher because of security concerns,
so try to avoid it.
2017-01-09 20:27:52 +01:00
Chris Hamons e33b78fd7a Fix inverted null check in MobileCoreServices (#1455)
https://bugzilla.xamarin.com/show_bug.cgi?id=51299
2017-01-09 12:55:57 -06:00
Rolf Bjarne Kvinge e310fc62f7 [tests] Add comment explaining why we need a dummy test in the today app container. 2017-01-09 17:53:24 +01:00
Rolf Bjarne Kvinge 1d20b18889 Revert "[msbuild] Moved _CompileToNative so it runs after importing the app extension" (#1454) 2017-01-09 17:38:20 +01:00
Rolf Bjarne Kvinge fcf98d4d3e [jenkins] Only show the running status if we're in server mode. 2017-01-09 17:03:24 +01:00
Rolf Bjarne Kvinge 697481bda5 [jenkins] Put failed tests at the top of the html report. 2017-01-09 17:03:24 +01:00
Rolf Bjarne Kvinge 6141528f52 [mtouch tests] Add missing file to csproj. 2017-01-09 17:03:05 +01:00
Vincent Dondain ded6d2f129 [mtouch] Update MT0091 message (#1453)
Fixes bug #40835: Improve enable managed linker error message
(https://bugzilla.xamarin.com/show_bug.cgi?id=40835)
2017-01-09 16:34:58 +01:00
Sebastien Pouliot 72b735466d [generator] Remove internal *Wrapper.ctor(IntPtr) constructors (#1446)
The registrar code looks for `.ctor(IntPtr,bool)` so we end up with
unneeded extra code and metadata.

	Xamarin.iOS.dll before	12656640
	Xamarin.iOS.dll after	12643840

Saves 12.5kb (25kb for iOS 32/64) + native code. Final result will vary
(linker).
2017-01-09 08:09:19 -05:00
Sebastien Pouliot 77a92500a5 [foundation] Fix possible abort when using NSUrlSessionHandler. Fix #50891 (#1451) (#1452)
PR 1435 did not fix bug #50891. The default (native) implementation till
get called and abort the process. The right way to solve this is to
override the members (easier now that it's not internal anymore) and
return `false` (or `null`) so the caller (the OS) knows it's not
supported (that's fine)

references:
* https://bugzilla.xamarin.com/show_bug.cgi?id=50891
* https://github.com/xamarin/xamarin-macios/pull/1435
2017-01-08 15:31:47 -05:00
Sebastien Pouliot 7e461645dc [mono][aot] Bump for fixing #51206 (master) (#1449)
commit e0baa814b0cacfece4c615255c67c4300db4a8b1
Author: Zoltan Varga <vargaz@gmail.com>
Date:   Thu Jan 5 19:44:42 2017 -0500

    [aot] Avoid a crash in the aot compiler if a delegate doesn't have a BeginInvoke ()/EndInvoke () method. Fixes #51206.

https://bugzilla.xamarin.com/show_bug.cgi?id=51206
2017-01-08 11:07:04 -05:00
Jeffrey Stedfast 6014967891 [msbuild] Make sure to use the *actual* filename generated by ibtool (#1442)
* [msbuild] Make sure to use the *actual* filename generated by ibtool

The problem is that since the Mac file system is case-insensitive,
File.Exists() will match "file~ipad.nib" even if the actual name
is "file~iPad.nib", so the only way to get the *actual* file name
is to scan the directory and do manual matching.

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

* Check that the dir exists before allocating other local variables
2017-01-06 13:34:21 -05:00
Manuel de la Pena 4777b80784 [Foundation] Provide a public version of the get and set property methods for the NSStream (#1435)
* [Foundation] Provide a public version of the get and set property
methods for the NSStream.

This fixes bug 50891 where the handler crashes because the methods are
protected. Also, we add the AbstractAttribute to those methods in the
base class for whenever we are allowed to change the API to ensue that
the inheritors do provide the required methods as per Apple
documentation.

* Make the methods protected rather than public so that users don't access them over the indexer yet the apple internal classes can use them.

* Ensure methods will be Protected in Xam4.
2017-01-05 16:39:40 -05:00
Jeffrey Stedfast 3103153349 [msbuild] Fixed the Inputs for the _CodesignAppBundle target (#1438)
* [msbuild] Fixed the Inputs for the _CodesignAppBundle target

The Inputs need to include the Info.plist, embedded.mobileprovision,
and the native libs/frameworks since those files also get included
in the _CodeSignature/CodeResources.

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

* [msbuild] Added unit test to make sure _CodesignAppBundle logic works
2017-01-05 11:29:48 -05:00
Rolf Bjarne Kvinge 8d220b46d7 [src] Make project templates MSBuild-compatible.
MSBuild wants to copy from IntermediateOutputPath to OutputPath, even if the
assembly doesn't exist in IntermediateOutputPath (and it already exists in
OutputPath). So just set IntermediateOutputPath=OutputPath, which seems to
work fine.

Also make these project files build correctly without custom scripts (custom-
make.sh), since that makes it easier to transform these project files in
xharness (copy them to a different directory).
2017-01-05 13:09:29 +01:00
Rolf Bjarne Kvinge 8391a3ca39 [xharness] Major rewrite (add server mode, add device support, add today extension support).
* Add a server mode, which launches a web server (and a web page) that can be
  used to interactively run tests and view their results.

* Add support for running test assemblies in a today extension (generating a
  new set of projects, similar to how we generate tvOS/watchOS projects based
  on the iOS project, we now generate a today extension project in addition to
  the tvOS and watchOS projects).

* Load all the different tests (and show them in the html report, although
  they show up as 'ignored'), even for disabled/ignored tests. This makes
  disabled/ignored tests more visible, and also makes it possible to actually
  run them using the embedded web server.

* Add support for running tests on device. Tests will be executed on multiple
  devices simulatenously (any connected devices will be used).
2017-01-05 13:08:48 +01:00
Rolf Bjarne Kvinge 39cb42961d [mtouch tests] Add Cache. 2017-01-05 10:43:55 +01:00
Rolf Bjarne Kvinge 321ac19918 [tests] Move a few template test files around. 2017-01-05 10:42:36 +01:00
Rolf Bjarne Kvinge 1852ff7d4b [tests] Test libraries must build to bitcode to be usable on watchOS. (#1440) 2017-01-04 17:05:14 -05:00
Rolf Bjarne Kvinge c30614cd67 [xharness] Find config files based on the given root directory, and not the current directory. (#1441)
Xamarin Studio does funny things with the current directory sometimes when
launching executables, so this makes the behavior more consistent.
2017-01-04 17:05:04 -05:00
Sebastien Pouliot 03a7042d17 Bump mono to the head of mono-4.8.0-branch (same as c9) (#1437)
* [apidiff] Update XML references to match C8SR2 (10.3.1)

* Bump mono to the head of mono-4.8.0-branch (same as c9)
2017-01-04 17:03:04 -05:00
Rolf Bjarne Kvinge 2d3a990acf [mtouch tests] Minor refactoring to make a few nested classes non-nested. (#1433) 2017-01-04 19:33:57 +01:00
Rolf Bjarne Kvinge a520c5077a [runtime] Use safer versions of strncpy/strncat/strcat. (#1434)
The length argument for `strncpy` specifies how many characters to copy, not
the length of the target string, which makes our usage incorrect.

Fix our usage, and use the `strlcpy` variant instead, which takes the length
of the target string.

And use `strlcat` instead of `strcat`.
2017-01-04 18:10:47 +01:00
Vincent Dondain 10d7858c4f [docs] Fix binding_types_reference_guide typo 2017-01-04 15:58:49 +01:00
Rolf Bjarne Kvinge b3d2b50dca [mtouch] Auto-install locally after building in the IDE. (#1432)
Auto-install locally after building in the IDE, so that running mtouch tests
after running the mtouch project doesn't require switching to the command
line.
2017-01-03 16:34:33 -05:00
Rolf Bjarne Kvinge d3e974e2bc [mtouch tests] Build the registrar tests for the simulator. (#1431)
It's *much* faster.
2017-01-03 19:40:33 +01:00
Sebastien Pouliot dea2dde259 [linker] Update mscorlib.xml to preserve generic collection interfaces. Fixes #50290 (#1384) (#1427)
The `generic_icollection_class` condition (in class.c) does not match the mscorlib.xml descriptor file.

+ IEnumerator`1
+ IReadOnlyList`1
+ IReadOnlyCollection`1

reference:
https://bugzilla.xamarin.com/show_bug.cgi?id=50290
2017-01-03 13:03:29 -05:00
Rolf Bjarne Kvinge 5b4bc02f72 [generator] Hardcode the XamCore version instead of using ifdefs. (#1422) 2017-01-03 15:15:04 +01:00
Rolf Bjarne Kvinge d7ecfc3a14 [mtouch/mmp] Make Cache a non-static class. (#1425)
So that there can be multiple caches in the same process (which we'll have
once mtouch can compile extensions and the container app in the same process).
2017-01-03 15:14:47 +01:00
Rolf Bjarne Kvinge 4b82398c62 [xharness] Add Jenkins support for mmp regression tests. (#1426) 2017-01-02 19:36:21 +01:00