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

16091 Коммитов

Автор SHA1 Сообщение Дата
Emanuel Fernandez Dell'Oca e7b7d168ec
[msbuild] Fix null check when validating Hot Restart app identifier (#18546)
The detection of signing identities should fail if we could not build a
valid app id. This code originally checked for null (`AppId == null`)
and was replaced by `is not null` as part of
36af029204 (diff-ff4502eb16b65dc59bb7de2bf980024260e83d7b97fef727c9c033374f2b3533R106).
2023-07-10 18:36:37 -04:00
Manuel de la Pena ed13befa6d
[CI] Ignore false positives from policheck and other tools. (#18547) 2023-07-10 17:51:45 -04:00
dotnet-maestro[bot] a2ce5f3485
[net8.0] Update dependencies from dotnet/installer (#18525)
This pull request updates the following dependencies

[marker]: <> (Begin:Coherency Updates)
## 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)

[DependencyUpdate]: <> (Begin)

- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23328.3 to
8.0.0-preview.7.23359.2 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1 (parent: Microsoft.Dotnet.Sdk.Internal)

[DependencyUpdate]: <> (End)

[marker]: <> (End:Coherency Updates)











[marker]: <> (Begin:f9b68d84-9c90-4bd0-5499-08db4112d57e)
## From https://github.com/dotnet/installer
- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230710.1
- **Date Produced**: July 10, 2023 9:47:19 AM UTC
- **Commit**: 62ef57f1140e7fa71cf452542b263e7999cac168
- **Branch**: refs/heads/main

[DependencyUpdate]: <> (Begin)

- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23329.2 to
8.0.100-preview.7.23360.1][31]
- **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1][32]
- **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23328.3 to
8.0.0-preview.7.23359.2][33]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1][32]
- **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23328.9 to
8.0.0-preview.7.23359.1][32]

[31]:
12bfecc01d...62ef57f114
[32]: cfae69f624...31106939ba
[33]:
c7b4724a7d...be566b1f4e

[DependencyUpdate]: <> (End)


[marker]: <> (End:f9b68d84-9c90-4bd0-5499-08db4112d57e)

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2023-07-10 17:22:11 -04:00
Manuel de la Pena 72865626fe
[Policheck] Fix all policheck issues that are not part of the apple APIs. (#18544) 2023-07-10 14:38:21 -04:00
Manuel de la Pena b05b9e336e
[CI] Onboard to tsa so that policheck exceptions can be added via workitems. (#18504) 2023-07-07 11:11:10 -04:00
Ivan Povazan bcb8e5cfd3
Exclude assemblies from NativeAOT app bundles (#18532)
Since NativeAOT generates native libraries and executables that do not
rely on assemblies they were compiled from, all managed assemblies can
be excluded from the application bundle.

This reduces the size of the application bundle by `3,17Mb` (or ~19%
compared to the baseline)

| MAUI ios app | Base | This PR | diff (%) |
|--------------|-----------|-----------|----------|
| SOD (Mb)     | 50,13 | 41,93 | -16,3%      |
| .ipa (Mb)    | 16,59  | 13,43  | -19%      |

Fixes: https://github.com/xamarin/xamarin-macios/issues/18472
2023-07-06 12:52:28 -04:00
Rolf Bjarne Kvinge 7ed8c08ab0
[net8.0] Merge main into net8.0. (#18520) 2023-06-30 13:19:43 +02:00
dotnet-maestro[bot] fb757b6844
[net8.0] Update dependencies from dotnet/installer (#18517)
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.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23327.19 to 8.0.0-preview.7.23328.3 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.7.23321.3 to 8.0.0-preview.7.23326.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23319.2 to 0.11.4-alpha.23327.1 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230629.2
- **Date Produced**: June 29, 2023 11:33:10 AM UTC
- **Commit**: 12bfecc01dfa05c84102893928ddc3840f97bb70
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23328.2 to 8.0.100-preview.7.23329.2][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9][2]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23327.19 to 8.0.0-preview.7.23328.3][3]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9][2]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.7.23321.3 to 8.0.0-preview.7.23326.1][4]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23326.5 to 8.0.0-preview.7.23328.9][2]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23319.2 to 0.11.4-alpha.23327.1][5]

