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

8423 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 246b65fa6d
[tests] Add a global.json targeting dotnet 3.1.100 to the dotnet unit tests. (#8728)
Because VSfM isn't able to build this project otherwise:
https://developercommunity.visualstudio.com/content/problem/1056720/cant-build-net-5-project-error-net-core-31-sdk-is.html
2020-06-03 09:00:33 +02:00
Rolf Bjarne Kvinge ce34c1f893
[dotnet] Improve the 'clean' target. (#8729)
Don't nuke the entire DOTNET_DESTDIR, because that means it will be necessary
to run 'make' in the top-level directory again. Instead only clean files that
the dotnet/ directory will re-build.
2020-06-03 09:00:19 +02:00
Jonathan Peppers 4e37ecf65c
[msbuild] missing localization comments - part 3 (#8721)
Fixes: https://github.com/xamarin/xamarin-macios/issues/8468

Added missing `<comment/>` fields for:

* BI1033
* BI1077
* MM2007
* MT0073
* MT0074
* MT0112_c
* MT0113_i
* MT4146
* MT4162

I had to split up the `MT4162` error message, introducing:

* `Errors.MT4162_BaseType` - a base type of
* `Errors.MT4162_Parameter` - a parameter in
* `Errors.MT4162_ReturnType` - a return type in
* `Errors.MT4162_PropertyType` - the property type of

This also removed an argument passed into `string.Format`.
2020-06-02 13:57:11 -05:00
Rolf Bjarne Kvinge 375118331a
[msbuild] Unify XamMacResourcePrefix and IPhoneResourcePrefix into _ResourcePrefix. (#8726) 2020-06-02 16:41:44 +02:00
Rolf Bjarne Kvinge 3ecac56e8b
[mtouch/mmp] Add CFNetwork to our list of frameworks for iOS and macOS. (#8723)
It's already in the list for tvOS and watchOS.
2020-06-02 16:17:51 +02:00
Rolf Bjarne Kvinge 8b8b79ac40
[mtouch] Remove XAMCORE_2_0 define from simlauncher build. (#8725)
It's not used anywhere in the source code anymore.
2020-06-02 16:04:27 +02:00
Rolf Bjarne Kvinge b26dcc7c16
Bump Touch.Unit. (#8724)
New commits in spouliot/Touch.Unit:

* spouliot/Touch.Unit@6c5bb93 [Touch.Client] Add net5 project files. (#65)
* spouliot/Touch.Unit@ef92ff9 Add tvOS version of Touch.Client. (#64)
* spouliot/Touch.Unit@705964d [Touch.Client] Add a client that uses MonoTouch.Dialog and NUnitLite from NuGet. (#63)
* spouliot/Touch.Unit@fbf9f30 Port Touch.Unit to the Unified profile, and remove the NUnitLite tests from the monotouch.tests project. (#62)
* spouliot/Touch.Unit@dfbf8cb [TouchRunner] Update the current element even if showing a sub element with failure info. (#61)
* spouliot/Touch.Unit@d5b1caa [TouchRunner] TestFinished may be called on a background thread, so make sure to execute any UI logic on the main thread. (#60)
* spouliot/Touch.Unit@ba1196f Convert existing projects to Xamarin.iOS/Unified. (#58)
* spouliot/Touch.Unit@f6958a2 Remove code to be compatible with MonoTouch (Classic Xamarin.iOS). (#59)
* spouliot/Touch.Unit@6a10d44 Remove CLSCompliant attribute which causes compiler warnings. (#57)

Diff: 9db795d50d..6c5bb930b3
2020-06-02 16:04:16 +02:00
Rolf Bjarne Kvinge 3589a3b99d [dotnet] Improve tests to verify that the linker has (or hasn't) run. 2020-06-02 16:00:04 +02:00
Rolf Bjarne Kvinge 80d4100627 [dotnet] Pass our custom linker step to the linker. 2020-06-02 15:55:58 +02:00
Rolf Bjarne Kvinge fcd8956d70 [tools] Add dotnet-linker, a project to contain custom linker steps for our net5.0 build. 2020-06-02 15:55:56 +02:00
Rolf Bjarne Kvinge 2ba2362da1 [dotnet] Automatically set PublishTrimmed and SelfContained to true.
PublishTrimmed must be set before we import Microsoft.NET.Sdk, which means we
also have to move the computation of the project type to before we import
Microsoft.NET.Sdk, because we need to know the project type to determine
whether PublishTrimmed and SelfContained should be set to true (neither should
if we're building a class library or a binding project).
2020-06-02 15:55:56 +02:00
Rolf Bjarne Kvinge 52686eab6a [tools] Add support for generating a csproj dependency file for net5.0 projects.
* Add support for using dotnet instead of msbuild to build the target project.
* cd into the target project's directory before building it, because there may
  be a global.json file there which must be taken into account.
2020-06-02 15:50:35 +02:00
Rolf Bjarne Kvinge bf34d86323
[msbuild] Add a Xamarin.Shared.props. (#8711)
It's empty for now, but soon enough it will start getting shared
Xamarin.iOS/Xamarin.Mac code.
2020-06-02 14:26:25 +02:00
Rolf Bjarne Kvinge 24ed1ddc66
[runtime] Remove Classic code. (#8720) 2020-06-02 08:18:24 +02:00
Rolf Bjarne Kvinge 2fdd7451b9
[dotnet] Inject logic into the Build target to put resolved assemblies and dylibs into the .app. (#8715)
Inject logic into the Build target to start creating the app bundle:

* Make sure the pre-existing list of targets (CreateAppBundleDependsOn) to
  create an app bundle is not evaluated.
* Create a new CreateAppBundleDependsOn variable that contains the new targets
  we want to run to create the app bundle for net5.
* Call the built-in publishing targets to copy files to the publish directory
  (ComputeFilesToPublish / CopyFilesToPublishDirectory).
* Add a target that rewrites the publish directory for assemblies and dylibs
  to put them in the app bundle instead.
2020-06-01 17:52:19 +02:00
Rolf Bjarne Kvinge b781f428f6
[AddressBookUI] Fix indentation. (#8719)
This was just too annoying to ignore.
2020-06-01 17:01:30 +02:00
Rolf Bjarne Kvinge 7751708022
[dotnet] Add class library test project for every platform. (#8714)
And tests to make sure it builds successfully as well.
2020-06-01 11:28:23 +02:00
Rolf Bjarne Kvinge 9a1bd54aba
[tests] Remove unused file from the mtouch tests. (#8713) 2020-06-01 11:27:51 +02:00
Rolf Bjarne Kvinge c9d6d4ca13
[msbuild] Share some of the code signing targets between Xamarin.Mac and Xamarin.iOS. (#8710) 2020-06-01 10:23:17 +02:00
Sebastien Pouliot 5d2598af69
[generator] Move optimization that skips required (warning) checks (#8712)
We're getting out of `GenerateArgumentChecks` too fast when
`null_allowed_override` is `true` so we miss the warning check for
exposing a `[Model]` type instead of the protocol/interface.

Sadly this uncovered a few mistakes in our existing bindings...

```
warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStartHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStopHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

CSC      [watch] Xamarin.WatchOS.dll
warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStartHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStopHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter shadable in the method SceneKit.SCNBufferBindingHandler.Invoke exposes a model (SceneKit.SCNShadable). Please expose the corresponding protocol type instead (SceneKit.ISCNShadable).

CSC      [tvos] Xamarin.TVOS.dll
STRIP    Xamarin.WatchOS.dll
CSC      [watch] MonoTouch.NUnitLite.pdb
warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStartHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStopHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter shadable in the method SceneKit.SCNBufferBindingHandler.Invoke exposes a model (SceneKit.SCNShadable). Please expose the corresponding protocol type instead (SceneKit.ISCNShadable).

warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStartHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStopHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter shadable in the method SceneKit.SCNBufferBindingHandler.Invoke exposes a model (SceneKit.SCNShadable). Please expose the corresponding protocol type instead (SceneKit.ISCNShadable).

CSC      [mac/mobile-64] Xamarin.Mac.dll
CSC      [mac/full-64] Xamarin.Mac.dll
warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStartHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter receiver in the method SceneKit.SCNAnimationDidStopHandler.Invoke exposes a model (SceneKit.SCNAnimatable). Please expose the corresponding protocol type instead (SceneKit.ISCNAnimatable).

warning BI1106: bgen: The parameter shadable in the method SceneKit.SCNBufferBindingHandler.Invoke exposes a model (SceneKit.SCNShadable). Please expose the corresponding protocol type instead (SceneKit.ISCNShadable).
```

Those are fixed in a separate PR https://github.com/xamarin/xamarin-macios/pull/8716
2020-05-29 15:43:29 -04:00
Rolf Bjarne Kvinge aec9c93bee
[dotnet] Add tests for our various platforms. (#8708)
* [tests] Add a unit test project to test our net5 support.

* [tests] Fix clearing environment variables when launching processes.

* [tests] Add net5 macOS test app.

* [tests] Add net5 tvOS test app.

* [tests] Add net5 watchOS test app.

* [msbuild] Exclude CreateAppBundleDependsOn from net5 builds as well.

* [msbuild] We're not required to know the signing identity to figure out the app extension bundle name.
2020-05-29 17:58:34 +02:00
Rolf Bjarne Kvinge bebbeb18a3
[msbuild] Improve xharness and makefiles make it easier to run both iOS and Mac MSBuild tests. (#8709)
It even looks like running the Xamarin.Mac MSBuild tests from the command line
has never worked... so fix that as well.
2020-05-29 17:50:46 +02:00
Manuel de la Pena da6e6f2800
[Harness] Move logic to create the device tests our of Jenkins.cs (#8699)
Making Jenkins just orchestrate. Later this class will be testable.
2020-05-28 22:32:48 -04:00
Manuel de la Pena d241d8dae1
[Harness] Create a TestServer that will serve the Xharness page. (#8706)
Move all the logic of the server to its own class to later be able to
add tests in Jenkins (make sure that we do run it) and in the server
itself (check that files are server, correct actions are executed etc..)

At this point Jenkins just creates the tests tasks via other objects and
executes in server mode or not depending on the env.
2020-05-28 12:54:45 -04:00
Rolf Bjarne Kvinge 2b2f1d08dc
[tests] Remove Classic code from all tests. (#8702) 2020-05-28 16:35:09 +02:00
Manuel de la Pena 8b69ddb960
[Harness] Remove logic that builds sim tasks. (#8697)
One step closer to make the Jenkins class just know how to spin the
tasks and what tests are selected. This new class, once we can have a
clean Jenkins class will be testeable.
2020-05-28 09:34:27 -04:00
Rolf Bjarne Kvinge 90049c3c62
Ignore *.binlog files. (#8704)
They're binary msbuild logs produced by 'msbuild /bl:msbuild.binlog'.
2020-05-28 15:01:23 +02:00
Sebastien Pouliot 3b9ccce914
[generator] Remove extra generated code (null check) for Selector (#8700)
There's already a check just above, which returns `false` if
`sel == null`, so this extra one is just wasted.

Also fix a typo in an unrelated comment :)
2020-05-28 08:50:04 -04:00
Manuel de la Pena 46b36b4252
[Harness] Remove not needed private var by Jenkins. (#8698) 2020-05-28 07:44:20 -04:00
Manuel de la Pena 0f3435bff1
[Harness] Fix markdown take two. (#8701)
The grouping of the tasks was moved to the html report. This meant that
the markdown was not getting all the correct tasks. Move the grouping of
the tasks out of the hml report and use it with the markdown so that
both reports have the same data.

Also fixes an issue when tests failed and did not appear correctly in
the comment such as in comment: https://github.com/xamarin/xamarin-macios/pull/8698#issuecomment-635006243
2020-05-28 07:43:54 -04:00
Rolf Bjarne Kvinge 2ffe11cb9e
[msbuild] Share the _CreateAppBundle task between Xamarin.Mac and Xamarin.iOS. (#8694)
There is a difference for Xamarin.Mac: the task will not be executed anymore
if IsAppDistribution is set to true. Given that IsAppDistribution is not used
in Xamarin.Mac projects, this is likely a rather uncommon case, and the
potential for breaking behavior is outweighed by the advantage of having the
same behavior for Xamarin.iOS and Xamarin.Mac.
2020-05-28 08:34:11 +02:00
Manuel de la Pena 8d433815c4
[Harness] Fix issues in the markdown when reporting failures. (#8696)
The failures are aggregated tasks, we need to get the, use the key as
the name of the test and use the rest of the data from the ITestTask.
The reason is that the ITestTask.Name was modified by Jenkins.cs to
group them.

fixes: https://github.com/xamarin/xamarin-macios/issues/8695
2020-05-27 17:03:06 -04:00
Rolf Bjarne Kvinge b76c5ebf0f
[dotnet/msbuild] Add existing targets files to the net5 NuGets, and import them in the net5 targets files.
Also fix them to not cause problems when used from the net5 targets files.

The current NuGet structure:

	Microsoft.iOS.Sdk
	└─── Sdk
	│    └─── Sdk.props
	│    └─── Sdk.targets
	└─── Versions.plist
	└─── targets
	│    └─── Microsoft.iOS.*.props
	│    └─── Microsoft.iOS.*.targets
	│    └─── Xamarin.Shared.*.props
	│    └─── Xamarin.Shared.*.targets
	└─── tools
	│    └─── msbuild
	│    │    └─── iOS
	│    │    │    └─── FrameworkList.xml
	│    │    │    └─── Xamarin.*.dll
	│    │    │    └─── Xamarin.*.pdb
	│    │    │    └─── Xamarin.*.props
	│    │    │    └─── Xamarin.*.targets

	Microsoft.tvOS.Sdk
	└─── Sdk
	│    └─── Sdk.props
	│    └─── Sdk.targets
	└─── Versions.plist
	└─── targets
	│    └─── Microsoft.tvOS.*.props
	│    └─── Microsoft.tvOS.*.targets
	│    └─── Xamarin.Shared.*.props
	│    └─── Xamarin.Shared.*.targets
	└─── tools
	│    └─── msbuild
	│    │    └─── iOS
	│    │    │    └─── Xamarin.*.dll
	│    │    │    └─── Xamarin.*.pdb
	│    │    │    └─── Xamarin.*.props
	│    │    │    └─── Xamarin.*.targets
	│    │    └─── tvOS
	│    │    │    └─── FrameworkList.xml
	│    │    │    └─── Xamarin.TVOS.*.props
	│    │    │    └─── Xamarin.TVOS.*.targets


	Microsoft.watchOS.Sdk
	└─── Sdk
	│    └─── Sdk.props
	│    └─── Sdk.targets
	└─── Versions.plist
	└─── targets
	│    └─── Microsoft.watchOS.*.props
	│    └─── Microsoft.watchOS.*.targets
	│    └─── Xamarin.Shared.*.props
	│    └─── Xamarin.Shared.*.targets
	└─── tools
	│    └─── msbuild
	│    │    └─── iOS
	│    │    │    └─── Xamarin.*.dll
	│    │    │    └─── Xamarin.*.pdb
	│    │    │    └─── Xamarin.*.props
	│    │    │    └─── Xamarin.*.targets
	│    │    └─── watchOS
	│    │    │    └─── FrameworkList.xml
	│    │    │    └─── NoCode.cs
	│    │    │    └─── Xamarin.WatchOS.*.props
	│    │    │    └─── Xamarin.WatchOS.*.targets


	Microsoft.macOS.Sdk
	└─── Sdk
	│    └─── Sdk.props
	│    └─── Sdk.targets
	└─── Versions.plist
	└─── targets
	│    └─── Microsoft.macOS.*.props
	│    └─── Microsoft.macOS.*.targets
	│    └─── Xamarin.Shared.*.props
	│    └─── Xamarin.Shared.*.targets
	└─── tools
	│    └─── msbuild
	│    │    └─── macOS
	│    │    │    └─── FrameworkList.xml
	│    │    │    └─── Xamarin.*.dll
	│    │    │    └─── Xamarin.*.pdb
	│    │    │    └─── Xamarin.Mac.*.props
	│    │    │    └─── Xamarin.Mac.*.targets
	│    │    │    └─── Xamarin.Shared.targets
2020-05-27 19:39:33 +02:00
Alex Soto b17205e64c
[mono] Bump mono to match android (#8684)
New commits in mono/mono:

* mono/mono@8c085a99b3 [reflection] Check whether a pointer is valid before dereferencing (#19842)
* mono/mono@89d772a3ab Always include Unicode charinfo, so tar made in csc mode works in mcs mode (#19813)
* mono/mono@e9d3af508e Bump bockbuild to get https://github.com/mono/bockbuild/pull/159
* mono/mono@d6f0c25d34 [2020-02] Bump msbuild to track mono-2019-12 (#19661)

Diff: 075c3f0619..8c085a99b3
2020-05-27 13:19:22 -04:00
Rolf Bjarne Kvinge c138becdf1
[jenkins] Fix assumption in build-nugets.sh. (#8693)
* The current directory doesn't have to be the script directory, so only
  execute 'make' after we've changed the current directory to a known
  directory.
* 'make ...' can output extra lines, depending on other circumstances, so
  change logic to filter to just the line we're interested in:

    DOTNET_NUPKG_DIR='Found ccache on the system, enabling it
    Detected the maccore repository, automatically enabled the Xamarin build
    Downloading mono archives
    /Users/rolf/work/maccore/msbuild/xamarin-macios/_build/nupkgs'
2020-05-27 17:16:54 +02:00
Rolf Bjarne Kvinge 03cf7bb1c0
[msbuild] Remove Jeff as a code owner. (#8688) 2020-05-27 16:31:29 +02:00
Rolf Bjarne Kvinge af1323f4c5
[xharness] Always capture stdout/stderr from the simulator to actual files. (#8689)
This avoids confusion when tests are run locally using 'make runner' (and
would print the simulator's stdout/stderr to the terminal) versus when run on
bots (and would write the simulator's stdout/stderr to separate files that
would show up in the html report).
2020-05-27 15:31:20 +02:00
Rolf Bjarne Kvinge a3516c33aa
[xharness] Add crash reports to a logs collection we care about. (#8690)
Add crash reports to a logs collection we care about, instead of to a logs
collection that's promptly forgotten.

This makes sure crash reports actually show up in the html report.
2020-05-27 15:27:32 +02:00
Rolf Bjarne Kvinge 732847bd85
[jenkins] Use the existing DOTNET_NUPKG_DIR variable when looking for built nugets. (#8691) 2020-05-27 15:10:29 +02:00
Rolf Bjarne Kvinge 9fcda89ead [msbuild] Fix typo in the watchOS logic. 2020-05-27 10:23:52 +02:00
Connor Adsit 47f74578b3
satisfy the type-checking gods (#8680) 2020-05-27 08:49:37 +02:00
Rolf Bjarne Kvinge 7b834babca
[jenkins] Don't try to upload any packaged Xamarin.Mac tests if there aren't any or they failed to compile. (#8678) 2020-05-27 08:33:46 +02:00
Manuel de la Pena 488bce571e
[Harness] Refactor Hml generation. (#8686)
This is a step towards trying to make the modification of the html
easier for other team members, the are just to small logical changes:

1. Removed the GenerateReportImpl to a HtmlReportWriter.
2. Do not make the HtmlReportWriter call the Marckdown one, the are
independent.

There is room for improvement, since there are some collections
re-calculated. That change will come once we have this out of the way.

At some point, we ought to be able to make changes in the html just be
as hard as they should be (html + css, we are not experts on that).
2020-05-26 22:11:09 -04:00
Manuel de la Pena a512056c95
[Harness] Make sure that the error knowledgebase is used in device runs. (#8682)
The knowledgebase was just added in the simulator case, not in the
device. That meant that the tcp error was not reported.

Also added another possible case of tcp errors to be picked up and be
shown as a known error (device throws a diff error when on airplane
mode).

fixes: https://github.com/xamarin/xamarin-macios/issues/8659
2020-05-26 17:58:44 -04:00
Manuel de la Pena 6dfcd88fbd
[.gitignore] Ignore the json that is created on a device crash on xharness. (#8683)
Those files can be found when we test crashes locally and should not be
added to the project.
2020-05-26 16:34:22 -04:00
Sebastien Pouliot e819d09658
[corefoundation] Safer NativeObject (#8667)
Do not allow calling `CFRetain` or `CFRelease` on a null handle as this
will crash the process, instead use `GetCheckedHandle` so a managed (and
catchable) `ObjectDisposedException` can be thrown.

Make `GetCheckedHandle` public so subclasses (outside the platform
assembly) can use it - it's already recommended in some `[Obsolete]`
attributes (but was not made available).

Move the `ObjectDisposedException` thrower into a new `ThrowHelper`
class. This will allow sharing it (to be re-used in future PR).

Add unit tests for `NativeObject`.
2020-05-26 12:09:26 -04:00
Rolf Bjarne Kvinge 8c1f33bde7
[tools] Ignore generator.csproj when comparing generated code. (#8675)
Fixes an issue where generator.csproj would show up as a new file when
comparing generated output.

This probably regressed in 4b917ad2de.
2020-05-26 16:20:53 +02:00
Rolf Bjarne Kvinge 4f2d580426 [msbuild] Don't touch AssemblySearchPaths when building with net5.
We're supposed to resolve assemblies the standard/system way.
2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge 91aa4e733a [msbuild] Don't include System.Drawing.Common.dll when building using net5.
There's no System.Drawing.Common.dll in net5.
2020-05-26 14:49:31 +02:00
Rolf Bjarne Kvinge 6e48c5a83a [msbuild] Don't import Microsoft.CSharp.targets if we're building using net5.
It's already imported.
2020-05-26 14:49:31 +02:00