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

530 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7bf290278c Bump maccore to get mlaunch changes. (#1143) 2016-11-09 16:14:59 +01:00
Rolf Bjarne Kvinge 10516d3672 [CoreFoundation] Store strings in the exception data when converting CFError to CFException. Fixes #46626. (#1144)
Store strings in the exception data when converting CFError to CFException, to
make sure the data stored is serializable (which is apparently a requirement
with the reference sources).

https://bugzilla.xamarin.com/show_bug.cgi?id=46626
2016-11-09 15:31:02 +01:00
Sebastien Pouliot c92934eb6d [mtouch][mmp] Only allow `appletls` for the TLS provider (#1132)
The old `legacy` option will now be reported as a warning. 

That's by design an warning would require manually editing the .csproj
file (when the UI gets removed, as planned, from the IDE). 

This is part of
https://trello.com/c/SrgU38DN/647-only-ship-support-appletls

Note: The BCL changes will happen in later stages.
2016-11-08 14:42:40 -05:00
Rolf Bjarne Kvinge d42a9f4909 [mtouch] Make MT2015 (invalid HttpMessageHandler) a warning for known http message handlers on watchOS. Fixes #46552. (#1134)
Earlier versions of Xamarin Studio stored an invalid http message handler in
watchOS project files, which would cause a build error. In addition Xamarin
Studio removed the UI to set the http message handler (since only one value is
valid), which meant that the user had to edit the project file by hand to get
around this build error.

So make it a warning instead (and document what the user has to do to fix the
warning).

https://bugzilla.xamarin.com/show_bug.cgi?id=46552
2016-11-08 11:13:53 -05:00
Alex Soto 6b65ce9077 [AVFoundation] Low hanging fruits and xtro of AVFoundation (#980)
This commit brings all new 10.12 api + most of the unbound
AVFoundation API that is macOS specific and was left in the limbo
2016-11-07 09:32:56 -06:00
Rolf Bjarne Kvinge 503061f6ab [tests] Update to NUnit 3 in mtouch tests. (#1119) 2016-11-07 12:22:37 +01:00
Rolf Bjarne Kvinge 5ef045d764 [xharness] Capture stdout/stderr from simulator apps. (#1116)
And if we have a tty, just show the output directly there. Otherwise capture
it, and store it in log files.
2016-11-04 12:13:20 +01:00
Rolf Bjarne Kvinge 3351e2a633 Add a 'repositorypath' to our NuGet.Config and update paths everywhere accordingly. (#1110)
This makes us only put packages in one directory (saves disk space and time),
and it also makes project files in multiple solutions work properly
(mtouch.csproj is in tests/tests.sln and tests/mtouch/mtouch.sln).
2016-11-04 09:13:33 +01:00
Rolf Bjarne Kvinge a2a67377df [mtouch] Update the timestamp for the simlauncher when copying it into the app. (#1094)
This makes sure that the final executable has a timestamp after the .exe,
which makes the MSBuild tasks able to avoid unnecessary rebuilds.
2016-11-03 14:35:46 +01:00
Rolf Bjarne Kvinge 43c06e0cbb [tests] Ignore mtouch tests that require device support if device support was not included in the build. (#1109) 2016-11-03 13:20:31 +01:00
Rolf Bjarne Kvinge 4c8867c1b2 [xharness] Give the mtouch tests 120 minutes to finish. (#1095)
Give the mtouch tests 120 minutes to finish, since that's what wrench
currently gives them.
2016-11-03 11:53:49 +01:00
Sebastien Pouliot ee046ee034 [generator] Copy [Obsolete] attributes on smart enums. Fixes #46292 (#1104)
Covers attributes on the type itself and on its members.

Reference:
* https://bugzilla.xamarin.com/show_bug.cgi?id=46292
2016-11-02 23:18:59 -04:00
Sebastien Pouliot e55385637f [generator] Allow identical (numeric) values in smart enums. Fixes #46285 (#1102)
Considering the following binding code:

    public enum HMAccessoryCategoryType {
        [Field ("HMAccessoryCategoryTypeGarageDoorOpener")]
        DoorOpener,

        GarageDoorOpener = DoorOpener,
    }

We must

1. Ensure that `HMAccessoryCategoryType.DoorOpener.GetConstant () ==
	HMAccessoryCategoryType.GarageDoorOpener.GetConstant ()`;

This is done by using the numeric value of the enum member (instead of the name)

2. Ensure that `HMAccessoryCategoryTypeExtensions.GetValue ("HMAccessoryCategoryTypeGarageDoorOpener")`
   always return the same enum value, i.e. it can **not** change between
   XI versions (e.g. due to reflection ordering) as it could break
   comparison code;

This is done by only adding a map to the member that has a [Field] and
means that:

2.1. the _favorite_ enum member should be the one with the [Field]; and

2.2. a [Field] value can only be used once per enum (or else we report
     an BI1046 error). This also solve the duplicate code generation for
	 the constant loading code;

Reference:
* https://bugzilla.xamarin.com/show_bug.cgi?id=46285
2016-11-02 21:46:04 -04:00
Rolf Bjarne Kvinge f1420510da [xharness] Add support to configure which tests to run on Jenkins by using labels on pull requests. (#1082) 2016-11-02 16:46:32 +01:00
Rolf Bjarne Kvinge b13bbe0dfb [xharness] Detect and report launch failures better. (#1079) 2016-11-02 15:43:55 +01:00
Rolf Bjarne Kvinge e6b0ed232d [mtouch tests] Remove unnecessary parameter from helper method. (#1093) 2016-11-02 14:44:37 +01:00
Rolf Bjarne Kvinge 7728c4cd19 [registrar] Use metadata tokens instead of strings to find types and methods. (#1085)
Use metadata tokens instead of strings to find types and methods.

This makes the code to find methods more compact (a lot less strings in the
executable, and additionally in most cases a compact representation (32-bit
integer) of the corresponding metadata token and additional information can be
used, which results in less executable code (fewer parameters to methods,
etc)), resulting in smaller executables.

Size savings are around 200kb for dont link apps, and 20-60kb for linked apps
(this obviously varies a lot depending on how much has to registered by the
registrar).

|                |    Before     |     After     |       Diff        |
|----------------|--------------:|--------------:|------------------:|
| dontlink/32bit |  102.810.144  |  102.609.456  | -200.688 = -0,20% |
| dontlink/64bit |  107.420.576  |  107.221.792  | -198.784 = -0,19% |
| linksdk/32bit  |   40.957.296  |   40.936.864  |  -20.432 = -0,05% |
| linksdk/64bit  |   43.113.136  |   43.093.936  |  -19.200 = -0,04% |
| linkall/32bit  |   38.410.032  |   38.348.288  |  -61.744 = -0,16% |
| linkall/64bit  |   40.315.200  |   40.267.344  |  -47.856 = -0,12% |

Additionally I've removed the `lazy_map` dictionary, which we populated at
startup and was used to map between Class instances and the corresponding
managed type's FullName, and instead iterate over a native array of Class ->
metadata token mappings whenever we need to look up the managed type for a
certain Class instance.

This is slightly slower for each type we need to look up (for a non-linked app
there might be a 2000-3000 entries in the native array, which would be
iterated instead of using a hashtable lookup), but it's only done once per
type and there's a significant startup memory improvement.

For a non-linked test app I get the following using the Xamarin profiler:

|                   |  Before |  After  |       Diff      |
|-------------------|--------:|--------:|----------------:|
| Memory allocated  |  2,8 MB |  2,4 MB | -0,4 MB = -14 % |
| Objects allocated |   43678 |   38463 |   -5215 = -12 % |
| Private bytes     | 26,6 MB | 24,4 MB | -2,2 MB = -8,3% |
| Working set       | 26,6 MB | 24,4 MB | -2,2 MB = -8,3% |
2016-11-01 14:34:56 -04:00
Rolf Bjarne Kvinge dddd243dfd [xharness] Update to remove OpenTK-1.0 instead of OpenTK references after XI/Classic removal. (#1084) 2016-11-01 13:13:52 -04:00
Sebastien Pouliot 7b38187479 [mtouch][mmp] Unify user resources removal as a link step (#1026)
Right now the logic exists in a few places, both in and outside the
linker. We recently began to use part of the linker pipeline in normal /
all builds so it's easier to share (and unify) the code now.

The real gain is to avoid copying assemblies, in particular large ones,
more than strictly needed while building.

E.g. a build including a very large 1.3GB assembly, with several
native libraries embedded, save a lot of time avoiding the rewrites

mtouch (before)
		Total time: 64202 ms

mtouch (after)
		Total time: 34840 ms

* Add XM support for RemoveUserResourcesSubStep

* Tests supplied by @chamons
2016-11-01 13:11:25 -04:00
Rolf Bjarne Kvinge 23b693c5ff [mtouch] Update mdb files even if the corresponding assembly didn't change. Fixes #39535. (#1072)
Update mdb files even if the corresponding assembly didn't change, because the
mdb can change even if the assembly didn't (if whitespace was modified in the
source code, causing code lines to move).

https://bugzilla.xamarin.com/show_bug.cgi?id=39535
2016-11-01 15:37:37 +01:00
Rolf Bjarne Kvinge 5415c90092 [xharness] Add support for running the mtouch tests on Jenkins. (#1077) 2016-11-01 14:43:37 +01:00
Rolf Bjarne Kvinge c521bfde62 [mtouch] Don't link native libraries into the main executable if we're doing an incremental build. Fixes #42473. (#1073)
Native libraries are already linked into the dylib for the binding assembly,
which means that if we also link it into the main executable, the native code
ends up twice in the app (which is bad for many reasons).

https://bugzilla.xamarin.com/show_bug.cgi?id=42473
2016-10-31 16:55:45 -04:00
Rolf Bjarne Kvinge e8789f2af6 [mtouch] Copy frameworks referenced by watch extensions to the bundle. (#1070)
Watch extensions do not have access to the containing app bundle on the phone,
so instead copy frameworks to the extension itself.
2016-10-31 17:02:37 +01:00
Rolf Bjarne Kvinge 0b3ab9cc15 [mtouch] Copy third-party frameworks from extensions to the main app's Frameworks directory. Fixes #45800. (#1069)
The container app may not reference the same third-party frameworks as
extensions, which means that we must make sure the extension's frameworks are
also included in the app bundle.

So when building extensions save a list of all third-party frameworks, and
then read that list and include those frameworks when building the main app.

https://bugzilla.xamarin.com/show_bug.cgi?id=45800
2016-10-31 12:36:06 +01:00
Chris Hamons 612f52bd80 Fix binding project LinkWithAttributes generation to prevent unnecess… (#1029)
* Fix binding project LinkWithAttributes generation to prevent unnecessary rebuilds

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

* Remove duplicate ToString call
2016-10-31 10:37:10 +01:00
Rolf Bjarne Kvinge f1af70998f [tests] Fix test compilation. (#1065) 2016-10-31 10:09:57 +01:00
Rolf Bjarne Kvinge 0c43ddc615 Disable managed exception marshaling when the debugger is attached. Fixes #45116. (#1055)
Managed exception marshaling interferes with the debugger, because it adds
exception handlers to executing code, which makes the Mono runtime think an
exception is handled when logically it's not (although technically it is).

The consequence is that the IDEs will only be notified when we re-throw the
exception after catching it, making it impossible for the IDEs to stop when
the exception is thrown (they will instead stop when we re-throw the
exception).

So disable managed exception marshaling (unless the user changed the default
behavior) when a debugger is attached.

This is the same behavior as Xamarin.Android.

https://bugzilla.xamarin.com/show_bug.cgi?id=45116
2016-10-28 19:07:01 +02:00
Rolf Bjarne Kvinge 4371ea4540 [static registrar] Fix registration of generic types. Fixes #44926. (#1063)
https://bugzilla.xamarin.com/show_bug.cgi?id=44926
2016-10-28 18:42:45 +02:00
Rolf Bjarne Kvinge dde242c32a Allow using LinkWith attribute without a native library. (#997)
This makes it possible to set linker flags per assembly:

    [assembly: LinkWith (LinkerFlags = "-lsqlite3")]

Which is required when incremental builds is enabled and a particular assembly
needs special linker flags (because we don't propagate the global -gcc_flags
to each dylib we build when doing incremental builds).

Also add an option to set the dlsym mode for an assembly (using the LinkWith
attribute).
2016-10-28 10:50:42 -04:00
Rolf Bjarne Kvinge b6a0d06143 [tests] Remove dead code. (#1056) 2016-10-28 10:15:12 -04:00
Rolf Bjarne Kvinge bdbbea962a [tests] Unifiy namespaces in mtouch tests. (#1057) 2016-10-28 10:15:00 -04:00
Vincent Dondain 5d25bdc754 [mtouch/tests] BuildAndLaunchTime + RegistrarTime test (#1051)
- BuildAndLaunchTime is replacing AppLaunchTime as it calculates both
  build time and launch time for different linker modes.

* [mtouch/tests] Add RegistrarTime test

- Also fix MTouchTool --registrar:dynamic
2016-10-28 08:44:13 -04:00
Sebastien Pouliot 7177c8c811 [tests] Disable XM NSMetadataItem test as it randomly fails on bots (#1052) 2016-10-27 16:51:15 -04:00
Rolf Bjarne Kvinge 2fadd551de [tests] Fix xcode8.1 merge failure causing compilation error (duplicated method). (#1050) 2016-10-27 15:24:28 -04:00
Chris Hamons 82bfb2fe39 Fix XM dependency tracking of mmp bundle to prevent rebuilds (#1014)
- https://bugzilla.xamarin.com/show_bug.cgi?id=45764
- _CompileToNative's output in msbuild was incorrectly set to:
 $(_AppBundlePath)Contents\MacOS\$(TargetFileName) when the generated
 file lives at $(_AppBundlePath)Contents\MonoBundle\$(TargetFileName).
- This means we'd always try to rebuild, which can be rather time consuming.
- The XI target file is just different enough to require a seperate fix.
2016-10-27 20:15:28 +02:00
Vincent Dondain b252093691 [mtouch/tests] Add TimingTests (#1007)
* [mtouch/tests] Add TimingTests

- New MLaunchTool.
- AppLaunchTime (mlaunch): time to launch an application on the simulators.
  How it works: we first open the simulator by launching a dummy app. This allows us to detect if there are any launch watchdogs.
  Therefore, for consistency, all measurements are done with the simulator already open.
  In the case of the AppLaunchTime test, we build the app with the default config and launch it. It's automatically killed by the simulator
  because it does not have a valid entry point but this is fine because it also kills the process and lets us stop the stopwatch.
  We then simply log the time performance.
2016-10-27 14:05:44 +02:00
Sebastien Pouliot 8c93e7758d Merge branch 'xcode8.1' 2016-10-26 15:56:34 -04:00
Sebastien Pouliot ecf90178fa [tests] Update mlaunch executable to work with Xcode 8.1 GM 2016-10-24 18:28:18 -04:00
Rolf Bjarne Kvinge 1e4b395368 Revert "Fix binding project LinkWithAttributes generation to prevent rebuilds" (#1018) 2016-10-24 07:13:51 +02:00
Chris Hamons a8daab7cdd Fix binding project LinkWithAttributes generation to prevent unnecessary rebuilds (#1017)
- https://bugzilla.xamarin.com/show_bug.cgi?id=45762
2016-10-21 18:24:15 -04:00
Chris Hamons 3775d4c891 [XM] Add test for remote config fix in 3e1204278b (#1005) 2016-10-18 22:27:10 -04:00
Sebastien Pouliot ad3ec49f7c [test][mac-apitest] Fix NSMetadataItem on older bots (#1002)
* NSMetadataItem initWithURL: is 10.9+ so we can't run this test on
  earlier bots;

* NSRunningApplication.CurrentApplication.BundleUrl is 10.10 and it
  seems wrench bots don't like it;
2016-10-18 13:08:21 -04:00
Sebastien Pouliot 2b42122a5c [foundation] Add missing helper properties on NSMetadataItem. Fixes #34248 (#993)
* Added missing helper properties for iOS
* Made NSItemDownloadingStatus a "smart enum", i.e. field aware;
* Disable default .ctor for XAMCORE_4_0, such instances are unusable;
* Added `initWithURL:` for macOS [2] as it made it easier to test the
  changes since macOS it allows creating instances of `NSMetadataItem`
  from an URL.

references:
[1] https://bugzilla.xamarin.com/show_bug.cgi?id=34248
[2] osx.unclassified:!missing-selector! NSMetadataItem::initWithURL: not bound
2016-10-14 14:57:17 -04:00
Sebastien Pouliot 85e5c685e8 [tests] Subset of the classic removal fix to green'ify the branch (#999)
Subset of:

commit 0863e412b4
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date:   Fri Sep 30 21:02:17 2016 +0200

    Remove XI/Classic support (#926)

    * [tests] Remove Classic SDK tests.

    * Remove XI/Classic support.

    This also means we can remove support for the legacy registrars.

    * [monotouch-test] Remove legacy registrar tests.

    * [tests/mtouch] Remove Classic tests (and legacy registrar logic).

    * [tests/scripted] Fix tests to reference Xamarin.iOS.dll.
2016-10-14 13:09:30 -04:00
Rolf Bjarne Kvinge 39fd0efc66 [tests] Disable the docs tests until the documentation process is fixed. (#965) 2016-10-13 19:49:23 -04:00
Rolf Bjarne Kvinge 2a9f5a8238 Merge pull request #988 from rolfbjarne/bug44709d
Unify stret detection between the generator and platform assemblies, and fix stret detection on watchOS. Fixes #44709.
2016-10-13 19:44:02 +02:00
Chris Hamons 17bb354dca [XM] Fix 44707 by fixing launcher and mmp (#971)
- https://bugzilla.xamarin.com/show_bug.cgi?id=44707
- Sets MONO_CFG_DIR to work around embedding API bug: https://bugzilla.xamarin.com/show_bug.cgi?id=45279
- Added ability to run single XM test by setting XM_TEST_NAME to full test name.
2016-10-13 10:42:05 -05:00
Vincent Dondain e338dce193 [storekit] Update for iOS 10.1 beta 2 (#977) 2016-10-13 11:23:37 -04:00
Rolf Bjarne Kvinge d395e8df59 [tests] Generate some trampoline and registrar tests.
Generate trampoline and registrar tests that tests if a return type requires objc_msgSend or objc_msgSend_stret.

Now it's much easier to test new return types (a single line of code), which
avoids a _lot_ of copy-pasting, and makes sure all the different variations
are tested properly.

These new tests found several bugs, which are fixed in subsequent commits.
2016-10-13 15:10:43 +02:00
Rolf Bjarne Kvinge 70acf25bb4 [tests] Fix timeout in BuildTestProject. (#983)
In 9d4be4c we started building fat applications when building for device in
our test projects. That causes the BuildTestProject to take twice as long,
thus hitting a 5 min timeout value, causing the test to fail.

So change the test to the previous behavior: we were only building test
projects for ARM64 previously, so do that.
2016-10-13 10:40:39 +02:00