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

8569 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena f4d165863a
[DevOps] Clean all workspaces and try to fix our space problems. (#9028) 2020-07-07 18:45:50 -04:00
Rolf Bjarne Kvinge e193ed7316
[msbuild] Unify all the UsingTask statements. (#8998)
Some of these have been duplicated across various targets files, and when
adding a new task it's annoying to forget to add it somewhere.

So just have them all in the same place, so that they're loaded in every file.

There are still duplicates between the iOS and Mac tasks, but those will be
unified in a later PR.
2020-07-07 15:52:06 +02:00
Rolf Bjarne Kvinge ac36305a2d
[msbuild] Unify the _GenerateBindings target and a few properties related to binding projects. (#8997) 2020-07-07 15:46:23 +02:00
Rolf Bjarne Kvinge 4e2d612dae
[msbuild] Unify XamarinMacFrameworkRoot and MonoTouchSdkRoot into _XamarinSdkRoot. (#8995) 2020-07-07 15:45:42 +02:00
Manuel de la Pena edd8a2c896
[Foundation] Avoid LINQ in bindings. Fixes #8773 (#8991)
LINQ was giving issues in a client application with the Link SDK
enabled. The root cause is that we had issues in the LINQ operations
that are used to create the headers for the native request.

We fix this by:

1. Do not modify the managed request headers. Do not modify an object we
   do not own.
2. Remove the use of LINQ

This issue was probelmatic when the client application was setting the
headers that are used by the HttpContent. If headers were not added in
the content, the issues did not happen.

Co-authored-by: Alex Soto <alex@alexsoto.me>
2020-07-06 10:51:50 -04:00
Manuel de la Pena e1d537107f
[Foundation] Do expose server errors. (#8990)
Creating a good API is hard. The delegate DOES return two different
errors.

1. Client errors in the error variable in the delegate method.
2. Server errros in the error in the task in the delegate method.

We need to expose both of them to the user in case there is an issue in
any of them. An exception should be thrown ig any is not null.

PD: As per apple docs:

> The only errors your delegate receives through the error parameter are
> client-side errors, such as being unable to resolve the hostname or
> connect to the host. To check for server-side errors, inspect the
> response property of the task parameter received by this callback.
2020-07-06 10:51:06 -04:00
Rolf Bjarne Kvinge 9a17e053b7
[dotnet] Add some project capabilities. (#9013)
* [.NET 5] Start adding some project capabilities (#3)

Aligned with XA too, see https://github.com/xamarin/xamarin-android/pull/4383.

We'll start using Apple instead of iOS for these things at the IDE level since many
behaviors don't actually depend on iOS but also apply to tvOS, watchOS, and so on.

These capabilities go before other imports just in case additional packages/targets
from the SDK need to access them too.

* Remove the LaunchProfiles capability for the CPS integration (#8472)

Implements https://work.azdo.io/1112733 as a workaround for the conflicts between
the built-in launchsettings.json-based .NET Core debugger and our Mono debugger.

Co-authored-by: Daniel Cazzulino <daniel@cazzulino.com>
2020-07-06 14:31:27 +02:00
Rolf Bjarne Kvinge 31f4a2e22a
[tests] Skip a few networking tests on macOS 10.9. Fixes #xamarin/maccore@2221. (#9012)
Fixes https://github.com/xamarin/maccore/issues/2221.
2020-07-06 13:26:09 +02:00
Rolf Bjarne Kvinge 739ab8dfd4
Merge pull request #8980 from rolfbjarne/dotnet-xharness-introspection
[dotnet] Make the introspection tests pass in the 64-bit iOS simulator.
2020-07-06 11:14:40 +02:00
Rolf Bjarne Kvinge 46b6d3787d
[mtouch] Regenerate Errors.designer.cs after some entries were removed from Errors.resx. (#8994) 2020-07-03 17:40:25 +02:00
Rolf Bjarne Kvinge 4dabb46d92 Bump Touch.Unit.
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@b4e8606 [TouchRunner] Turns out NUnitLite.OutputWriter.WriteResultFile needs an actual test filter, so provide one.
* spouliot/Touch.Unit@5dc251a [TouchRunner] Turns out NUnitLite.OutputWriter.WriteResultFile needs an actual test filter, so provide one.

Diff: 6c5bb930b3..b4e8606a85
2020-07-03 16:25:08 +02:00
Rolf Bjarne Kvinge 2e11f0bf4e [xharness] Don't generate makefile targets for .NET projects.
They end up with the same make targets as non-.NET targets, which prints
warnings in the terminal when running make.

We're not using the makefile targets much anymore, so postpone implementing
them for .NET until we need them for some reason.
2020-07-03 11:31:45 +02:00
Rolf Bjarne Kvinge 5d5a47b990 [tools] Don't link with a framework that isn't available in the simulator. 2020-07-03 11:14:03 +02:00
Rolf Bjarne Kvinge 6f6b8e281b Merge remote-tracking branch 'origin/main' into dotnet-xharness-introspection 2020-07-03 11:12:50 +02:00
Rolf Bjarne Kvinge 8d7cd46652
[msbuild] Share a few binding variables: BaseLibDllPath, BTouchToolPath and BTouchToolExe. (#8988)
Also switch to invoking bgen instead of the btouch-native/btv/bwatch wrapper
scripts, since the wrapper scripts just call bgen with an additional
--target-framework argument, which our BTouch task already does anyway, which
means it's not necessary to call the wrapper scripts anymore.

This also required:

* Moving the code to detect which Xamarin.Mac profile we're building for into
  Xamarin.Shared.props, since the binding variable logic need to know which
  Xamarin.Mac profile we're building for.

* Setting IsBindingProject property earlier in the build process, to make sure
  it's set before importing Xamarin.Shared.props.
2020-07-03 11:01:01 +02:00
Rolf Bjarne Kvinge 4eff2c3700
[msbuild] Unify the logic to copy bundle resources to the app. (#8987)
* For Xamarin.Mac, this means using the _ComputeBundleResourceOutputPaths and
  _CopyResourcesToBundle targets from Xamarin.iOS instead of the
  _CopyContentToBundle target (which is now unused and thus removed).

* Adapt the Xamarin.iOS logic (now shared) to handle the fact that the
  resources shouldn't always go into the root appbundle directory (since they
  go into Contents/Resources/ for macOS apps), by using the
  '_AppResourcesPath' variable to specify just this.

Once upon a time the Xamarin.iOS logic was identical to the Xamarin.Mac logic,
but then we implemented support for asset packs
(a98693f07e)
and the code diverged. This means that unifying the logic again is a step
towards making asset packs work for Xamarin.Mac apps.
2020-07-03 11:00:36 +02:00
Rolf Bjarne Kvinge 4ed68336d7
[msbuild] Share the MSBuild logic for CollectBundleResources and a few related properties. (#8983)
* [msbuild] Share the MSBuild logic for CollectBundleResources and a few related properties.

* [msbuild] Fix/unify more resource collection code.

* Remove the _CollectBundleResources target for Xamarin.iOS binding projects,
  we now have a single one for all project types.
* Add an IsBindingProject property to distinguish binding projects from other
  projects.
* Use the IsBindingProject to only depend on the other _Compile<ResourceType>
  targets when we're not building a binding project (which seems to be the
  reason why the _CollectBundleResources target was duplicated between normal
  projects and binding projects for both Xamarin.iOS and Xamarin.Mac: the
  binding project version didn't have any dependencies).
2020-07-01 20:13:05 +02:00
Rolf Bjarne Kvinge d621e3a854
[dotnet] Use the exact same dotnet version in our global.jsons as in Make.config. (#8984)
This avoids a possible difference in behavior, because in our system
dependency check we verify that the system has a specific version (which might
succeed), but if we don't pick a specific dotnet version in global.json,
dotnet will pick the latest version, which may behave differently than the one
we have in Make.config.

Thus always use the exact same version, so that we don't run into a difference
in behavior between developers and/or bots.
2020-07-01 17:08:46 +02:00
Rolf Bjarne Kvinge 551ae06f4a
Bump .NET 5 version to preview 7.20317.11. (#8985)
This gets a version with the old library names for mono
(libmonosgen-2.0.dylib) instead of libmono.dylib, which makes it easier to
re-use the existing libxamarin.dylib (since libxamarin.dylib tries to load
libmonosgen-2.0.dylib).
2020-07-01 14:20:36 +02:00
Rolf Bjarne Kvinge 9ace0c6797
[Foundation] Fix code to not cause a potential null error when compiling using the .NET 5 BCL. (#8978)
Fix code to not cause a potential null reference error from csc when compiling
using the .NET 5 BCL:

> Foundation/DictionaryContainer.cs(330,47): error CS8604: Possible null reference argument for parameter 'source' in 'IEnumerable<NSObject> Enumerable.Select<T, NSObject>(IEnumerable<T> source, Func<T, NSObject> selector)'.

And do so by rewriting Linq code, which also makes the code much less memory
hungry and more performant.
2020-07-01 08:32:42 +02:00
Rolf Bjarne Kvinge e4523d8f9d
[xharness] Try to not have log directories with spaces in them. (#8976)
The simulators won't write stdout/stderr to a path with a space.
2020-07-01 08:28:30 +02:00
Manuel de la Pena ce244b7ccd
[DevOps] Release device bots as soon as possible. (#8979)
The upload of the results takes 2 hours:

* 1 hour uploading to vsts test results.
* 1 hour uploading to vsdrops.

This means that we are blocking a device bot for an extra hours (since
the vsdrops is done in a windows bot) when it is not needed. We could
add both uploads to the vsdrops job, but since steps cannot be ran in
parallel, it means that we re waiting for 2 hours when we really do not
have to.

We create two jobs to parallelize the upload of files and we release the
device bot ASAP. That means that our device bots can be free to get new
jobs (and they are the bottle neck) while the windows bots perform the
different uploads.

To make things easier a template that downloads the artifacts was added
so that there is not much code repetition.
2020-06-30 22:19:54 -04:00
Manuel de la Pena b0bcbb2272
[DevOps] Explicitly allow empty xamarin storage paths. (#8977) 2020-06-30 13:15:54 -04:00
Rolf Bjarne Kvinge 919edef176 [introspection] Skip verification of P/Invokes to the libhostpolicy library.
System.Private.CoreLib.dll contains P/Invokes to a libhostpolicy library,
which isn't shipped.

An isssue has been filed to fix this in the runtime: https://github.com/dotnet/runtime/issues/38543
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 9075929561 [introspection] Skip verification of GlobalizationNative_* functions for .NET, they're not shipped yet. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 8f4877a665 [introspection] Adjust native filename for 'libSystem.Native'. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge cf7e855857 [introspection] Skip NUnitLite and MonoTouch.Dialog in .NET 5. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge b303f5e699 [introspection] Disable tests that require crypto due to dotnet/runtime#36897 on .NET. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge f69ed9a25e [introspection] Adapt to .NET 5's vision of how ConstructorInfo.ToString () should behave. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 88cd158bd9 [dotnet] Always copy System.Runtime.dll to the .app.
This works around a linker issue: https://github.com/mono/linker/issues/1304
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 5cfbd9fd4d [dotnet-linker] Add a GatherFrameworksStep and use the output when linking the native executable.
Add a GatherFrameworksStep that computes the frameworks an app needs, and
returns the result to the MSBuild tasks.

Then we use that list of frameworks to link the native executable correctly.
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 6f0ed03515 [dotnet-linker] Make an Application instance available from the linker configuration, and add more properties to the compat Application type.
This way it's easier to reuse existing mtouch/mmp code that need an Application instance.
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 9b3916f974 [dotnet-linker] Pass DeploymentTarget, IsSimulatorBuild and SdkVersion to the linker configuration. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 7e4813b8c6 [dotnet] Use the same MSBuild items to specify both weakly and normally linked frameworks.
This is a slight performance improvements when loading the list of frameworks
the managed linker produces, because the MSBuild logic can only load one item
group per file, and if we use two differently named item groups, we'd have to
store weakly and normally linked frameworks in different files.

This way we can store both types of frameworks in a single file.
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge ccdd5b3a44 [dotnet] Collect and copy bundle resources to the app.
The introspection tests have bundle resources and require this to run successfully.
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 650e6e134e [xharness] Skip the old simulator variation for introspection/dotnet for now. 2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 76f456cc0f [xharness] Retrieve a .NET project's OutputPath by running MSBuild.
.NET projects are vastly simplified, which means that the OutputPath can't be
determined by reading the project file itself, it has to be calculated by
MSBuild.

So that's exactly what we do: we run MSBuild on the project file and get it to
print the property we're interested in.
2020-06-30 19:01:07 +02:00
Rolf Bjarne Kvinge 73881846e2 [xharness] Add a GetDotNetExecutable callback and an MSBuildPath property to [I]ProcessManager. 2020-06-30 19:01:06 +02:00
Rolf Bjarne Kvinge 5d257bfb8f [xharness] Improve project cloning to take into account default inclusion behavior for .NET projects.
.NET projects will include files from the current directory by default, which
means that if we clone the project file and write the cloned project file in a
different directory, we'll have to add an automatically included files into
the cloned file manually.
2020-06-30 19:01:06 +02:00
Rolf Bjarne Kvinge 1b703c5fdd [xharness] Create DotNetBuildTasks when we need to build .NET projects. 2020-06-30 19:01:06 +02:00
Rolf Bjarne Kvinge 55cc695697 [xharness] Disable project generation for .NET projects for now. 2020-06-30 19:01:06 +02:00
Rolf Bjarne Kvinge c42803cfde [xharness] Clearly label .NET projects as such. 2020-06-30 19:00:40 +02:00
Rolf Bjarne Kvinge 989cda8b2d [xharness] Add the dotnet introspection project file to our list of projects, and mark it as a .NET project. 2020-06-30 19:00:40 +02:00
Rolf Bjarne Kvinge 55a9697b66 [xharness] Add support for skipping more test variations. 2020-06-30 18:58:42 +02:00
Rolf Bjarne Kvinge 85f0424a55 [tests] AppDomain.DefineDynamicAssembly doesn't exist in .NET, so exclude it from the build. 2020-06-30 18:41:20 +02:00
Rolf Bjarne Kvinge 022092a002 [introspection] Add a .NET project for iOS. 2020-06-30 18:41:16 +02:00
Alex Soto a84276ffcf
[maccore] Bump maccore to support Xcode 12 (#8974)
New commits in xamarin/maccore:

* xamarin/maccore@ce861906d2 [mlaunch] Add new DVTAnalyticsKit dependency (#2242) (#2254) (#2255)

Diff: 8eee91b69c..ce861906d2
2020-06-29 17:28:15 -04:00
Rolf Bjarne Kvinge b465739d23
[xharness] Disable diagnostics when killing Xcode processes. (#8961)
We won't get any useful information anyway, because we won't get stack traces.
2020-06-29 10:10:20 +02:00
Manuel de la Pena 2372a6cfcd
[DevOps] Fix stupid param mistake. (#8971) 2020-06-26 18:27:43 -04:00
Manuel de la Pena 9c91a4ec3c
[DevOp] Allow $amarinStorage to be empty. (#8963)
pwsh will complain if a mandatory parameter is empty. Remove the attr
and allow it to be empty since the if statements do check fir it.
2020-06-26 16:51:21 -04:00