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

123 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge b8c7dc7dc3 [net8.0] Merge main into net8.0. 2023-05-11 11:54:37 +02:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge 17bcfbf4cb
[tests] Fix running dotnet with MSBUILD_EXE_PATH. (#18223)
'dotnet build' doesn't work when MSBUILD_EXE_PATH is set (which we do in
some places for legacy tests), so make sure to unset MSBUILD_EXE_PATH before running
'dotnet build'.
2023-05-05 11:16:54 +02:00
Rolf Bjarne Kvinge 6e10fd5d27 [net8.0] Merge main into net8.0. 2023-03-14 10:12:55 +01:00
Rolf Bjarne Kvinge 29633a6231
[generator] Make the block callbacks UnmanagedCallersOnly functions in .NET. (#17741)
This also required updating a manual binding since it poked into
generated internals.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15783.
2023-03-14 10:08:28 +01:00
Rolf Bjarne Kvinge 7a866a5cc6 [net8.0] Merge main into net8.0. 2023-03-02 15:49:52 +01:00
Rolf Bjarne Kvinge 8285c08c17
[registrar] Improve support for pointers to value types in exported signatures. (#17608)
This will be required when we make blocks use blittable callbacks, since we'll
have to use pointers in a few cases (because ref/out arguments aren't
blittable).
2023-02-28 11:48:27 +01:00
dotnet-maestro[bot] 6eb501be2b
[net8.0] Update dependencies from dotnet/installer (#17444)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 8.0.100-1.23067.1 to 8.0.0-preview.2.23101.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-alpha.1.23076.8 to 8.0.0-preview.2.23101.7 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: from 8.0.0-alpha.1.23073.2 to 8.0.0-alpha.1.23066.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-alpha.1.23076.9 to 8.0.0-preview.2.23101.2 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230202.11
- **Date Produced**: February 2, 2023 10:28:14 PM UTC
- **Commit**: 5c7737d740c861fe7cda4822a7137c22368000dc
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-alpha.1.23077.6 to 8.0.100-preview.2.23102.11][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.100-1.23067.1 to 8.0.0-preview.2.23101.2][2]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-alpha.1.23076.8 to 8.0.0-preview.2.23101.7][3]
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: [from 8.0.0-alpha.1.23073.2 to 8.0.0-alpha.1.23066.1][4]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-alpha.1.23076.9 to 8.0.0-preview.2.23101.2][5]

[1]: 1d88a6b...5c7737d
[2]: c790896...842ec4a
[3]: 4d75ee9...56cb24c
[4]: ff23620...5b46122
[5]: 007df05...842ec4a
2023-02-13 07:34:42 +01:00
Rolf Bjarne Kvinge 9f55faeee0 Merge remote-tracking branch 'origin/net8.0' into bump-main-in-net8.0-2023-02-06 2023-02-07 07:18:23 +01:00
Rolf Bjarne Kvinge 61dd7b188b Merge main into net8.0. 2023-02-06 08:49:13 +01:00
Andoni Morales Alastruey 97ab14801f
[dotnet] Add support for .so files (#16887)
Autotools-based project using libtool's -module flag generate plugins
with the .so extension that needs to be treated like DynamicLibraries in
terms of deployment location and relocation, except they are not linked
to the app.

This PR adds support for such .so files: they're treated as .dylib files, except
that they're not linked to the app.
2023-02-03 09:16:40 +01:00
Rolf Bjarne Kvinge 94a3903df7 [tests] Bump min OS versions in all tests. 2023-02-02 16:30:28 +01:00
Rolf Bjarne Kvinge 7b352f5f26 [net8.0] Merge main into net8.0. 2023-01-31 14:52:18 +01:00
Rolf Bjarne Kvinge 98819287cc
[runtime/generator] Add support for BindAs with CMVideoDimensions. (#17308)
This is required for some new iOS 16 APIs.
2023-01-25 15:34:28 +01:00
dotnet-maestro[bot] a361cc946a
[net8.0] Update dependencies from dotnet/installer (#16993)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
  - **Microsoft.NET.ILLink.Tasks**: from 7.0.100-1.22564.1 to 8.0.100-1.23055.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-alpha.1.22558.5 to 8.0.0-alpha.1.23058.7 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-alpha.1.22559.2 to 8.0.0-alpha.1.23058.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: from 8.0.0-alpha.1.22554.1 to 8.0.0-alpha.1.22620.1 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer
- **Subscription**: 9a2944cb-7dee-4bf2-a65c-08dabd10ae64
- **Build**: 20230113.2
- **Date Produced**: January 13, 2023 12:09:55 PM UTC
- **Commit**: e0284b3f3c72d8f21e4825ed1ac723d2e829d0a5
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-alpha.1.22605.6 to 8.0.100-alpha.1.23063.2][191]
  - **Microsoft.NET.ILLink.Tasks**: [from 7.0.100-1.22564.1 to 8.0.100-1.23055.2][192]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-alpha.1.22558.5 to 8.0.0-alpha.1.23058.7][193]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-alpha.1.22559.2 to 8.0.0-alpha.1.23058.2][194]
  - **Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100**: [from 8.0.0-alpha.1.22554.1 to 8.0.0-alpha.1.22620.1][195]

