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

519 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge beec791bda
[tests] Add some code to try to diagnose why certain test failures aren't ignored in CI. (#14769) 2022-04-20 08:19:50 +02:00
Rolf Bjarne Kvinge 9c185e1fff
[msbuild] Ask ditto to thin native libraries according to the architectures we're targetting. Fixes #13081. (#14403)
Ask ditto to thin native libraries and frameworks when copying them to the app
bundle to remove slices for architectures we're not building for.

Also add tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/13081.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-04-07 08:17:01 +02:00
Rolf Bjarne Kvinge 1b37c48ac5
[dotnet] Add support for Mac Catalyst apps optimized interface for macOS. Fixes #14621. (#14663)
This also required bumping Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@0717ac3 Add a new device type for Mac Catalyst.
* xamarin/Xamarin.MacDev@ed2a604 Remove net451 target framework from
Xamarin.MacDev.csproj

Diff: 9e6e29f2a4..0717ac3c24

Fixes https://github.com/xamarin/xamarin-macios/issues/14621.
2022-04-07 08:14:42 +02:00
Rolf Bjarne Kvinge a46afd0147
[tests] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files. (#14666)
This way we don't have to update all these files when moving to .NET 7.
2022-04-06 20:58:20 +02:00
Rolf Bjarne Kvinge 906b94cb00
[mmptest] Fix resolving paths to required test files. Fixes #xamarin/maccore@2560. (#14566)
* Fix resolving paths to required test files (test files can be found relative to the root path of the repository, not relative to where Xamarin.Mac is installed)
* Don't try to sign symlinks - we can end up trying to sign the target of the symlink twice simultaneously.
* Fix finding libxammac.dylib and Xamarin.Mac.dll when testing a system installation (when MAC_DESTDIR or TESTS_USE_SYSTEM are set).
* Remove a few .NET tests we don't need anymore.

Fixes https://github.com/xamarin/maccore/issues/2560.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-04-05 14:30:35 +02:00
Rolf Bjarne Kvinge 08978fa4b1
[dotnet] Rename hardcoded 'net6.0' to use a 'DOTNET_TFM' variable instead. (#14524)
This makes things easier for .NET 7.
2022-04-01 13:48:09 +02:00
Rolf Bjarne Kvinge dea5c1e812
[tests] Fix logic to make generator tests work with a system install. (#14497)
Fixes https://github.com/xamarin/maccore/issues/2549.
2022-03-30 21:36:09 +02:00
Alexander Köplinger b8c493c3e1
Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal PackageReference (#14532)
* Set IsImplicitlyDefined="true" on the System.Runtime.InteropServices.NFloat.Internal

This unbreaks Central Package Management via https://github.com/microsoft/MSBuildSdks/tree/main/src/CentralPackageVersions which is being worked on for NuGet, see https://github.com/NuGet/Home/issues/6764

* Add test case

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-30 10:13:39 +02:00
Rolf Bjarne Kvinge ab513555a6
[tests] There's no need to have different logic to compute the source root path on Azure DevOps. (#14485) 2022-03-25 16:38:37 +01:00
Rolf Bjarne Kvinge 78963700e7
[dotnet] Only add a global nfloat using if we're compiling for C# 10 or later. Fixes #14434. (#14475)
Fixes https://github.com/xamarin/xamarin-macios/issues/14434.
2022-03-24 10:14:16 +01:00
Rolf Bjarne Kvinge d9e3206125
Merge branch 'main' into dotnet-dsyms 2022-03-23 22:24:51 +01:00
Rolf Bjarne Kvinge e44d0fd047
[.NET] Rename several DOTNET6_* variables to to DOTNET_*. (#14463)
Also rename DOTNET_VERSION to SYSTEM_DOTNET_VERSION to make it clear what it's
referring to (and to not clash with DOTNET6_VERSION which has now been renamed
to DOTNET_VERSION).

.NET 7 is right around the corner.
2022-03-23 08:07:34 +01:00
Rolf Bjarne Kvinge a2c3d7d225 [tests] We can't call dsymutil/strip on static libraries, so mark them as such. 2022-03-22 16:14:07 +01:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Rolf Bjarne Kvinge 0280c3d9f1
[tests] Augment TestRuntime.IgnoreInCI to detect Azure DevOps. Fixes #2557. (#14440)
Fixes https://github.com/xamarin/maccore/issues/2557.
2022-03-21 12:10:50 +01:00
Rolf Bjarne Kvinge 1c261ff741
[tests] Make a few .NET tests a bit less noisy. (#14430) 2022-03-17 10:02:39 +01:00
Rolf Bjarne Kvinge 174aca5b04
[tests] Simplify some logic in mmptest and msbuild tests. (#14400)
Use already existing logic in the Configuration class to find files on disk.

Also remove some dead code and use Path.Combine instead of string
concatenation to compute paths.

Fixes https://github.com/xamarin/maccore/issues/2553.
2022-03-14 20:43:49 +01:00
Manuel de la Pena e07b7bef79
[CI] Move tests outside of the build machine. (#14105)
Move the execution of tests to a diff bot to be compliant with the latests EO.
2022-03-10 23:36:37 -05:00
Manuel de la Pena 488a647b49
[Tests] Ignore certain tests that do not longer work on bots. (#14326)
The new tests do not have a display and that makes certain mac tests
fail. Added a new TestRuntime function to let us know if we are on vsts
and ignore accordingly.

fixes https://github.com/xamarin/maccore/issues/2546


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-03-09 11:24:53 -05:00
Rolf Bjarne Kvinge 5103060d72
[tests] Long live Xamarin! (#14336)
And a few other minor updates to test Info.plists.
2022-03-09 08:19:48 +01:00
Rolf Bjarne Kvinge df491ed4b3
[cecil-tests] Improve the obsolete member test. Fixes #13621. (#14258)
* Check implementation assemblies instead of reference assemblies.
* Try to print the source code location for failing API (this required processing
  the implementation assemblies, because the reference assemblies don't have debug
  information where the source code location is stored).
* Don't report API that has [EditorBrowsable (None)] attributes, presumably we
  decided to keep these for compatibility, while highly discouraging their
  continued use. Also stop doing this for the next time we can do a breaking
  change, maybe we can remove these APIs then.
* Don't report API that has [UnsupportedOSPlatform ("...#.#") attributes (with
  a version number), presumably this is API that is still valid for some OS
  versions.
* Enable the test for all APIs (no ignores anymore). It's green!

Fixes https://github.com/xamarin/xamarin-macios/issues/13621.
2022-02-28 11:26:44 +01:00
Rolf Bjarne Kvinge 83136c4507
[tests] Fix packaging mac tests by generating valid bash code for test.config. (#14236)
Fixes this failure:

    ++ DOTNET_CSC_COMMAND=/Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/dotnet
    ++ exec /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll
    test.config: line 22: /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll: Permission denied
    make[1]: *** [mac-test-package.zip] Error 1
    make: *** [package-tests] Error 2
2022-02-24 22:57:25 +01:00
Rolf Bjarne Kvinge 4fd770c3c4
[msbuild/generator] Pass .NET's C# compiler to bgen to use. Fixes #12922. (#14192)
We can't execute mono's C# compiler when using .NET, so we need to tell bgen
where csc is in that case.

Fixes https://github.com/xamarin/xamarin-macios/issues/12922.
2022-02-23 09:36:43 +01:00
Rolf Bjarne Kvinge f83857638d
[tests/msbuild] Use full path to binlogs and executables. (#14195)
This way it's easier to copy-paste the path to the these files from terminal output
and open/run it (with a relative/partial path you'll need to know the current directory,
which is just an annoying thing to figure out sometimes).
2022-02-21 08:02:23 +01:00
Rolf Bjarne Kvinge e25163f573
[.NET] Rename our product assemblies. Fixes #13748. (#13847)
Rename our product assemblies to:

* Microsoft.iOS.dll
* Microsoft.tvOS.dll
* Microsoft.macOS.dll
* Microsoft.MacCatalyst.dll

This makes it easy to distinguish between legacy Xamarin and .NET whenever the
product assembly is mentioned, and I've also chosen the platform part of the
name to match how the platforms are named elsewhere (this also makes it
possible to simplify our build logic, since we can remove a lot of special
casing).

Fixes https://github.com/xamarin/xamarin-macios/issues/13748.
2022-02-16 21:30:32 +01:00
Rolf Bjarne Kvinge 8060e2f6d3
[tests] Use the correct OS version for Mac Catalyst. (#14143)
This fixes the CheckManagedFilters tests on Mac Catalyst on older macOS versions:

    [FAIL] CheckManagedFilters :   Managed filters not found for CIAreaMinMax, CIAreaMinMaxRed, CIAttributedTextImageGenerator, CIBarcodeGenerator, CIBicubicScaleTransform, CIBlendWithBlueMask, CIBlendWithRedMask, CIBokehBlur, CICameraCalibrationLensCorrection, CIColorCubesMixedWithMask, CIColorCurves, CICoreMLModelFilter, CIDepthBlurEffect, CIDepthToDisparity, CIDisparityToDepth, CIDither, CIDocumentEnhancer, CIEdgePreserveUpsampleFilter, CIGaborGradients, CIGuidedFilter, CIKeystoneCorrectionCombined, CIKeystoneCorrectionHorizontal, CIKeystoneCorrectionVertical, CIKMeans, CILabDeltaE, CIMeshGenerator, CIMix, CIMorphologyGradient, CIMorphologyMaximum, CIMorphologyMinimum, CIMorphologyRectangleMaximum, CIMorphologyRectangleMinimum, CIPaletteCentroid, CIPalettize, CIPerspectiveRotate, CIRoundedRectangleGenerator, CISaliencyMapFilter, CISampleNearest, CITextImageGenerator
      Expected: 0
      But was:  39
2022-02-16 20:11:57 +01:00
Rolf Bjarne Kvinge a021ecae72
[test] Add help makefile targets to run .NET tests on remote machines. (#14144) 2022-02-16 07:57:09 +01:00
Stephane Delcroix f36606e654
[C] Clear OpenTK namespace (#13767)
fixes #13160

- remove unused types
- use System.Numerics when possible
- move own created types from OpenTK namespace to CoreGraphics
- create missing types in CoreGraphics namespace

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-02-14 18:50:23 +01:00
Rolf Bjarne Kvinge 808a61a12b
[msbuild] Make sure to set 'ResolveAssemblyConflicts=true' before importing Microsoft.CSharp.targets. Fixes #11691. (#14109)
We must set `ResolveAssemblyConflicts=true` before loading
Microsoft.Common.targets (which is loaded by Microsoft.CSharp.targets),
because otherwise we won'd do any conflict resolution at all, since the
variable isn't 'true' when it needs to be.

Also add test.

Fixes https://github.com/xamarin/xamarin-macios/issues/11691.
2022-02-09 14:07:35 -05:00
Rolf Bjarne Kvinge 0fff3cbea0
[Foundation] Add strongly typed version of NSUndoManager.RunLoopModes for .NET. (#14040) 2022-02-08 10:40:46 +01:00
Rolf Bjarne Kvinge 352a0d818a
[dotnet] Include all files in the Resources subdirectory as bundle resources. Fixes #13808. (#14018)
Include all files in the project's Resources subdirectory as BundleResource
items (except .DS_Store files, which are pretty omnipresent on macOS).

Also, contrary to the other default includes, add a condition so files are
only included if we have a resource prefix (typically "Resources"), otherwise
the entire hard drive might be included, and that's not really what we want.

Fixes https://github.com/xamarin/xamarin-macios/issues/13808.
2022-02-07 18:55:31 +01:00
Rolf Bjarne Kvinge 14824b92b2
[tests] Simplify mmptest a bit by using existing mechanisms to create frameworks. (#13757) 2022-01-18 11:05:41 +01:00
Rolf Bjarne Kvinge 97dcd69d41
[Foundation] Remove some obsolete API in .NET. (#13678) 2022-01-17 20:58:46 +01:00
Rolf Bjarne Kvinge a2e4438536 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-13 22:13:00 +01:00
Rolf Bjarne Kvinge d953b6f037 [tests] Augment tests to rebuild and make sure the result is as expected. 2022-01-13 22:07:57 +01:00
Rachel Kang 304048a965
Add cecil test for verifying obsoleted apis (#13590)
* First version cecil test

* Add missing net6 platform assemblies

* Make it work for Catalyst

* Add namespace switch and clean up code

* Update based on feedback

* Update based on feedback

* Update based on feedback

* Make test pass by default

* Fix bgen tests by fixing GetRefNuGetName

* Update based on feedback

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2022-01-12 09:47:46 -05:00
Rolf Bjarne Kvinge 6f1362f1d2
[tests] Add helpful makefiles for a few test suites. (#13677)
Add makefiles that can build a test for all platforms with a single rule.
2022-01-12 11:39:06 +01:00
Rolf Bjarne Kvinge 214064d430 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-11 17:32:26 +01:00
Alex Soto dfe6c2b5ab
[main] Add Xcode 13.2 Support (#13643)
* [Xcode13.2] Bump to Xcode 13.2 RC (#13497)

* [Xcode13.2] Bump to Xcode 13.2 Beta 2

Breaking changes addressed for legacy
* HomeKit
* CallKit
* CoreLocation

* [xcode13.2] Bump to Xcode 13.2 RC and apply feedback

* [AppKit] Fix missing Notifications

* Fix xtro

* [xcode13.2] Bump versions and use stable Xcode 13.2

* [monotouch-tests] Make TestAddingByComponents work on the last day of the year

Happy New Year!!

* NO BOM PLZ!
2022-01-03 09:28:00 -05:00
Rolf Bjarne Kvinge 268620bd0e [tests] Add BundleStructure, a test project to verify how files end up in the app bundle. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 20c41e1dc6 [tests] Print the binlog path on a line all by itself.
I look at the binlog *all the time*, and this shaves off a few seconds every time
I have to find the path to it.
2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge b695c8c837
[dotnet] Don't add FileNativeReferences to the main libraries to link with. Fixes #13503. (#13598)
Don't add FileNativeReferences to the main libraries to link with, because we
pass that list of main libraries to the LinkNativeCodeTask, and we're already
passing the FileNativeReferences for a different task parameter.

This means that we end up adding the file native reference twice to the linker
arguments, and that's wasteful. It can also cause problems if those linker
arguments aren't always computed in the same way (once as a relative path,
once as an absolute path for instance).

Fixes https://github.com/xamarin/xamarin-macios/issues/13503.
2021-12-21 08:13:53 +01:00
Rolf Bjarne Kvinge bcbb6c8438
[src] Define XAMCORE_3_0 for .NET for all platforms. (#13566)
Also update xtro and tests accordingly.
2021-12-17 07:44:02 +01:00
Rolf Bjarne Kvinge bc2a5e2251
[xharness] Inline the dotnet-shared.csproj file as well when inlining shared imports. (#13514)
This fixes a problem where we'd build the same project reference from
dotnet-shared.csproj in parallel, and each build would stomp on eachother
(because we'll now clone the project references in dotnet-shared.csproj).

This als required updating project files to use MSBuildThisFileDirectory
instead of MSBuildProjectDirectory, which makes it easier for xharness to
inline/process these files, because MSBuildThisFileDirectory is easy to know
when processing a file, while MSBuildProjectDirectory depends on the calling
project, which complicates matters significantly.

A fix in MonoTouch.Dialog was also required.

New commits in migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@59fbf5b [dotnet] Shared project files don't need the DefaultTargets/ToolsVersion/xmlns attributes.

Diff: 4d0e0a9a5f..59fbf5bb1b

Fixes https://github.com/xamarin/maccore/issues/2527.
2021-12-16 19:01:39 +01:00
Rolf Bjarne Kvinge 32b112bad9
[tests] Shutdown build servers when rebuilding. (#13581)
This makes sure that MSBuild picks up rebuilt task assemblies.
2021-12-16 17:40:12 +01:00
Rolf Bjarne Kvinge b169c806fc
[dotnet] Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst. Fixes #10312. (#13562)
Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst, because they don't
apply for a Mac Catalyst app (which is neither a simulator environment, nor a
device environment).

This means that code using these APIs will have to be re-evaluated to
determine what's the correct behavior for Mac Catalyst.

Also update our tests accordingly.

Fixes https://github.com/xamarin/xamarin-macios/issues/10312.
2021-12-15 22:32:14 +01:00
Manuel de la Pena 45340e80f7
[Tests] Fix the retrieval of variables in .Net after quotes were added. Fixes #13516 (#13522)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-09 20:28:35 -05:00
Rolf Bjarne Kvinge b3c6218c5f
[msbuild] Improve logic to clean up the app bundle for macOS and Mac Catalyst apps before signing. (#13479)
There can't be any files in the root directory of the app bundle for macOS and
Mac Catalyst, otherwise code signing will fail. The problem is that Mono will
create a crash report in the current directory if the process crashes, and the
current directory is the root directory of the app bundle, which means that if
running an app crashes, the next build will likely fail because of the crash
report.

We had logic to detect this and remove any crash reports, but our crash report
detection pattern wasn't good enough and let some files through. This PR
updates that pattern, and also improves the code to report warnings for any
other files in the app bundle's root directory.
2021-12-07 21:33:22 +01:00
Rolf Bjarne Kvinge 39bdae2b7f
[monotouch-test] Ignore a few tests in non-ARM64 simulators. (#13487)
* [monotouch-test] Ignore a few tests in non-ARM64 simulators.

Some tests fail when running on an M1, but in a x64_86 mode, so just ignore
those unless we're running on ARM64 (this will currently exclude them on
x86_64 hardware too, but that'll eventually not be a problem anymore when
there's no more x86_64 hardware, and just checking for ARM64 is easier than
checking for x86_64 mode on an ARM64 CPU).

* Make more legacy projects unsafe.
2021-12-07 21:10:39 +01:00
Rolf Bjarne Kvinge 5cc92ac564
[src] Add a new ObjCRuntime.NativeHandle type to represent native handles for .NET. Fixes #13126. (#13356)
Add a new struct, ObjCRuntime.NativeHandle, which will be used to represent
native handles for .NET (instead of using IntPtr). The main purpose is to be
able to use 'nint' as a number in API while not being prevented from using
native handles as well.

One example is NSMutableString, which has a constructor that takes a single
'nint capacity' parameter. With this change, we'll also be able to have a
constructor that takes a native handle in .NET - otherwise we'd have two
constructors with the same signature, because a C# 'nint' is just an 'IntPtr'.

This change required numerous changes pretty much everywhere. The work is
split up in commits as well as I was able to, and each commit explains what it
does.

Fixes https://github.com/xamarin/xamarin-macios/issues/13126.
2021-12-02 08:38:39 +01:00