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

18207 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 06d5fc8df7
[tests] Fix MTLResidencySet tests on macOS Sequoia. (#21662) 2024-11-20 08:58:29 +01:00
Peter Collins 4681428636
[vs-workload.props] Append xcode info to VSMAN (#21657)
Context:
06fea905cf

In order to add .NET 9 Xcode16.1 builds to VS we'll need to insert packs
from two different commits on the `release/9.0.1xx-preview` branch.

Xcode information will now be added to the VS manifest that we generate
to allow us to produce unique manifests across the same branch.
2024-11-19 19:14:01 -05:00
Rolf Bjarne Kvinge 34666f5228
[CoreLocation] Fix misspelled field. Fixes #21641. (#21652)
Fixes https://github.com/xamarin/xamarin-macios/issues/21641.
2024-11-19 13:42:17 +01:00
Manuel de la Pena 6bfececed5
[Rgen] Implement the generation of the smart enums. (#21562)
Add the code generation for smart enumerators. This means the following
changes:

1. Refactor the way we register the diff pipelines.
2. Add code that generates the Extension class for the enums.
3. Add code that will generate the Library.g.cs partial class.

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-11-19 06:55:43 -05:00
Rolf Bjarne Kvinge fa9294b387
[devops] Use the BUILD_REPOSITORY_TITLE variable instead of hardcoding 'xamarin-macios'. (#21592)
And a few other minor cleanups as well.
2024-11-19 01:58:49 -08:00
Rolf Bjarne Kvinge 0a52c56892
[static registrar] Make sure to save any changes made by the managed static registrar. Fixes #21606. (#21637)
If an assembly only required the lookup tables from the managed static
registrar (and not any other code), we wouldn't save those changes.

This would lead to a runtime exception:

```
Microsoft.iOS: Processing Objective-C exception for exception marshalling (mode: 2):
Could not find the type 'ObjCRuntime.__Registrar__' in the assembly 'X.Y.Z'. (ObjCRuntime.RuntimeException)
   at ObjCRuntime.RegistrarHelper.GetMapEntry(String assemblyName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 105
   at ObjCRuntime.RegistrarHelper.GetMapEntry(Assembly assembly) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 93
   at ObjCRuntime.RegistrarHelper.LookupRegisteredType(Assembly assembly, UInt32 id) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 199
   at ObjCRuntime.Class.ResolveToken(Assembly assembly, Module module, UInt32 token) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 521
```

The fix is to save the assembly if the managed static registrar added
lookup
tables to the assembly.

Fixes https://github.com/xamarin/xamarin-macios/issues/21606.
2024-11-18 20:31:34 -05:00
Rolf Bjarne Kvinge 5b695a30fe
Bump mlaunch. (#21646)
New commits:

* https://github.com/xamarin/maccore/commits/fb16d52d12 [mlaunch] The
'ecid' property is an unsigned long, not a signed long. Fixes
#xamarin/xamarin-macios@21639.
* https://github.com/xamarin/maccore/commits/91c0e64e0f [mlaunch] Fix
listing devices.

Diff:
fcd7847f00..fb16d52d12
2024-11-18 20:30:25 -05:00
Rolf Bjarne Kvinge 98bee4d133
[cecil-tests] Add two more tests. (#21625)
Add two more Cecil tests:

* Verify that we don't call the NSObject.Handle setter, we're supposed to call
  NSObject.InitializeHandle instead (which throws an exception if the handle
  is null),
* Verify that we never call the base class' default constructor (very easy
  mistake to make) in manually bound constructors - we're supposed to call the
  overload that takes an `NSObjectFlag` parameter instead.
2024-11-18 10:18:13 -08:00
Rolf Bjarne Kvinge 1a7def0c89
[actions] The changelog action now requires .NET 9. (#21629)
So install that, since it doesn't look like it's installed by default yet.

Also build before running, because the new terminal logger for the build
in .NET 9 ends up printing junk which ends up in the changelog.
2024-11-15 19:56:31 +01:00
Rolf Bjarne Kvinge e9009b4371
[UIKit] Fix nullability for numerous UIView members. Fixes #21598. (#21621)
Fixes https://github.com/xamarin/xamarin-macios/issues/21598.
2024-11-15 07:47:27 -08:00
Rolf Bjarne Kvinge 305f4e2abe
[AppKit] Fix nullability for numerous NSView members. Fixes #21598. (#21619)
Fixes https://github.com/xamarin/xamarin-macios/issues/21598.

---------

Co-authored-by: Sergey Nechaev <6499856+snechaev@users.noreply.github.com>
2024-11-15 07:47:16 -08:00
dotnet-maestro[bot] e1b147a702
[main] Update dependencies from dotnet/xharness (#21601)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20241105.2
- **Date Produced**: November 5, 2024 2:32:53 PM UTC
- **Commit**: 431bf1b59fda99cc14526ed6b234519d1c60f973
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 10.0.0-prerelease.24529.1 to 10.0.0-prerelease.24555.2][1]

[1]: dad2805739...431bf1b59f
2024-11-15 07:43:47 -08:00
dotnet-maestro[bot] 0814b34e5c
[main] Update dependencies from dotnet/sdk (#21591)
This pull request updates the following dependencies

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

- **Subscription**: afa459aa-bd64-46cb-8138-9f6f795963d4
- **Build**: 20241111.8
- **Date Produced**: November 11, 2024 11:24:09 PM UTC
- **Commit**: 8e8e27079dc1f0c53add11c3ac58fd9796aa8e73
- **Branch**: refs/heads/release/9.0.1xx

- **Updates**:
  - **Microsoft.NET.Sdk**: [from 9.0.100-rtm.24527.3 to 9.0.101-servicing.24561.8][5]

[5]: 50e04b8d1d...8e8e27079d
2024-11-15 07:43:15 -08:00
Rolf Bjarne Kvinge ad61471e8b
[tests] Use a file as the Outputs property in MSBuild. (#21596)
Use a file (as opposed to a directory) as the Outputs property in MSBuild targets.

Directories have unintuitive file stamp behavior sometimes, which may confuse incremental builds, so use files instead to drive incremental builds.
2024-11-15 00:48:08 +01:00
Rolf Bjarne Kvinge 0e1c717bfc
[tests] Cache the evaluation of the DOTNET_DIR variable. (#21600)
This speeds up the tests somewhat, since it's fetched quite a few times.
2024-11-15 00:47:22 +01:00
Alex Soto 377f0f0b62
[main] Bump to the upcoming stable release versions of the SDKs (#21541) 2024-11-12 13:22:00 -08:00
Rolf Bjarne Kvinge 9ea3cff36c
[AppKit/MediaExtension/introspection] Fix issues found with introspection on Sequoia. (#21587)
* Mark a few MediaExtension fields as Notification fields.
* Remove extreanous NSSharingCollaborationModeRestriction.AlertRecoverySuggestionButtonLaunchUrl setter.
* introspection: ignore methods that start with '_Init', aren't publicly
  visible, and bind an Objective-C constructor when verifying that a managed
  method doesn't bind an Objective-C constructor.
2024-11-08 11:35:11 +01:00
Rolf Bjarne Kvinge 2e9273a2ec
Delete some legacy Xamarin files and other unused stuff. (#21583) 2024-11-07 08:06:50 +01:00
Rolf Bjarne Kvinge 49b837fc9e
[introspection] Numerous technical debt fixes. (#21584)
* Remove all legacy code.
* Fix all warnings.
* Enable warnings as errors.
* Started unifying code between macOS vs iOS/tvOS/MacCatalyst.
* Updated README slightly.
2024-11-07 08:06:31 +01:00
Rolf Bjarne Kvinge 95a0ad2e27
[tests] Add make target to build (not run) all the test suites. (#21575)
This is useful to verify that sweeping code changes actually compile everywhere.
2024-11-06 17:34:47 +01:00
dotnet-maestro[bot] 43768cfcb7
[main] Update dependencies from dotnet/xharness (#21574)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20241029.1
- **Date Produced**: October 29, 2024 10:03:01 AM UTC
- **Commit**: dad280573945a8a849b3b655d78706088320766f
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 10.0.0-prerelease.24524.9 to 10.0.0-prerelease.24529.1][1]

[1]: b12e9b9403...dad2805739
2024-11-06 11:35:14 +01:00
Rolf Bjarne Kvinge 0daefa2212
Remove a lot of legacy logic. (#21576) 2024-11-06 11:34:39 +01:00
Rolf Bjarne Kvinge 70b61c1b18
[msbuild] Make it possible to override the path to the 'strip' tool. (#21581) 2024-11-05 16:04:38 +01:00
Rolf Bjarne Kvinge eafa2d1b63
[tests] Improve PasteboardTest.ImagesTest to hopefully work better. (#21571)
Retry the test 10 times if it fails - it uses a shared resource (the
pasteboard), so it's possible to run into race conditions if the same test
also runs in a different process at the same time.

Also remove code that we removed a long time ago, so that the test actually
runs: 86ab2bc1d1.

Hopefully fixes https://github.com/xamarin/maccore/issues/2569.
2024-11-05 11:56:18 +01:00
Rolf Bjarne Kvinge 67d072e454
[msbuild] Add support for alternate app icons. (#21475)
This adds support for including all app icons in the app, as well as for specifying alternate app icons.

Including all app icons is enabled by setting the following MSBuild property:

```xml
<PropertyGroup>
    <IncludeAllAppIcons>true</IncludeAllAppIcons>
</PropertyGroup>
````

This will make the `ACTool` task pass `--include-all-app-icons` to `actool` when compiling the asset catalog.

Specifying alternate app icon(s) is enabled by setting the following MSBuild item:

```xml
<ItemGroup>
    <AlternateAppIcon Include="MyAlternateAppIcon" />
    <AlternateAppIcon Include="MyOtherAlternateAppIcon" />
</ItemGroup>
```

Note that the included value is the name if the icon in question, not the path or the filename of the actual icon file (this way there's no need to have different items for different platforms, because there are some platform differences with regards to paths and icon file extensions).

In order to make the behavior consistent, this PR also adds support for specifying the app icon itself using an MSBuild property (in addition to the existing Info.plist property `XSAppIconAssets`, which will eventually be deprecated):

```xml
<PropertyGroup>
    <AppIcon>MyAppIcon</AppIcon>
</PropertyGroup>
```

The same note applies here: the value is the name of the icon.

Note about platforms: the code is there for all platforms (iOS, tvOS, macOS and Mac Catalyst), but alternate app icons only seem to work for iOS and tvOS. `UIApplication.SupportsAlternateIcons` always returns `false` on Mac Catalyst (googling only find people in the same situation), and macOS doesn't have this API to begin with (nor anything similar):

Also:

* Add a bunch of tests.
* Document on our website: https://github.com/dotnet/docs-mobile/pull/53
* Samples for iOS and tvOS: https://github.com/dotnet/macios-samples/pull/2

Fixes https://github.com/xamarin/xamarin-macios/issues/12790.
Fixes https://github.com/xamarin/xamarin-macios/issues/20182.
2024-11-04 18:24:00 +01:00
Rolf Bjarne Kvinge 25fa00fbca
[api-diff] Remove tool to merge multiple markdown documents. (#21566)
It's not used anymore, because we only create a single markdown document for
each platform in .NET (because we only ship a single assembly for each platform now).
2024-11-04 12:01:02 +01:00
Rolf Bjarne Kvinge 1faaf032de
[tests] Remove the legacy scripted tests. (#21568)
These tests haven't found any issues in many years, and they're also based on
legacy Xamarin, so just remove them instead of porting them to .NET.
2024-11-04 11:32:21 +01:00
Rolf Bjarne Kvinge 589dd741b2
[devops] Improve Windows tests a little bit. (#21558)
* Run both sets of Windows tests (local and remote), and fail afterwards if there
  are test failures. This way we get both test suites executed even if the first
  one fails.
* Create a script for executing the local tests (makes it easier to run locally
  as well).
* Make it possible to use a custom built .NET locally by honoring any DOTNET variable
  instead of blindly setting it (makes it easier to test locally).
* Add a .gitignore for the test configuration file we create to run tests on Windows.
* Some minor code simplifications.
2024-11-04 10:22:18 +01:00
Rolf Bjarne Kvinge 0c2aa7522a
[csharp] Port the run-with-timeout script in tests/ to a .NET project. (#21563) 2024-11-01 08:56:38 +01:00
Rolf Bjarne Kvinge 15fb72d28d
[dotnet] Remove the generate-wix.csharp script, it's no longer used. (#21555) 2024-11-01 08:06:17 +01:00
Rolf Bjarne Kvinge 62f3c35f7c
[tools] Port mtouch/mmp to .NET. (#21556)
* Update the makefiles to remove legacy logic.
* Port the mtouch/mmp projects to a .NET project, and make the necessary code
  changes to keep it working (we still use mtouch/mmp during our build to
  generate the partial static registrar code).
* Misc other related changes.
2024-11-01 08:05:56 +01:00
Rolf Bjarne Kvinge f2376bfc77
[devops] Don't fetch tags when undoing the GitHub merge. (#21552)
We don't need the tags, so don't spend time fetching them.
2024-10-31 18:37:49 +01:00
Rolf Bjarne Kvinge 2b3e839dfc
[csharp] Port csharp scripts in dotnet/ to .NET projects. (#21554) 2024-10-31 18:37:18 +01:00
Manuel de la Pena 524279ffc0
[Rgen] Simplify the way we execute tests on all platforms. (#21547)
There is no need to write a line per platform when we can use an
attribvute for that.

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-10-30 19:15:33 -04:00
dotnet-maestro[bot] cf03595b9c
[main] Update dependencies from dotnet/xharness (#21536)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20241024.9
- **Date Produced**: October 24, 2024 4:45:22 PM UTC
- **Commit**: b12e9b940300433453aa7d57ff094aad50ce782c
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 10.0.0-prerelease.24514.1 to 10.0.0-prerelease.24524.9][1]

[1]: 8b3d320f93...b12e9b9403
2024-10-30 19:59:09 +01:00
Rolf Bjarne Kvinge b0ce070c51
Bump mlaunch. (#21550)
Relevant commits:

* https://github.com/xamarin/maccore/commits/fcd7847f00 [mlaunch] Fix --isappinstalled when using devicectl. (#2951)

Diff: c1a17a2f80..fcd7847f00

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2291207.
2024-10-30 19:45:20 +01:00
Manuel de la Pena 69895c9598
[RGen] Move common shared code to its own project. (#21548)
This simplifies the usage of those external file, specially for test
projects.
2024-10-30 10:59:01 -04:00
Manuel de la Pena d51fa94c3d
[Rgen] Provide a data model to make the code generator more performant. (#21517)
In order to fully take advantage of the
[caching](https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md#caching)
provided by the incremental code generator infrastructure we move to use
a data model that will represent the code changes that will trigger a
regeneration of certain classes.

The current implementation only takes care of the changes that will
trigger a regeneration on enums:

1. Enum fully qualified name changed.
2. Attributes added or removed in the enum.
2. Enum values added/removed.

We provide our own Comparer to have more control on how the structures
are compared.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2024-10-29 13:58:20 -04:00
Rolf Bjarne Kvinge f11253b5a2
[csharp] Port csharp scripts in src/ to .NET projects. (#21498) 2024-10-29 13:00:35 +01:00
Alex Soto e581020612
[main] Merge xcode16.1 into main (#21539) 2024-10-29 06:43:01 -04:00
dotnet-maestro[bot] dfba363fff
[main] Update dependencies from dotnet/sdk (#21526)
This pull request updates the following dependencies

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

- **Subscription**: afa459aa-bd64-46cb-8138-9f6f795963d4
- **Build**: 20241027.3
- **Date Produced**: October 28, 2024 3:35:29 AM UTC
- **Commit**: 50e04b8d1d8ff413de90383aa799e4189612f685
- **Branch**: refs/heads/release/9.0.1xx

- **Updates**:
  - **Microsoft.NET.Sdk**: [from 9.0.100-rtm.24523.41 to 9.0.100-rtm.24527.3][2]

[2]: 61144bb03d...50e04b8d1d
2024-10-29 09:39:14 +01:00
Alex Soto 3b9c704209
[xcode16.1] Bump to stable release of Xcode 16.1 (#21538) 2024-10-28 20:28:35 -04:00
Rolf Bjarne Kvinge 3ac70f74fb
[tests] Improve the AssetsTest test. (#21532)
* Remove test cases for 32-bit arm, which we don't support anymore.
* Use test-level test cases instead of fixture-level test cases, because the
  fixture-level test cases are all rendered identically in both the console
  output and the html report, making it impossible to figure out which
  variation failed when something goes wrong.
* Add new assets related to app icons.
* Update according to new test project assets.
* Ask 'assetutil` to write the output we care about to a file, that way we
  don't  have to take random stdout output into account.
* Simplify how the test asserts asset catalog contents to include all assets,
  not just a selection of them.

Note: might be easier to review commit-by-commit, because there's a lot of new
assets and I'm adding them in a separate commit.
2024-10-28 15:28:57 +01:00
Rolf Bjarne Kvinge 3565119e8e
[devops] Escape quotes when searching for work items using title. (#21534)
This makes the code to find existing work items for a given title actually
work.
2024-10-28 15:28:48 +01:00
Alex Soto 0715fd50bf
[xcode16.1] Merge main into xcode16.1. (#21533) 2024-10-28 10:23:34 -04:00
Rolf Bjarne Kvinge 627469d56b [xcode16.1] Merge main into xcode16.1. 2024-10-28 11:32:42 +01:00
Rolf Bjarne Kvinge 94526bc7bc
[msbuild] Fix an incremental build issue with resources in universal apps. (#21516)
For universal apps, we compile as many resources as we can in the outer
(universal) build, and then pass a path to a temporary file with a list of
those compiled resources to the inner (rid-specific) builds, so that the inner
builds can skip them.

We have to delete this temporary file after the inner builds have completed,
otherwise they may interfere with subsequent builds if the set of resources
has changed.

However, this revealed another issue with incremental builds: we still need to
write out this temporary file even if the outer build won't compile the
resources because they were compiled in a previous build, otherwise the inner
builds would unnecessarily compile those resources.

An upcoming test for a new feature found this issue, so I'm not adding a test.
2024-10-28 09:09:29 +01:00
Rolf Bjarne Kvinge 62bea9dc76
[devops] Clean up bots better from previous usage. (#21523)
* Find all git repositories in the default working directory, for both
  multi-repo checkouts and single-repo checkouts, and clean them all.
* Completely remove the 'packages' directory before putting any other files in
  it.
2024-10-28 09:08:59 +01:00
Rolf Bjarne Kvinge 5f69e3cd14
[devops] Fix link to step logs. (#21529) 2024-10-28 08:57:30 +01:00
Alex Soto 34ebd5776d
[xcode16.1] Merge main into Xcode 16.1 (#21528) 2024-10-26 11:08:03 -04:00