[191]: cbc7313...e0284b3
[192]: 13b8d6d...4b3f78c
[193]: 1bee0af...cefc6cc
[194]: dd7fdb7...5da4a9e
[195]: b6656f5...66b9845

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-01-13 22:53:10 +01:00
Rolf Bjarne Kvinge 01123bfb0e
[tests] Fix the AppWithNativeDynamicLibrariesInPackageReference to work when not all platforms are enabled. (#17081) 2022-12-19 18:37:10 +01:00
Andoni Morales Alastruey 4cfccff38e
Fix libs reidentification deployed in a subdirectory (#16706)
Dynamic libraries might be deployed in subdirectories such as libclrjit.dylib from the nuget package cefglue.common:
Contents/MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

The library ID for that library should be: @executable_path/../MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

Instead of: @executable_path/../MonoBundle/libclrjit.dylib

Beside the library ID being wrong, when it's combined with the nuget package microsoft.netcore.app.runtime.osx-x64 providing a library with the same name, both uses the same `ReidentifiedPath`, which can cause a failure in the InstallNameTool tasks that are run in parallel operating on the same temporary file.

The following patch uses the `RelativePath` for the tempory file used by `InstallNameTool` so that there are no clashes with other files with the same name deployed in other directories. It also uses the `RelativePath` to create the correct library id: @executable_path/../../Contents/MonoBundle/CefGlueBrowserProcess/libclrjit.dylib

Partially fixes https://github.com/xamarin/xamarin-macios/issues/15173 for this scenario
2022-12-16 09:17:01 +01:00
Rolf Bjarne Kvinge 1c80823582
[autoformat] Add all of tests/. (#16857) 2022-12-05 08:23:34 +01:00
Rolf Bjarne Kvinge 0a53f3cd60
Add automatic support for not building iOS 32-bit stuff when min iOS version is >= 11.0 (#16746)
There are no changes for 32-bit watchOS, because watchOS support is likely to
go away completely anyways.
2022-11-18 07:59:46 +01:00
Rolf Bjarne Kvinge 69f33e5d11
[tests] Add dependency so that we don't try to write a file in a directory that doesn't exist. (#16393)
Fixes this:

    Making all in frameworks
    /bin/sh: .libs/tvos-arm64/FrameworksInRuntimesNativeDirectory1.dll: No such file or directory
    make[2]: *** [.libs/tvos-arm64/FrameworksInRuntimesNativeDirectory1.dll] Error 1
2022-10-20 08:47:31 +02:00
Rolf Bjarne Kvinge 8e92e9e5c5
[tests] Ignore tests that require platforms not included in the current build. (#16000) 2022-09-22 07:33:42 +02:00
Rolf Bjarne Kvinge 2415050767
[dotnet] Fix issue with frameworks with dots. Fixes #15727. (#15872)
Since executables in frameworks usually don't have dots, `%(Filename)` will be
the entire filename, because `%(Extension)` is empty. However, if the
executable happens to have a dot, then we need to include the extension:
`%(Filename)%(Extension)`.

Fixes https://github.com/xamarin/xamarin-macios/issues/15727.
2022-09-07 10:43:33 +02:00
Rolf Bjarne Kvinge 16f14a965e
[tests] Only include enabled platforms in the FrameworksInRuntimeNativeDirectory nupkg. (#15501) 2022-07-15 10:27:26 +02:00
Rolf Bjarne Kvinge 3be1d9d760
Use unix-style line endings in project files. (#15303)
This also removes the BOM in a few project files.

This is a whitespace-only change, as can be seen here: https://github.com/xamarin/xamarin-macios/pull/15303/files?w=1
2022-06-21 17:22:58 +02:00
Rolf Bjarne Kvinge 42c1c66a14
[SceneKit] Fix SCNMatrix4 in .NET. Fixes #15094. (#15160)
When we changed SCNMatrix4 to be column-major instead of row-major in .NET, there
were several other related changes we should have done but didn't do. In particular
we should have made transformation operations based on column-vectors instead of
row-vectors.

In legacy Xamarin, a vector would be transformed by a transformation matrix by doing
matrix multiplication like this:

    [ x y z w] * [ 11 21 31 41 ]
                 | 12 22 32 42 |
                 | 13 23 33 43 |
                 [ 14 24 34 41 ]

In this case the vector is a row-vector, and it's the left operand in the multiplication.
When using column-major matrices, we want to use column-vectors, where the vector
is the right operand, like this:

    [ 11 21 31 41 ] * [ x ]
    | 12 22 32 42 |   | y |
    | 13 23 33 43 |   | z |
    [ 14 24 34 41 ]   [ w ]

This affects numerous APIs in SCNMatrix4, SCNVector3 and SCNVector4:

* The M## fields have been changed to make the first number the column and the
  second number the row, to reflect that it's a column-major matrix (this is
  also how it's defined in the native SCNMatrix4 type).
* Functions that return a transformation matrix have been modified to return column-vector
  transformers. Technically this means that these matrices are transposed compared
  to legacy Xamarin. The functions involved are:
    * CreateFromAxisAngle
    * CreateRotation[X|Y|Z]
    * CreateTranslation
    * CreatePerspectiveFieldOfView
    * CreatePerspectiveOffCenter
    * Rotate
    * LookAt
* Combining two column-vector transforming transformation matrices is done by multiplying
  them in the reverse order, so the Mult function (and the multiplication operator)
  have been modified to multiply the given matrices in the opposite order (this matches
  how the SCNMatrix4Mult function does it). To make things clearer I've changed the
  parameter names for XAMCORE_5_0.
* Functions that transform a vector using a transformation matrix have been modified
  to do a column-vector transformation instead of a row-vector transformation. This
  involves the following functions:
    * SCNVector3.TransformVector
    * SCNVector3.TransformNormal
    * SCNVector3.TransformNormalInverse
    * SCNVector3.TransformPosition
    * SCNVector4.Transform
* Numerous new tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/15094.
2022-06-17 20:17:05 +02:00
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).

This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
2022-06-07 10:11:02 +02:00
Rolf Bjarne Kvinge 3d904dae2c
[tests] A few test fixes to make testing system installs better. (#14652)
* Make the custom-type-assembly library build using assemblies relative to
  MAC_DESTDIR, instead of poking into $(TOP)/_mac-build (for legacy Xamarin).
* Build the custom-type-assembly using a project file for .NET (and use our
  local .NET).
* Change the default for [IOS|MAC]_DESTDIR when TESTS_USE_SYSTEM is set to
  point to the system installation.
* Make sure 'MSBuildSDKsPath' isn't set when building the custom-type-assembly
  (set by xibuild), it breaks a lot of things.
2022-04-06 08:35:25 +02:00
Rolf Bjarne Kvinge d95f2d15ad
[dotnet] Use a variable for 'net6.0' instead of hardcoding it. (#14481)
This makes it easier to bump to 'net7.0' when that time comes.
2022-03-24 16:41:29 +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 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
Alex Soto 35e2e45e98 [Xcode 13.3] Initial commit to Xcode 13.3 release 2022-03-14 22:54:33 -04: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 5b8250486f
[dotnet/msbuild] Run install_name_tool to fix the id for dylibs. Fixes #13999. (#14147)
Fixes https://github.com/xamarin/xamarin-macios/issues/13999.
2022-02-16 21:13:40 +01:00
Rolf Bjarne Kvinge b1ce33ba51
[Foundation/ObjCRuntime] Use 'ObjCException' as the native exception type name for all platforms in .NET. Fixes #13855. (#13915)
* Use 'ObjCException' instead of 'MonoTouchException' as the managed exception
  type wrapping an NSException for all platforms in .NET (that was already the
  case for macOS, so no change there).
* Make the ObjCException class behave like the MonoTouchException class does.
* Move the ObjCException type to the ObjCRuntime namespace in .NET.

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

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-01 17:24:57 +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 a2e4438536 Merge remote-tracking branch 'origin/main' into dotnet-resolvedfiletopublish 2022-01-13 22:13:00 +01:00
Rolf Bjarne Kvinge a35ee4e7a6
[CoreAnimation] Rename CATransform3D's fields to follow standard naming conventions for .NET. (#13684)
Public fields shouldn't start with a lower-cased letter.

Also provide public properties in legacy Xamarin so that we can write
identical code for both, and obsolete the lower-cased fields.
2022-01-12 21:46:20 +01:00
Rolf Bjarne Kvinge d430dd74c0 [tests] Add build logic to build numerous native libraries for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 0cc54bd76e [tests] Add build logic to build NuGets for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 40d4e6a49a [tests] Add build logic to build numerous native plugins for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge cf290be186 [tests] Add build logic to build numerous native frameworks for testing purposes. 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 1a5e397b01 [tests] Add a zipped version of XTest.[xc]framework 2021-12-22 10:17:34 +01:00
Rolf Bjarne Kvinge 1c008fe315 [tests] Fix some make logic in test-libraries.
Use the right template variable in the template expansion to avoid duplicating variable names.
2021-12-22 10:17:33 +01:00
Rolf Bjarne Kvinge 8bf7b663be [tests] Build test libraries for [ios|tvos]simulator-arm64
This turned out a bit complicated, because we're lipo'ing together both the simulator
and device slices, and that doesn't work anymore when ARM64 is both a simulator and
a device architecture. The solution is a custom lipo logic that doesn't include the
simulator version of the ARM64 architecture in the final binary.
2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge 78f52e2fc2
[msbuild/tests] Add support for xcframeworks with static libraries in them. (#13459)
* [tests] Create a libtest.xcframework and libtest2.xcframework

* [tests] Make bindings-test and bindings-test2 use an xcframework instead of plain static library

* [msbuild] Add support for xcframeworks with static libraries in them.

* List the frameworks libtest needs.

* [tests] Update .NET unit tests according to test project changes.

* [tests] Add new test to verify that packing an old-style binding project doesn't work.
2021-11-30 18:19:22 +01:00
Rolf Bjarne Kvinge 88eb5e1ac8
Rename any *OSX_SDK_VERSION variables to *MACOS_SDK_VERSION. (#13411)
This makes it easier to iterate over all the *_SDK_VERSION variables in
template code, because they're all named using the standard platform names we
use elsewhere.
2021-11-22 18:48:05 +01:00
Rolf Bjarne Kvinge 66e596e9d9
[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)
The PlatformName enum will be removed from .NET soon.
2021-11-15 08:06:36 +01:00
Rolf Bjarne Kvinge cb998a3589
[msbuild/dotnet] Don't use the built-in publishing logic in .NET to copy frameworks to the app bundle. Fixes #12369. (#12656)
.NET/MSBuild don't handle symlinks properly [1], which means that we can't ask
.NET to copy frameworks to the app bundle, since frameworks may contain
symlinks.

In our case, the symptom was that instead of copying symlinks, the file the
symlink pointed to was copied instead, and then codesign complained about
invalid bundle format when we tried to sign the framework.

We fix this by having our own target (_CopyFrameworksToBundle) to copy
frameworks to the app bundle (instead of adding all the files in the
frameworks to the ResolvedFileToPublish item group), and then using 'ditto' to
copy the frameworks.

In order to create a test case for this, I also made the macOS and Mac
Catalyst versions of the XTest framework use symlinks:

* Create a proper XTest framework bundle hierarchy for macOS and Mac Catalyst
  by using the typical symlink structure (actual files in the Versions/A
  subdirectory, and then symlinks pointing into that directory).
* Create a separate Info.plist for each platform for XTest.framework, since
  using an otherwise correct framework makes tooling (such as codesign)
  complain if the Info.plist isn't correct too.

This made our existing tests show the bug.

Finally I had to fix signing frameworks where the executable is a symlink.

We were first resolving symlinks for the input - say we had an
Example.framework/Example symlink to Example.framework/Versions/A/Example -
and then checking the parent directory if it's a framework. The parent
directory of 'Example.framework/Versions/A/Example' is 'A', which did not meet
our framewrok condition (if it ends with '.framework').

The fix is to adjust the logic to resolve symlinks after checking if the input
is a framework or not.

[1]: https://github.com/dotnet/msbuild/issues/6821

Fixes https://github.com/xamarin/xamarin-macios/issues/12369.
2021-09-09 09:11:25 +02:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge b4952521d3 Merge remote-tracking branch 'origin/main' into issue-11061 2021-05-20 16:22:50 +02:00