[1]: f6fa6a301f...12bfecc01d
[2]: f0b4bb9c62...cfae69f624
[3]: fca06e70ae...c7b4724a7d
[4]: e004a85d84...60a73f97a0
[5]: f449dc9923...3e46711f5a
2023-06-30 10:44:03 +02:00
dotnet-maestro[bot] e50222a905
[net8.0] Update dependencies from xamarin/xamarin-macios (#18500)
This pull request updates the following dependencies

## From https://github.com/xamarin/xamarin-macios

- **Subscription**: 34d10fbb-96e7-4139-42ad-08db73ee5f69
- **Build**: 20230627.1
- **Date Produced**: June 27, 2023 2:20:37 AM UTC
- **Commit**: 663e05acb1
- **Branch**: refs/heads/release/7.0.3xx

- **Updates**:
  - **Microsoft.macOS.Sdk**: [from 13.3.7073 to 13.3.7089][5]

[5]: c0f492f938...663e05acb1
2023-06-30 10:36:01 +02:00
Filip Navara 29f8bd7a90
Revert "[dotnet] Remove libSystem.Net.Security.Native from tvOS builds when using NativeAOT." (#18514)
This reverts commit 97b91f1600.

Fixes #18481
2023-06-30 10:33:12 +02:00
Filip Navara 05502d1260
Remove IKVM submodule (#18516) 2023-06-30 10:32:32 +02:00
Emanuel Fernandez Dell'Oca 0ccfc4b506
Bump Xamarin.Messaging to 1.11.2 (#18521) 2023-06-30 10:31:50 +02:00
Rolf Bjarne Kvinge e2c673972b [net8.0] Merge main into net8.0. 2023-06-29 17:05:54 +02:00
Rolf Bjarne Kvinge c7fa7ab52e
[msbuild] Fix ILStripping of resource assemblies on Windows. (#18508)
Any assembly that's not already on the Mac must be copied there, so do that.
We detect if an assembly exist on the Mac by checking the file size of the
file on Windows: a 0-length file is an output file from an assembly that exist
on the Mac, otherwise it doesn't and must be copied.

Fixes https://github.com/xamarin/xamarin-macios/issues/17009.
Fixes https://github.com/xamarin/xamarin-macios/issues/14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.
2023-06-29 11:04:42 +02:00
Rolf Bjarne Kvinge 64b4a5909a
[tests] Automatic network failure detection in tests. (#18439)
Detect if a url we use in our tests actually works, and if not, save the
results and ignore any subsequent test that tries to use that url.

---------

Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
2023-06-29 07:48:53 +02:00
dotnet-maestro[bot] 97ac6dfbb9
[net8.0] Update dependencies from dotnet/installer (#18506)
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.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.7.23325.4 to 8.0.0-preview.7.23327.19 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230628.2
- **Date Produced**: June 28, 2023 10:48:59 AM UTC
- **Commit**: f6fa6a301f0e090d9a4dbebf0127a845bcd825f4
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23326.3 to 8.0.100-preview.7.23328.2][1]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5][2]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23325.4 to 8.0.0-preview.7.23327.19][3]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5][2]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.7.23325.2 to 8.0.0-preview.7.23326.5][2]

[1]: fe40884b18...f6fa6a301f
[2]: eaa9717d90...f0b4bb9c62
[3]: b640052a0a...fca06e70ae
2023-06-28 18:30:56 +02:00
Šimon Rozsíval 6010c13d40
[managed-static-registrar] Remove use of reflection in UCOs of generic types (#18421)
Closes #18356

In the static UnmanagedCallersOnly methods we don't know the generic
parameters of the type we're working with and we need to use this trick
to be able to call methods on the generic type without using reflection.
When we call a non-generic interface method implemented on a generic
class, the .NET runtime will resolve the generic parameters for us. In
the implementation of the interface method, we can simply use the
generic parameters and generate the same code we usually generate in the
UnmanagedCallersOnly callback method.

This is an example of the code we generate in addition to user code:

```csharp
internal interface __IRegistrarGenericTypeProxy__CustomNSObject_1__
{
	void __IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (IntPtr p0);
}

public class CustomNSObject<T> : NSObject, __IRegistrarGenericTypeProxy__CustomNSObject_1__
	where T : NSObject
{
	[Export ("someMethod:")]
	public void SomeMethod (T someInput)
	{
		// ...
	}

	// generated implementation of the proxy interface:
	public void __IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
	{
		try {
			var obj0 = (T) Runtime.GetNSObject<T> (p0);
			SomeMethod (obj0);
		} catch (Exception ex) {
			*exception_gchandle = Runtime.AllocGCHandle (ex);
		}
	}

	// generated registrar callbacks:
	private static class __Registrar_Callbacks__
	{
		[UnmanagedCallersOnly (EntryPoint = "_callback_1_CustomNSObject_1_SomeMethod")]
		public unsafe static void callback_1_CustomNSObject_1_SomeMethod (IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
		{
			var proxy = (__IRegistrarGenericTypeProxy__CustomNSObject_1__)Runtime.GetNSObject (pobj);
			proxy.__IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (sel, p0, exception_gchandle);
		}
	}
}
```
```csharp
// regular non-generic class for comparison:
public class CustomNSObject : NSObject
	where T : NSObject
{
	[Export ("someMethod:")]
	public void SomeMethod (NSSet someInput)
	{
		// ...
	}
	
	private static class __Registrar_Callbacks__
	{
		[UnmanagedCallersOnly (EntryPoint = "_callback_1_CustomNSObject_1_SomeMethod")]
		public unsafe static void callback_1_CustomNSObject_1_SomeMethod (IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
		{
			try {
				NSSet obj0 = Runtime.GetNSObject<NSSet> (p0);
				SomeMethod (obj0);
			} catch (Exception ex) {
				*exception_gchandle = Runtime.AllocGCHandle (ex);
			}
		}
	}
}
```

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-28 12:24:46 +02:00
Meri Khamoyan 3f6d43c756
[iOS] HybridGlobalization set flag in SDK (#18498)
Add HybridGlobalization flag in SDK and load icudt_hybrid.dat file when
HybridGlobalization is on.

Contributes to https://github.com/dotnet/runtime/issues/80689
2023-06-28 10:25:24 +02:00
Manuel de la Pena c0fa2efaa2
Bump maccore to pick policheck fixes. (#18503) 2023-06-27 16:04:29 -04:00
dotnet-maestro[bot] 9f3939c519
[net8.0] Update dependencies from dotnet/installer (#18502)
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.AspNetCore.App.Ref**: from 8.0.0-preview.7.23324.1 to 8.0.0-preview.7.23325.4 (parent: Microsoft.Dotnet.Sdk.Internal)

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230626.3
- **Date Produced**: June 26, 2023 10:09:12 PM UTC
- **Commit**: fe40884b18314b618457c61f59fe6b044deb4b33
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.7.23325.5 to 8.0.100-preview.7.23326.3][1]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.7.23324.1 to 8.0.0-preview.7.23325.4][2]

[1]: d2a244f560...fe40884b18
[2]: 213eb282fc...b640052a0a
2023-06-27 18:57:48 +02:00
Rolf Bjarne Kvinge 2c3435f682
[net8.0] Merge main into net8.0. (#18494) 2023-06-27 08:19:02 +02:00
Rolf Bjarne Kvinge 7f910487f5
[msbuild/dotnet] Handle dylibs that don't start with 'lib' better. Fixes #15044. (#18496)
For a given dylib named '/path/to/libMyLibrary.dylib', we pass this to the native linker:

    -L/path/to -lMyLibrary

however, that doesn't work unless the dylib's name starts with 'lib'.

So detect this, and if the dylib doesn't start with 'lib' (say it's just
'MyLibrary.dylib'), then just pass the path to the dylib as-is to the native
linker:

	/path/to/MyLibrary.dylib

Fixes https://github.com/xamarin/xamarin-macios/issues/15044.
2023-06-27 07:55:04 +02:00
dotnet-maestro[bot] e83845e989
[net8.0] Update dependencies from dotnet/installer (#18489#pullrequestreview-1498967369)
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.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-preview.6.23316.5 to 8.0.0-preview.7.23324.1 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: from 8.0.0-preview.6.23312.1 to 8.0.0-preview.7.23321.3 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.DotNet.Cecil**: from 0.11.4-alpha.23312.1 to 0.11.4-alpha.23319.2 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230625.5
- **Date Produced**: June 26, 2023 6:19:18 AM UTC
- **Commit**: d2a244f560b9f89387a5e748c19adf3114153f89
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.6.23320.7 to 8.0.100-preview.7.23325.5][14]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-preview.6.23316.5 to 8.0.0-preview.7.23324.1][16]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport**: [from 8.0.0-preview.6.23312.1 to 8.0.0-preview.7.23321.3][17]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0-preview.6.23316.3 to 8.0.0-preview.7.23325.2][15]
  - **Microsoft.DotNet.Cecil**: [from 0.11.4-alpha.23312.1 to 0.11.4-alpha.23319.2][18]

[14]: 7a0bb9fd74...d2a244f560
[15]: 76da696f3f...eaa9717d90
[16]: 974d15e3b0...213eb282fc
[17]: 1640faa87e...e004a85d84
[18]: ad66dcb8a0...f449dc9923
2023-06-26 18:44:18 +02:00
Rolf Bjarne Kvinge a8ba9c402c
[msbuild/generator] Compile api definitions in MSBuild logic instead of inside the generator. (#18398#pullrequestreview-1498787955)
This has a few advantages:

* A step towards simplifying the generator.
* A step towards being able to build binding projects on Windows, since it's easier
  to build C# code in MSBuild using the Csc task rather than figuring out how to
  call csc as an external program (which we've already done on macOS, but having
  a single solution that works on all platforms is preferrable).

Note that this is only implemented for .NET, doing this for legacy Xamarin required a lot more work.
2023-06-26 17:29:12 +02:00
Rolf Bjarne Kvinge 39da079d3e
[net8.0] [src] Add the RequiresPreviewFeatures attribute if we're using an unstable version of Xcode. Contributes towards #18343. (#18488)
Android does the same.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/18343.
2023-06-26 13:11:21 +02:00
Rolf Bjarne Kvinge 52e6ce238c Bump to preview 7 since we're getting preview 7 packages from dotnet/installer now. 2023-06-26 11:32:16 +02:00
Rolf Bjarne Kvinge 15b7907eab [net8.0] Merge main into net8.0. 2023-06-23 17:03:50 +02:00
Steve Hawley a36cd71174
[dotnet] Integrate class handle rewriting into static registrar process. (#18456)
Integrate class handle rewriting into static registrar.
2023-06-23 10:12:35 -04:00
Manuel de la Pena 9ac2d59d0b
[CI] Add a timeout to the provisioning of the sims. (#18491) 2023-06-23 07:21:00 -04:00
Manuel de la Pena 1681e9f915
[Code Style] Add some extra style checks focused on nullability. (#17831)
Added the following new checks:

```csharp
// dotnet_style_coalesce_expression = true
var v = x ?? y;

// dotnet_style_coalesce_expression = false
var v = x != null ? x : y; // or
var v = x == null ? y : x;
```

```csharp
// dotnet_style_null_propagation = true
var v = o?.ToString();

// dotnet_style_null_propagation = false
var v = o == null ? null : o.ToString(); // or
var v = o != null ? o.String() : null;
```

```csharp
// dotnet_style_prefer_is_null_check_over_reference_equality_method = true
if (value is null)
    return;

// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if (object.ReferenceEquals(value, null))
    return;

// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if ((object)o == null)
    return;
```
2023-06-22 13:31:04 -04:00
Rolf Bjarne Kvinge 9b72a75613
Add support for using NativeAOT. (#17374)
Add support for using NativeAOT on all our platforms.

This contains numerous changes in a lot of places to add support for
NativeAOT:

* build logic
* runtime
* managed code
* tests 

And it all pretty much consists of special-casing NativeAOT everywhere
we need to.

Note: NativeAOT doesn't work on macOS yet, because a dotnet/runtime fix
is required, and thus the corresponding test variations for
monotouch-test have been commented out.

This PR is best reviewed commit-by-commit.

This contributes towards https://github.com/xamarin/xamarin-macios/issues/17339.
2023-06-22 17:00:37 +02:00
dotnet-maestro[bot] 1893fc02b4
[net8.0] Update dependencies from dotnet/installer (#18468)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer

- **Subscription**: f9b68d84-9c90-4bd0-5499-08db4112d57e
- **Build**: 20230620.7
- **Date Produced**: June 21, 2023 4:20:57 AM UTC
- **Commit**: 7a0bb9fd747b5ed6e5f84911a944686068c1a9e6
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.100-preview.6.23318.1 to 8.0.100-preview.6.23320.7][2]

[2]: 8d98e5a6ba...7a0bb9fd74
2023-06-22 09:35:50 +02:00
Rolf Bjarne Kvinge b4e3361a10 [dotnet] Tell ILC about any satellite assemblies. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 3c912d7aea [dotnet] Treat the ICU data file as a resource instead of an assembly.
We can fix this better once this fix reaches us:

    https://github.com/dotnet/runtime/pull/87813

because then we can set the ICU data file at build time (to a relative path).
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 42d6121e12 [dotnet] Set a flag to avoid a bug with the NativeAOT compiler 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 94cdec2f53 [xharness] Disable NativeAOT test variations for Mac Catalyst for now, we need a few upstream fixes. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge e31b0a6dc4 [xharness] Disable NativeAOT test variations for macOS for now, we're waiting for a dotnet/runtime fix. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 8ac35baf44 [tests] Disable the NUnitLite and Touch.Unit references for the .NET 7 tests.
We had to bump NUnitLite and Touch.Unit's TargetFramework properties to
net8.0-* (otherwise projects using NativeAOT fails if these projects are
referenced), which means they can't be used from .NET 7 (aka our .NET 7
tests).

So just don't reference NUnitLite and Touch.Unit in this test.
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 264be7055e [dotnet] Disable SelfContained for the outer build of a universal app build when using NativeAOT. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge c49888bee1 [tests] Adjust ConfigTest to cope with different behavior when using NativeAOT. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 97b91f1600 [dotnet] Remove libSystem.Net.Security.Native from tvOS builds when using NativeAOT. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 7d65804e32 [dotnet/tests] Only use NativeAOT when publishing.
This matches how NativeAOT works for other platforms.
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 0adbf77643 [tests] Fix computing when the dynamic registrar is used. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge a1d707c013 [dotnet] Fix items in TrimmerRootAssembly to follow docs and what ILC supports. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 18eaeb24b2
[net8.0] [build] Require using EnablePreviewFeatures=true when using preview releases. Contributes towards #18343. (#18476)
Detect if we're using a non-stable Xcode, and in that case produce packages
that show an error if they're used and the EnablePreviewFeatures flag isn't
enabled.

Also add logic to set this flag for our own build, otherwise all our tests
would fail.

This is the same as Android does.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/18343.
2023-06-22 08:16:50 +02:00
Rolf Bjarne Kvinge aec6925d18
[msbuild] Print the binlog if the prebuilt app failed to build. (#18474)
This makes it easy to copy-paste the path to the binlog to open it in a
binlog viewer.
2023-06-22 08:16:12 +02:00
Rolf Bjarne Kvinge ce85073609
[msbuild] Remove some logic for watchOS on .NET. (#18473)
We don't support watchOS on .NET, so this is just useless code.
2023-06-22 08:15:56 +02:00
Rolf Bjarne Kvinge e3228d04ea [dotnet] Turn off some publishing behavior we don't need 2023-06-21 20:49:56 +02:00
Rolf Bjarne Kvinge 183c76af40 [dotnet] Use a different min OS version when building with NativeAOT.
This is because NativeAOT contains swift code, and we'd have to add code to
embed the Swift libraries in any apps that target early OS versions. We could
eventually implement this, but let's wait and see if there's a demand first.
2023-06-21 20:49:56 +02:00
Rolf Bjarne Kvinge d601e51698 [dotnet] Set PublishAotUsingRuntimePack=true when using NativeAOT to get the correct BCL libraries. 2023-06-21 20:49:56 +02:00