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

16750 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 5d4bff54b0
[AppKit] Make NSGraphics.NSBestDepth P/Invoke blittable. (#19614)
Also introduce a few other improvements:

* Add an varation that takes an 'out bool' instead of a 'ref bool'. According
  to the documentation the value is out-only.
* Name this variation according to our guidelines (with a verb).
* Deprecate the old version.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/15684.
2023-12-13 12:55:25 +01:00
Rolf Bjarne Kvinge 8eb8788c5f
[msbuild] Use a single generated versions file for all platforms. (#19593)
This is a step (among many) towards merging the iOS and Mac task assemblies
into a single assembly, which would simplify and speed up our build quite a bit.
2023-12-13 12:52:47 +01:00
Rolf Bjarne Kvinge ad4c5c5a72
[tests] Fix detecting the runtime identifier for macOS tests executed on the command line. (#19592) 2023-12-13 12:52:29 +01:00
Rolf Bjarne Kvinge b367db52f2
[msbuild] Merge the CoreMLCompiler[TaskBase] classes. (#19588) 2023-12-13 12:52:15 +01:00
dotnet-maestro[bot] d5b31ea7c0
[main] Update dependencies from dotnet/xharness (#19617)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20231206.1
- **Date Produced**: December 6, 2023 2:37:38 PM UTC
- **Commit**: b058fd28cbd724817c21efee85bb34effb5d2c14
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.23577.1 to 9.0.0-prerelease.23606.1][1]

[1]: c1238c2118...b058fd28cb
2023-12-13 12:38:26 +01:00
Manuel de la Pena 7ad1837e7d
[Metal] Add support for Xcode15. (#19379)
This PR brings all the changes from the new Metal APIs. During the
review pay special attention to the changes done in the Protocols in
order to add tvOS support.

The main problem we have had doing this PR is that tvOS was not done on
time before the NET branching, that left us with a lot of memebers that
were NOT added in tvOS that are abstract on dotnet, which has left use
in a pickle.

Lets use the following code as an example.

Code found before this commit:

```csharp
	[Mac (11, 0), iOS (14, 0), NoTV]
	[MacCatalyst (14, 0)]
#if NET
	[Abstract]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

A naive approach would be to add just the tvOS suppor as follows:

```csharp
	[Mac (11, 0), iOS (14, 0), TV (16,0)]
	[MacCatalyst (14, 0)]
#if NET
	[Abstract]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

The above change represents and API braking change on the donet tvOS dll
because it adds a new Abstrtact members, so this is no an acceptable
solution.

There is a second naive approach we can take which is as follows:

```csharp
	[Mac (11, 0), iOS (14, 0), TV (16,0)]
	[MacCatalyst (14, 0)]
#if NET &!TVOS
	[Abstract]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

Yet again, the naive approach has an issue with it. In this case, all
the extension methods that are generated for tvOS (something the
generator writes when methods are not abstract) will be decorated with
availability attributes for all the other platforms, which is incorrect
and will make developers life worse.

That leaves us with the following approach:

```csharp
#if NET
#if !TVOS
	[Mac (11, 0), iOS (14, 0), NoTV, MacCatalyst (14, 0)]
	[Abstract]
#else
	[NoMac, NoiOS, TV (16,0), NoMacCatalyst]
#endif
#else
	[Mac (11, 0), iOS (14, 0), TV (16,0), MacCatalyst (14, 0)]
#endif
	[Export ("accelerationStructureCommandEncoder")]
	IMTLAccelerationStructureCommandEncoder CreateAccelerationStructureCommandEncoder ();
```

With the above change, we do not add an abstract method in tvOS and we
only add the tvOS abailabity attribute to the extension methods, and use
NoiOS etc for all the other platforms.

The change had to be done to ALL methods that added tvOS support. The
good news are that our cecil tests and our introspection tests catch the
two naive approaces :)

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-12-12 17:39:56 -05:00
Manuel de la Pena 5cac237b84
[CI] Ensure that the new dependencies are correcly managed. (#19621) 2023-12-11 22:16:43 -05:00
Manuel de la Pena 1173c016b7
[Generator] Allow to have a way to attach to the generator. (#19565)
As soon as we moved to have a build of the generator that used dotnet we
opened the door to a number of developer life improvements. The very
first one of those is the poissibility to attach the dotnet debugger to
the bgen process and that way be able to debug.

In order to do that, this PR has changed two small things:

1. Added code in the main method of the generator that will block the
tool until a debugger is attached.
2. Changed the csproj to add the previously mentioned code only when the
enviroment variable XAMMACIOS_DEBUGGER is set. This way the code does
not reach our customers.

A README has been added explaining how to debug the processes via Visual
Studio. Any other IDE that support the dotnet debugger can be used this
way.

<img width="1075" alt="Screenshot 2023-12-03 at 19 10 18"
src="https://github.com/xamarin/xamarin-macios/assets/2190086/dbafc570-7c43-419f-977e-ace66f5561ac">

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-12-11 11:58:15 -05:00
Rolf Bjarne Kvinge d4c6cfca7a
[msbuild] Merge the CreateAssetPackManifest[TaskBase] classes. (#19589) 2023-12-11 09:57:14 +01:00
Rolf Bjarne Kvinge eb973ea0d6
Bump mlaunch. (#19585)
Related new commits in xamarin/maccore:

* xamarin/maccore@39a7e52166 [mlaunch] Show all output from a failing devicectl command.
* xamarin/maccore@f29148cb58 [mlaunch] Add support for killing apps on device using devicectl. Fixes #xamarin/xamarin-macios@19577.
* xamarin/maccore@632997797a [mlaunch] Fix launching apps on device using a bundle id when using devicectl.

Diff: 699ed5eaf2..39a7e52166
2023-12-11 08:49:50 +01:00
Rolf Bjarne Kvinge c2c5140a6c
Update DOWNLOADS.md with new releases. (#19595) 2023-12-11 08:47:13 +01:00
Manuel de la Pena 5cca8aa1cf
[CoreMidi] Add CoreMidi enums to Watch so that we can have them for avfoundation. (#19580)
Similar to https://github.com/xamarin/xamarin-macios/pull/19529 we need
this for all the avfoundation to be landed.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-12-07 12:32:32 -05:00
Rolf Bjarne Kvinge 9851502e74
[CoreBluetooth] Fix a typo in CBPeripheralDelegate.DiscoveredService for XAMCORE_5_0. (#19582) 2023-12-07 10:43:03 +01:00
Rolf Bjarne Kvinge d4e49a53d2
[xharness] Fix a few minor code issues + wrong copyright. (#19583) 2023-12-07 08:05:39 +01:00
Rolf Bjarne Kvinge cce2510e3e
[msbuild] Merge the CompileSceneKitAssets[TaskBase] classes. (#19573) 2023-12-06 20:57:44 +01:00
Rolf Bjarne Kvinge 57c919e0af
[msbuild] Merge the ComputeCodesignItems[TaskBase] classes. (#19575) 2023-12-06 20:57:37 +01:00
Rolf Bjarne Kvinge 274e892967
[msbuild] Merge the ComputeRemoteGeneratorProperties[TaskBase] classes. (#19576) 2023-12-06 20:57:29 +01:00
Michael Cummings (MSFT) 787779ee35
Centralize AgentPoolSelector (#19546)
Following #19491 , this change moves the AgentPoolSelector to the Config
stage since it is deterministic per build.
2023-12-06 14:22:48 -05:00
Rolf Bjarne Kvinge eb3c561e7b
[msbuild] Parse --nowarn and --warnaserror from MtouchExtraArgs for .NET. (#19540) 2023-12-06 17:27:17 +01:00
Rolf Bjarne Kvinge 107d644b55
[xharness] Convert to .NET. (#19541)
* Convert xharness.csproj and Xharness.Tests.csproj to .NET/sdk-style projects.
* Fix numerous nullability issues that came up.
* Adjust Make logic to do the correct thing now that the executable is named differently.
* Port usage of WebClient to HttpClient, since WebClient is deprecated.
* Find an alternative solution to System.Web.MimeMapping.GetMimeMapping, which
  doesn’t exist in .NET.
* Fix misc other warnings and errors.
2023-12-06 15:57:12 +01:00
Michael Cummings (MSFT) dc11aa98b2 Move AgentPoolSelector to configure_build stage 2023-12-06 12:51:15 +00:00
Michael Cummings (MSFT) f30043647f
Add config stage for CI (#19491) 2023-12-06 07:47:17 -05:00
Rolf Bjarne Kvinge 9bef443d92
[builds] Create Versions.plist/buildinfo for .NET independently of the legacy Xamarin versions. (#19534)
This is one small step towards removing legacy Xamarin one day, since it
removes .NET logic that depends on legacy Xamarin logic.
2023-12-05 15:54:56 +01:00
Rolf Bjarne Kvinge ec64aa504c
[src] Update dependencies of bgen.csproj to not use the dependencies of generator.csproj. (#19572)
They're not quite the same, and in any case this decouples a .NET
project from a legacy Xamarin project, which is good long-term.
2023-12-05 15:53:54 +01:00
dotnet-maestro[bot] f5fe7bf9af
[main] Update dependencies from dotnet/xharness (#19570)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20231127.1
- **Date Produced**: November 27, 2023 6:13:19 PM UTC
- **Commit**: c1238c21187506a3539e09ac9eba582a1fd7a74d
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 9.0.0-prerelease.23570.2 to 9.0.0-prerelease.23577.1][1]

[1]: 38841f0f33...c1238c2118
2023-12-05 14:02:04 +01:00
Michael Cummings (MSFT) 10691ca38d Remove commented code 2023-12-05 12:57:22 +00:00
Michael Cummings (MSFT) b5756a160c
Merge branch 'main' into config-as-stage 2023-12-05 06:18:18 -05:00
Michael Cummings (MSFT) ec3766a9bf
Add --ignore-unknown-params (#19456)
* fail if there are unknown parameters and --ignore-unknown-params is
not provided
2023-12-04 22:19:24 -05:00
dustin-wojciechowski 89c0016742
[Generator] New LibraryManager for BindingTouch (#19479)
This PR introduces the LibraryManager and LibraryInfo and integrates them into BindingTouch.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-12-04 12:26:36 -08:00
Rolf Bjarne Kvinge 1ddc0b4b74
Get Mono.Cecil from NuGet everywhere. (#19535)
Also:

* Store the version in Directory.Build.props, which makes it much easier to update.
* Bump all versions to latest (0.11.5).
2023-12-04 20:15:03 +01:00
Rolf Bjarne Kvinge a9c9598820
[msbuild] Detect any dylibs in NativeReferences. Fixes #19520. (#19560)
We add the dylib location as an rpath if the app has any location, so make
sure to correctly detect dylibs in native references.

Fixes https://github.com/xamarin/xamarin-macios/issues/19520.
2023-12-04 20:11:20 +01:00
Manuel de la Pena a70718e612 Corrent ouput variable. 2023-12-04 12:56:09 -05:00
Rolf Bjarne Kvinge c6ebdd3bf2
[msbuild] Merge the ComputeBundleResourceOutputPaths[TaskBase] classes. (#19552) 2023-12-04 18:31:17 +01:00
Rolf Bjarne Kvinge 70874e2275
[msbuild] Merge the ComputeBundleLocation[TaskBase] classes. (#19551) 2023-12-04 18:31:06 +01:00
Rolf Bjarne Kvinge 45f6ceb8ed
[msbuild] Merge the CompileProductDefinition[TaskBase] classes. (#19548) 2023-12-04 18:30:39 +01:00
Rolf Bjarne Kvinge b09ac67cfc
[tests] Ignore network-related failures in UrlConnectionTest.SendSynchronousRequest. (#19567) 2023-12-04 17:03:43 +01:00
Manuel de la Pena 16ac6b14fe
[Generator] Clean the AttributeManager from deps and fix a bug in the errors. (#19532)
Remove the need to pass the BT. More importantly fix an issue with the
errors when more than one attribute was expected. The eng that wrote the
code did not consider translations, and therefore the current errors
seen by a non-english speaker will result in part of the error in her
native language and the rest in english. On top of that, in english the
error is broken with words repited or broken sentences.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-12-04 07:08:16 -05:00
Rolf Bjarne Kvinge d77105b3a9
[tests] Make it easier to run tests from the command line with NativeAOT. (#19559) 2023-12-04 08:45:10 +01:00
Rolf Bjarne Kvinge 16ad84f6be
[devops] Add the net9.0 branch to the publishing workflow. (#19557) 2023-12-04 08:44:56 +01:00
Rolf Bjarne Kvinge bcbc4f8dfd
[tests] Fix an issue with the ProjectTest.InvalidArchProperty test. (#19549)
It seems targets are ran in a different order in .NET 9, which means that we
ran into a different one that the one we expected. So fix that error, which
means we're now getting the error the test is checking for again.

Fixes:

    Xamarin.Tests.DotNetProjectTest.InvalidArchProperty(TVOS,"MtouchArch","arm64"): Error count
        Expected: 1
        But was: 2

    Xamarin.Tests.DotNetProjectTest.InvalidArchProperty(MacCatalyst,"MtouchArch","x64"): Error count
        Expected: 1
        But was: 2

    Xamarin.Tests.DotNetProjectTest.InvalidArchProperty(MacOSX,"XamMacArch","x64"): Error message
        Expected string length 172 but was 50. Strings differ at index 0.
        Expected: "The property 'XamMacArch' is deprecated, please remove it fro..."
        But was: "Could not parse TargetArchitectures 'x64'\n "
        -----------^

    Xamarin.Tests.DotNetProjectTest.InvalidArchProperty(iOS,"MtouchArch","armv7s"): Error count
        Expected: 1
        But was: 2

Also improve error reporting a bit.
2023-12-04 08:25:41 +01:00
Rolf Bjarne Kvinge 0e42551756
[tests] Port the ModelMustBeProtocol test from monotouch-test to cecil-test. (#19561)
It uses reflection, so it upsets NativeAOT, so just move it to cecil-test instead.

This will make it run faster, and also more predictable (it's supposed to
check all types, but types in monotouch-test may have been linked away).

Ref: https://github.com/dotnet/runtime/issues/95444
2023-12-04 08:25:07 +01:00
Michael Cummings (MSFT) 03cc40b360
convert to if ... fi
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-11-30 21:58:56 -05:00
Manuel de la Pena d5f62b2758
[CoreMidi] Add support for tvOS. (#19529)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-11-30 13:25:34 -05:00
Michael Cummings (MSFT) 6ddb0f95a0 Use correct syntax 2023-11-30 17:58:22 +00:00
Michael Cummings (MSFT) 0d07d0f4c7 Re-Add condition to Windows Integration tests 2023-11-30 16:04:48 +00:00
Rolf Bjarne Kvinge a736e683ae
[AppKit] Update the NSBezelStyle enum according to latest headers. Fixes #19555. (#19556)
Fixes https://github.com/xamarin/xamarin-macios/issues/19555.
2023-11-30 15:58:13 +01:00
Michael Cummings (MSFT) 6da9d55abb Add --ignore-unknown-params
* fail if there are unknown parameters and --gnore-unknown-params is not provided
2023-11-30 09:29:32 -05:00
Šimon Rozsíval 40c3f422c4
[NativeAOT] Improve the transformation of [Preserve(AllMembers = true)] (#19516)
Closes #19505 

We transform `[Preserve(AllMembers = true)]` into
`[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(T))]`.
There is difference between which members are preserved in these two
cases. The `DynamicallyAccessedMemberTypes.All` preserves many more,
especially nested types and their members. This manifested with the
`IL3050` AOT analysis warning we got from ILC when building any app:
1. `NSObject_Disposer` has `[Preserve(AllMembers = true)]`
2. `NSObject_Disposer` is a subclass of NSObject
3. `NSObject` has nested enums `Flags` and `XamarinGCHandleFlags`
4. the base class `Enum` has a public static method `GetValues(Type)`
5. the `GetValues` method is annotated with `RequiresDynamicCode` and
ILC produces a warning because even though it isn't used anywhere in the
codebase, it could be used via reflection

I changed two things when transforming Preserve:
- For enums, we only need to preserve public fields. We especially want
to avoid `PublicMethods` since that would preserve public methods in the
base class which includes the `GetValues(Type)` method.
- For other types, I list explicitly the member types that should be
preserved instead of using `All`.
- The code is verbose, but in the end, I chose the explicit list instead
of `All ^ PublicNestedTypes ^ NonPublicNestedTypes` since that would
automatically include any new flag added to the enum in the future.
2023-11-30 11:39:27 +01:00
dotnet-maestro[bot] b7c305d182
[main] Update dependencies from dotnet/installer (#19537)
This pull request updates the following dependencies

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

- **Subscription**: 80cb9ffd-f92f-4fc8-9f8b-08dbca46abfb
- **Build**: 20231128.14
- **Date Produced**: November 28, 2023 6:11:05 PM UTC
- **Commit**: 822071c28a37cfcbf2b32077b6983e1c666160e5
- **Branch**: refs/heads/release/8.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 8.0.101-servicing.23572.5 to 8.0.101-servicing.23578.14][2]
  - **Microsoft.NET.ILLink.Tasks**: [from 8.0.0 to 8.0.0][3]
  - **Microsoft.AspNetCore.App.Ref**: [from 8.0.0-rtm.23524.5 to 8.0.0][4]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0 to 8.0.0][3]
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: [from 8.0.0 to 8.0.0][5]
  - **Microsoft.NETCore.App.Ref**: [from 8.0.0 to 8.0.0][3]

[2]: 35587e8180...822071c28a
[3]: https://dev.azure.com/dnceng/internal/_git/dotnet-runtime/branches?baseVersion=GC488a8a3521&targetVersion=GC5535e31a71&_a=files
[4]: https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/branches?baseVersion=GCb0c12dfb32&targetVersion=GC3f1acb5971&_a=files
[5]: 51bf18a2e2...2406616d0e

## 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 to 8.0.0 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.AspNetCore.App.Ref**: from 8.0.0-rtm.23524.5 to 8.0.0 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0 to 8.0.0 (parent: Microsoft.Dotnet.Sdk.Internal)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100**: from 8.0.0 to 8.0.0 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 8.0.0 to 8.0.0 (parent: Microsoft.Dotnet.Sdk.Internal)
2023-11-30 10:58:36 +01:00
Michael Cummings (MSFT) 3e954db19d try removing the condition for the windows tests 2023-11-29 15:49:41 +00:00