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

8148 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 969d5d92ed
[Harness] Generalize the RunTestTask to allow it to be used in the CLI. (#8380)
Move all the logic outside and use it as a Composition pattern, later
this class can be used in the CLI so that we share the logic of building
and tested.
2020-04-14 18:39:58 -04:00
Sebastien Pouliot af7da4b233
[generator] Handle (ignore) C#8 special nullability attributes (#8382)
C# 8 nullability attributes are special (injected into assemblies) and
not meant to be used from C# source code.

We do not **use** them (we generated them) so existing attributes can
be ignored (filtered) by the generator.

Fix https://github.com/xamarin/xamarin-macios/issues/8347
2020-04-14 15:25:00 -04:00
Manuel de la Pena bbffb308e8
[Harness] Donet doest not need to restore. (#8383)
Removed line due to a bad merge, re-add it.
2020-04-14 15:03:12 -04:00
Manuel de la Pena dbc89f01a4
[Harness] Create IBuildToolTask and use it in the RunTestTask. (#8375)
In order to de-couple the RunTestTask from Jenkins, create an interface
to be implemented, which is pass to use as a member (Composition
pattern). In order to do that, do not expose Jenkins as a property of
the interface because it is required just by the base constructor.

Moving the the use an interface meant a lot of small changes that
should have no real effect (the compiler should have caught any possible
issues).
2020-04-14 13:11:55 -04:00
Rolf Bjarne Kvinge 511124f4b1
[mmp] Explicitly resolve assemblies from the GAC / system mono. (#8377)
Cecil has a fall-back mode where it looks in the GAC / system mono for
assemblies when failing to find them elsewhere. This is not the expected
behavior when using Xamarin.Mac in the Full/XM mode, because then we should
only resolve to assemblies shipped with Xamarin.Mac.

Unfortunately doing so will break apps (our own tests break), so instead
change our resolution to be explicit about where we find assemblies, and if we
find assemblies in the GAC / system mono when we're not supposed to, then show
a warning.

Also add a fall-back mechanism, where we use the old logic instead, in case
the new logic is not 100% compatible with the old one.

This showed up when I tried to port mmp to dotnet, because then Cecil stopped
looking in the GAC / system mono for assemblies (Cecil has a special case when
running on Mono to look in Mono's GAC), and tests started failing.
2020-04-14 16:32:42 +02:00
Manuel de la Pena c150679630
[Harness] Refactor certain class names to simplify the extraction of the RunTestTask. (#8372)
The initial idea of the refactoring looked nice but as soon as we want
to get the RunTestTask out of jenkins, we have a number of naming
issues. Move the tools to not use the *Task postfix so that it is
cleaner and we can later extra the RunTestTask better.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-04-14 08:04:35 -04:00
Manuel de la Pena 98d21d742c
[Harness] Ensure that the generator tests are set when we modify the sources. (#8371)
fixes: https://github.com/xamarin/xamarin-macios/issues/8363

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-04-14 07:58:24 -04:00
Rolf Bjarne Kvinge 794fd9983d
[mmp] Make the system mono location customizable. Fixes #7923. (#8369)
This also makes things a bit easier with regards to the .NET 5 work.

Fixes https://github.com/xamarin/xamarin-macios/issues/7923.
2020-04-14 09:09:55 +02:00
Manuel de la Pena 5e0131db27
[Harness] Fix HML report for NUnitTestTasks. (#8367)
PR https://github.com/xamarin/xamarin-macios/pull/8184 removed the
inheritance with TextWriter, therefore the `as` will return null and we
will not generate the Html report. In this particular case, we do not
need an ILog, we just use it to get a path to the correct location,
therefore, we can create the file using the full path and pass it to the
xslt.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8364
2020-04-13 13:51:48 -04:00
Chris Hamons 13fa3c96ab
Invert order of download table to be most recent first (#8362) 2020-04-13 11:33:46 -05:00
Manuel de la Pena 01d2b62097
[AppKit] Ignore test in earlier versions of Mac OS X. (#8357)
The api is present since Mac OS X 10.11 but we get an exception when
executing it in earlier versions of Mac OS X, it just works on 10.15.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8356
2020-04-13 12:21:06 -04:00
Rolf Bjarne Kvinge 00d39b9b6d
[tests] NugetRestore should only restore, not build. (#8360)
"msbuild /restore" will run nuget restore, then build. "msbuild /t:Restore"
will just run the Restore target, which should just restore.

This becomes significant when we later try to do "msbuild build", and expect
warnings to show up. If we previously built the project unintentionally, those
warnings won't show up because nothing will actually be built.
2020-04-13 17:44:17 +02:00
Rolf Bjarne Kvinge 3005f8fa0f
[AppKit] Fix typo hWord -> Word. (#8359) 2020-04-13 17:36:07 +02:00
Chris Hamons 035b376182
[README] Add macOS download package table (#8343)
- https://github.com/xamarin/xamarin-macios/issues/7462
2020-04-13 10:00:23 -05:00
Rolf Bjarne Kvinge 665b20a44c
[tests] Fix location of aot.cs in mmptest.csproj (#8361) 2020-04-13 16:08:15 +02:00
Rolf Bjarne Kvinge f3ee011797
[xharness] Automatically generate xharness make dependencies. (#8324) 2020-04-13 09:26:55 +02:00
Manuel de la Pena 7ac67e6e33
[AppKit] NSScreen properties can be executed in non-UI threads. (#8345)
Allow all the properties to be executed outside the UI thread. This has
been tests with Xcode using MTC.
2020-04-10 19:25:56 -04:00
Manuel de la Pena 382f2ad997
[Tests] Bump language used in the mac binding tests. (#8348)
* [Tests] Bump language used in the mac binding tests.

They broke with nullability, we need to use the latests lang version.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8346
2020-04-10 19:25:30 -04:00
Manuel de la Pena a2f57b38d6
[Harness] Generalize MSBuildTask and DotnetBuildTask. (#8306)
Move all the logic outside of the Jenkins namespace. Rework a little the
inheritance to make it nicer in the constructors.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-04-10 16:50:50 -04:00
Sebastien Pouliot 8d3987b84a
[xtro][bindings] Add xtro support for nullability and fix some bindings (#8335)
Enabling this will ensure that future bindings (and Xcode updates that
change nullability information) are spotted right away.

The binding fixes are **not** complete, i.e. what was done was mostly
to debug the xtro rule and find corner cases. The backlog will be
_ignored_ so the builds won't fail.
2020-04-10 11:00:47 -04:00
Sebastien Pouliot 48b813e8a3
[linker] Fix infinite queue found with nullability PR (#8337)
and removed previous workaround

Replace previous attempt https://github.com/xamarin/xamarin-macios/pull/8336
2020-04-10 10:59:01 -04:00
Manuel de la Pena 4621b467df
[AppKit] Allow static properties to execute on non-UI threads. (#8330)
VSMac has failing tests when they query the NSScrees.Screens property
which the following swift code shows that it can be executed in a diff
thread:

```swift
import Cocoa
import AppKit

DispatchQueue.global(qos: .background).async {
    print("This is run on the background queue")

    print(Thread.current)
    var screens = NSScreen.screens
    print (screens.count)
}
```

Fixes: https://github.com/xamarin/xamarin-macios/issues/8329
2020-04-09 10:24:16 -04:00
Sebastien Pouliot a5ac0ea102
[generator] Add C#8 nullability into generated code (#7570)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-09 09:29:28 -04:00
Manuel de la Pena e668545555
[Harness] Generalize the BuildProjectTask (#8299)
Use composition to generalize the BuildProjectTask to later reuse it in
the CLI.

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-04-08 20:09:10 -04:00
Manuel de la Pena 5b99859321
[Harness] Move BuildToolTask to a more general namespace. (#8287)
Move the task and use composition so that we can reuse the code. This
will later allow other projects to use the class without the need of
Jenkins or Harness and just implement the base class.



Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-04-08 15:03:33 -04:00
Manuel de la Pena a6955968fa
[Master] Bump mono to 165f4b03 to match android. (#8326)
Commits:

* mono/mono@165f4b0341: [2020-02][debugger] Fix NOT_IMPLEMENTED while debugging. (#19450)
* mono/mono@b04dc7e6a4: Bump corefx to get https://github.com/mono/corefx/pull/395 (#19426)

Diff: ecde08600b...165f4b0341

Related android PR: https://github.com/xamarin/xamarin-android/pull/4540
2020-04-08 14:50:26 -04:00
Rolf Bjarne Kvinge 2e8e26ae1d Bump maccore to get msbuild.zip fix.
New commits in xamarin/maccore:

* xamarin/maccore@ad1696d6f3 Restore Xamarin.iOS.Tasks project for msbuild.zip (#2198)

Diff: a1ad303faf..ad1696d6f3
2020-04-08 13:51:22 -03:00
Přemek Vysoký db921689a9
[Harness] Remove launchTimeout parameter from TestReporter, move factories (#8322) 2020-04-08 11:32:47 -04:00
Rolf Bjarne Kvinge 4b917ad2de
Create a general rule to create makefile fragments for project files. (#8320)
The generator project file still needs some custom logic, because we can't put
the generated makefile fragment next to the csproj (that would break the
API/generator diff).
2020-04-08 16:59:17 +02:00
Rolf Bjarne Kvinge 58f0a0a2c0
[tests] Fix building 'test.config' by passing 'test.config' as an argument to make and not as the working directory to the process. (#8315) 2020-04-08 16:20:21 +02:00
Rolf Bjarne Kvinge 8e0a6d5319
[mmp] Remove unused files. (#8310) 2020-04-08 16:20:10 +02:00
Rolf Bjarne Kvinge c0abd628d3
[mtouch/mmp] Use the standard DEBUG define to determine when we're running from inside an IDE. (#8311)
We're using the Release configuration to build the mtouch and mmp binaries
that we ship, which means that we can use the Debug configuration for
debugging from an IDE, and use the standard conditional compilation symbols to
identify that case.
2020-04-08 16:20:04 +02:00
Rolf Bjarne Kvinge 28d97d6b6b
[xharness] Don't overwrite variations. (#8312)
This means different variations of tests won't show up as identical in the
html report.
2020-04-08 16:19:58 +02:00
Rolf Bjarne Kvinge 82f3bacc57
[xharness] .NET projects don't need 'nuget restore', they're always restored automatically. (#8313) 2020-04-08 16:19:52 +02:00
Rolf Bjarne Kvinge da2090c460
[tests] Move mmptest/regression to mmp-regression. (#8314)
dotnet doesn't like projects within projects in the file system, because of
default inclusion behavior, where the top project will want to include the
source files for the nested projects.

There are ways around that, but the easiest is to just make sure there aren't
projects within other project directories.
2020-04-08 16:19:47 +02:00
Rolf Bjarne Kvinge d3674f7efc
[mmp] Move tools/mmp/tests to tests/mmp-aot-tests. (#8317)
This is to avoid having projects within other projects' directories, which
ends up being cumbersome in .NET 5 due to default inclusion behavior.
2020-04-08 16:19:39 +02:00
Rolf Bjarne Kvinge 3d7a38e464
[mtouch/mmp] Use a single SdkVersions.cs in tools/common. (#8318)
No need to have two identical files around.
2020-04-08 16:19:34 +02:00
Rolf Bjarne Kvinge 0299a66604
[mtouch/mmp] Simplify makefile a bit. (#8319) 2020-04-08 16:19:19 +02:00
Rolf Bjarne Kvinge f69ef4f696
Setting an environment variable to null doesn't work in .netcore. (#8316)
There is a difference between mono and .netcore with regards to environment
variables when launching processes.

For the following example:

    process.StartInfo.EnvironmentVariables ["FOO"] = null;

.netcore will launch the process with an empty FOO variable, while mono will
launch the process with no FOO variable set.

So unstead remove the variable from the collection of environment variables
(this works fine even if the collection doesn't contain the variable).

Ref: https://github.com/dotnet/runtime/issues/34446
2020-04-08 16:19:08 +02:00
Manuel de la Pena f891076bd8
[Harness] Move to create a more general TestTasks class to be reused. (#8286)
Some of the Jenkins test tasks are very useful and do A LOT of stuff. So
we try to generalize the base class, to later be able to share the most
usebul ones in the shared lib.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-04-07 20:20:38 -04:00
Rolf Bjarne Kvinge c5ade80b2e Fix whitespace. 2020-04-07 14:01:52 -03:00
Rolf Bjarne Kvinge 24c2745253 Bump maccore.
New commits in xamarin/maccore:

* xamarin/maccore@a1ad303faf Include MSBuild assemblies in msbuild.zip (#2195)

Diff: a14f74b40a..a1ad303faf
2020-04-07 14:01:52 -03:00
emaf df8afe584b [msbuild] Conditionally include MSBuild assets
Updates the Microsoft.Build* references to use PackageReference to match Xamarin.iOS.Tasks.Core.csproj, and conditionally includes the MSBuild assets so these can be copied to the output directory if needed. If `IncludeMSBuildAssets` is not set, the behavior will remain the same, the MSBuild assemblies won't be copied to the output dir.
2020-04-07 14:01:52 -03:00
Sebastien Pouliot b279401727
[linker] Remove nullability attributes than are not used at runtime (#8301) 2020-04-07 11:00:15 -04:00
Sebastien Pouliot 221f3f8b92
Bump versions to .21. now that d16-7 branch was created (#8300) 2020-04-07 10:58:54 -04:00
Manuel de la Pena b6fbae5cfb
[Foundation] As a default, do not use the workaround in NSUrlSessionHandler for thethreadpool. (#8296)
When an application was moved the the background, the thread pool from
mono would be left in an unknonw state, making applications to stale
(https://xamarin.github.io/bugzilla-archives/58/58633/bug.html#c7).

This work was added in https://github.com/xamarin/xamarin-macios/pull/5463

We now set the default behaviour to skip the workaround to see if the
new provided mono works as expected. We do not fully remove the
workaround because we need some real world testing.

If the new ThreadPool from mono does not work as expected we do provide
a property to re-add the workaround. The BypassBackgroundSessionCheck
can be set to false to allow users get it back.

The following is an example usage of the API:

```csharp
// create your own handler instance rather than using the one provided
by default.
var handler = new NSUrlSessionHandler() {
  BypassBackgroundSessionCheck = false, // readd the hack
};
var httpClient = new HttpClient (handler); // use the handler with the hack
```

This is a partial fix for https://github.com/xamarin/xamarin-macios/issues/7080
2020-04-06 18:56:52 -04:00
Alex Soto 55c6bd74e5
[maccore] Bump maccore to bring localization revert (#8298)
New commits in xamarin/maccore:

* xamarin/maccore@a14f74b40a Revert "[Localization] Rework mlaunch (#2171)" (#2194)
* xamarin/maccore@9939a3812d [mlaunch] Accept the latest C# language version in projects (#2193)

Diff: fdeec0f4cc..a14f74b40a
2020-04-06 17:21:28 -04:00
Přemek Vysoký 530f2a2bfa
[Harness] Rename device management classes (Devices, Simulators, ILoadAsync) (#8295) 2020-04-06 14:33:27 -04:00
Manuel de la Pena 6c9f62f56e
[Introspection] Fix a false typo in mac modern typo tests. (#8294)
Add Sha as an allowed word in the typo tests, it is a well known
acronym.
2020-04-06 14:31:46 -04:00
Přemek Vysoký b4a262eb42
Fix unit tests, make Devices fields readonly (#8293) 2020-04-06 10:57:31 -04:00