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

15756 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge cb1ffa0da7
[monotouch-test] Fix BlocksTest to work on maccatalyst-arm64. (#18708)
We use the AOT compiler on ARM64 on Mac Catalyst, so these tests have to
be excluded on Mac Catalyst.
2023-08-14 12:05:03 +02:00
Rolf Bjarne Kvinge 72a7f88b94
[tests] Improve assertion when a .NET test fails executing 'dotnet'. (#18700)
Improve assertion when a .NET test fails executing 'dotnet' by including
more information (any errors in particular) in the assert message.
2023-08-14 11:57:21 +02:00
Rolf Bjarne Kvinge be08931941
[dotnet] Stop hardcoding the .NET version in a few more projects. (#18702)
Just use whatever .NET version we're using to build with.
2023-08-14 11:56:32 +02:00
Rolf Bjarne Kvinge b1e2d56d54
[SpriteKit] Fix breaking change in SKAction.FollowPath. (#18696)
Breaking change

	Modified methods:

		public SKAction FollowPath (CoreGraphics.CGPath path, bool offset, bool ~orient~ orientToPath, double sec)
		public SKAction FollowPath (CoreGraphics.CGPath path, bool offset, bool ~orient~ orientToPath, System.Runtime.InteropServices.NFloat speed)
2023-08-14 11:55:32 +02:00
Rolf Bjarne Kvinge 4c115b037b
[tools] Remove some dead code in the class redirector rewriter. (#18695)
This also fixes a compiler warnings:

> tools/common/Rewriter.cs(333,25): warning CS8604: Possible null
reference argument for parameter 'path1' in 'string Path.Combine(string
path1, string path2)'.

And make nullability warnings in dotnet-linker show up as errors to
prevent future introduction of nullability warnings.
2023-08-14 11:49:06 +02:00
Rolf Bjarne Kvinge 24895406b2
[dotnet] Link Mono and Xamarin statically in Mac Catalyst by default. Fixes #14686. (#18619)
It's possible to create a provisioning profile for Mac Catalyst that
doesn't allow dylibs in the app. It seems a significant number of people run
into this problem when publishing their apps, so avoid it by linking Mono and
Xamarin statically by default instead.

The downside is that build time might increase a little bit.

An upside however is that the app size might decrease somewhat.

Fixes https://github.com/xamarin/xamarin-macios/issues/14686.
2023-08-11 15:08:27 +02:00
Rolf Bjarne Kvinge 18a8b25a0f
[devops] Fix setting the INCLUDE_LEGACY* variables when legacy isn't enabled. (#18689)
This fixes an issue where we'd try to sign the legacy Xamarin packages
even if the legacy build was disabled.
2023-08-11 11:19:36 +02:00
Rolf Bjarne Kvinge ce402bac61
[ObjCRuntime] NativeHandle.Zero shouldn't be writeable, so disallow that in the future. (#18694) 2023-08-11 11:11:39 +02:00
Rolf Bjarne Kvinge 7b1e40432d
Bump API references to latest stable. (#18678) 2023-08-10 19:02:07 +02:00
Rolf Bjarne Kvinge cff87d1496
[actions] Add more variations to the single-platform variation testing. (#18680)
Add:

* Only .NET (no legacy) - but all platforms.
* Only legacy (no .NET) - both platforms.
* Xamarin.iOS only.
* Xamarin.Mac only.
2023-08-10 14:37:29 +02:00
Rolf Bjarne Kvinge 8732e1cedd
[xharness] Stop hardcoding the target framework in xharness. (#18682) 2023-08-10 13:14:34 +02:00
Rolf Bjarne Kvinge a64104cf76
[tests] Filter out any warnings about out-of-support workloads. (#18679)
Our test projects may be using an earlier version of .NET (in particular
Touch.Unit and MonoTouch.Dialog often are), so ignore any warnings about
out-of-support workloads.

Fixes test failures like:

    Xamarin.Tests.BundleStructureTest.Build(MacCatalyst,"maccatalyst-x64;maccatalyst-arm64",All,"Debug"): Warnings

        Expected is <System.Collections.Generic.List`1[System.String]> with 22 elements, actual is <System.String[28]>
        Values differ at index [22]
        Extra: < "The workload 'maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.", "The workload 'maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.", "The workload 'maccatalyst' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy."... >
2023-08-10 10:28:34 +02:00
Rolf Bjarne Kvinge 2eddcf8eea
[tests] Parse configure.inc for build settings as well. (#18674)
Additionally parse files in reverse order, because any variables at the
end should take precedence (when parsing config files the first time
variable is found is the one we use).
2023-08-10 07:55:50 +02:00
dotnet-maestro[bot] 571cd45627
[main] Update dependencies from dotnet/xharness (#18647)
This pull request updates the following dependencies

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

- **Subscription**: 601bc5e1-1cae-44b5-cf5f-08db9342aa2f
- **Build**: 20230803.1
- **Date Produced**: August 3, 2023 5:57:37 PM UTC
- **Commit**: 7e3f2975a8767cd416594d7194ba617f6ef8e88e
- **Branch**: refs/heads/main

- **Updates**:
  - **Microsoft.DotNet.XHarness.iOS.Shared**: [from 8.0.0-prerelease.23401.3 to 8.0.0-prerelease.23403.1][1]

[1]: c1216531b6...7e3f2975a8
2023-08-09 14:07:05 +02:00
Rolf Bjarne Kvinge 092e2ba28f
[msbuild] Don't try to run 'dotnet build' if 'dotnet restore' failed in the XamarinBuild task. (#18620)
This avoids throwing spurious exceptions when we blinding keep executing
stuff that doesn't make sense anymore.
2023-08-09 10:18:22 +02:00
Rolf Bjarne Kvinge 0590d65456
[devops] Remove option to disable .NET from CI. (#18650)
It's rather rare now that we need to disable .NET from the CI, so just
remove the option. It can still be disabled directly in the code when
needed.

Also this fixes an issue where we'd build with .NET enabled even if
disabled in the code, because we'd always pass --enable-dotnet to
configure.
2023-08-08 17:34:19 +02:00
Rolf Bjarne Kvinge 294bc1db9a
[GitOps] Ignore any comments by msftbot. (#18661)
Otherwise we might end up with a bot fight:

https://github.com/xamarin/xamarin-macios/issues/18598#issuecomment-1669416345
2023-08-08 17:02:58 +02:00
Manuel de la Pena 716e8baf63
[Generator] Ensure that selectors fields do not have overlapping names. Fixes #18645 (#18646) 2023-08-08 09:25:21 -04:00
Rolf Bjarne Kvinge 970a00e8ce
[mlaunch] Bump to a version that works with Xcode 15. (#18651) 2023-08-08 08:32:02 +02:00
Rolf Bjarne Kvinge bb15916902
[bgen] Use a response file when compiling code. (#18512)
This way we don't run into limitations on the command-line length.
2023-08-08 08:29:04 +02:00
Rolf Bjarne Kvinge dda440363e
[builds] Always download .NET. (#18649)
We always need to have a local .NET, because our T4 scripts are executed
using .NET (which is needed even if we're not building anyhing for .NET).
2023-08-08 07:14:07 +02:00
Rolf Bjarne Kvinge b17626ff1c
[msbuild] Re-aot referencing assemblies. Fixes #17708. (#18509)
If an assembly changes, then we must AOT compile that assembly again (which we already
did), in addition to any assembly that references the modified assembly (which we
didn't do).

So rework the AOTCompile target: remove the Inputs and Outputs (because the dependency
tracking is too complicated for MSBuild to resolve), and instead move the logic to
detect if an assembly must be AOT-compiled again into the AOTCompile task.

Note that this PR has a custom port to .NET 8: #18518.

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

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-08-07 20:19:30 +02:00
Rolf Bjarne Kvinge 6431e88772
[configure] Make 'macos' work like 'mac'. (#18627)
I can never remember which one is the right one, so just make them both
work.
2023-08-07 19:19:37 +02:00
Šimon Rozsíval 14f75f06dc
MSR: Generate additional constructors to reduce usage of reflection (#18529)
Closes #18357

This PR implements the idea described in the linked issue:

Whenever there's an NSObject constructor that we call from a registrar
callback, we need to create
a separate constructor that will first set the `handle` and `flags`
values of the NSObject before
calling the original constructor. Here's an example of the code we
generate:

```csharp
// The original constructor:
public .ctor (T0 p0, T1 p1, ...) { /* ... */ }

// The generated constructor with pre-initialization: 
public .ctor (T0 p0, T1 p1, ..., IntPtr handle, IManagedRegistrar dummy) {
    this.handle = (NativeHandle)handle;
    this.flags = 2; // Flags.NativeRef == 2
    this..ctor (p0, p1, ...);
}
```

- This code can't be expressed in C# and it can only be expressed
directly in IL.
- The reason we need to do this is because the base NSObject
parameterless constructor
  would allocate a new Objective-C object if `handle` is a zero pointer.
- The `IManagedRegistrar` type is added only to make the constructor
signature unique (IManagedRegistrar is not a public class and customers
can't use it in their apps directly)
2023-08-07 15:41:07 +02:00
Rolf Bjarne Kvinge 1e7e084fd1
[tests] If listing included platforms for .NET, don't include anything if .NET isn't enabled. (#18637) 2023-08-07 15:39:42 +02:00
Rolf Bjarne Kvinge 2a3dc56463
[HealthKit] Add nullability attributes to HKSampleQueryResultsHandler. Fixes #18622. (#18630)
Fixes https://github.com/xamarin/xamarin-macios/issues/18622.
2023-08-04 15:42:47 +02:00
Manuel de la Pena 2b84e260e1
[UIKit] Fix UIKit static method on TvOS (#18623)
This API was missed because the old sim intro tests are not running and
we missed it. This was found while working on xcode15. The tvOS attr is
missing which defaults to the min version of tvOS when it should be 15.

Added a compat implementation so that the API remains that will return
null.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-08-03 14:50:08 -04:00
Rolf Bjarne Kvinge 5ea3eb3592
[tools] Don't link with NewsstandKit if we're using Xcode 15+. (#18626)
Apple completely removed the NewsstandKit framework in Xode 15.

This effectively adds basic support for using Xcode 15 with .NET 7.

While this technically won't be a supported scenario, we have tests that
ensures .NET 7 apps can be built with .NET 8, and .NET 8 will ship with Xcode
15 support. This means that in order to make these tests work, we'll otherwise
have to have Xcode 14.3 installed both locally and on bots (in addition to
Xcode 15 of course), which is a rather big nightmare.

It's much easier to must try to make Xcode 15 work with .NET 7.
2023-08-03 16:10:16 +02:00
Rolf Bjarne Kvinge 82a5174643
[tools] Always link weakly with NewsstandKit. Fixes #18606. (#18621)
It seems that Apple will completely remove the NewsstandKit framework from iOS 17.

This poses a problem for existing apps that link with NewsstandKit: they will
crash at launch.

Solve this by always linking weakly with the NewsstandKit framework; this way
any apps that link with it will keep working if the framework ends up being
removed by Apple.

Fixes https://github.com/xamarin/xamarin-macios/issues/18606.
Fixes https://github.com/dotnet/maui/issues/16316.
2023-08-03 08:28:00 +02:00
Manuel de la Pena efd020c6c6
[UIKit] Fix UIKit selector on TvOS (#18617)
This API was missed because the old sim intro tests are not running and
we missed it. This was found while working on xcode15. The tvOS attr is
missing which defaults to the min version of tvOS when it should be 15.

Added a compat implementation so that the API remains.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-08-02 14:24:43 -04:00
Manuel de la Pena e4ed7e18bf
[Introspection] Fix intro skip when the properties are internal. (#18613) 2023-08-02 07:46:45 -04:00
Alexander Köplinger bfb8665d19
Convert XHarness.Tests from packages.config to PackageReference and add darc dependency (#18611)
Also needed a few tweaks to fix build errors that were introduced
recently.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2023-08-02 13:39:33 +02:00
Rolf Bjarne Kvinge 08b293760a
[StoreKit] Add a default SKCloudServiceController constructor. Fixes #18577. (#18608)
Using the default constructor is the doumented way to create an instance
of an SKCloudServiceController.

Fixes https://github.com/xamarin/xamarin-macios/issues/18577.
2023-08-02 12:56:41 +02:00
Manuel de la Pena c4c95b368b
[Tests] Use the correct nuget version on CI (#18610)
Similar to PR https://github.com/xamarin/xamarin-macios/pull/18600 we
need to use the same verison as the one found in the workload file in CI
and not that one from the make.config.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-08-01 23:51:19 -04:00
microsoft-github-policy-service[bot] 4e4d564ae2
FabricBot: Onboarding to GitOps.ResourceManagement because of FabricBot decommissioning (#18541)
Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement
as FabricBot replacement

Owners of the FabricBot configuration should have received email
notification. The same information contained in the email is published
internally at: https://aka.ms/gim/fabricbot. Details on the replacement
service and the syntax of the new yaml configuration file is available
publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html
2023-08-01 17:07:37 +02:00
Manuel de la Pena c129b7269a
[Xharness] Fix path to mlaunch when using mlaunch from a .NET SDK pack on CI. (#18600)
This commit fixes the code that was added in
https://github.com/xamarin/xamarin-macios/pull/16361.

The previous change uses the version number that is part of the config
file in the current build machine. That is correct when we are working
when we are running the tests in the same machine that built them. That
IS NOT THE CASE when building on CI.

Back when the CI did the separation to accommodate the EO we noticed
that if the workload is built in a diff machine, the versions were not
to be trusted, that is why the CI sets and enviroment variable to track
the version that was built in the original step. This change check if we
are on the CI, if we are we trust the version given by the previos
machine, else we use the config one.
2023-07-30 11:52:02 -04:00
Manuel de la Pena 6b1f9699ac
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 8130882 (#18574)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2023-07-28 16:31:58 -04:00
Manuel de la Pena 78f8985ac5
Update tests/xharness/Harness.cs 2023-07-28 12:50:37 -04:00
Manuel de la Pena a4972fd1bd Merge branch 'fix-mlaunch-location' of github.com:mandel-macaque/xamarin-macios into fix-mlaunch-location 2023-07-28 12:48:45 -04:00
Manuel de la Pena cc78a45eb6 Fix ompilation. 2023-07-28 12:45:21 -04:00
Manuel de la Pena 3a02f2b721
Update tests/xharness/Harness.cs
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
2023-07-28 11:32:18 -04:00
Manuel de la Pena 290206629a [Xharness] Fix path to mlaunch when using mlaunch from a .NET SDK pack on CI.
This commit fixes the code that was added in
https://github.com/xamarin/xamarin-macios/pull/16361.

The previous change uses the version number that is part of the config
file in the current build machine. That is correct when we are working
when we are running the tests in the same machine that built them. That
IS NOT THE CASE when building on CI.

Back when the CI did the separation to accommodate the EO we noticed
that if the workload is built in a diff machine, the versions were not
to be trusted, that is why the CI sets and enviroment variable to track
the version that was built in the original step. This change check if we
are on the CI, if we are we trust the version given by the previos
machine, else we use the config one.
2023-07-28 11:13:28 -04:00
Mauro Agnoletti 403d01749f
[dotnet][xma] Ensure we don't use DOTNET_ROOT and DOTNET_HOST_PATH in… (#18567)
… the Build Agent and remote tasks

DOTNET_ROOT and DOTNET_HOST_PATH are being deprecated as a mechanism to
store the location of dotnet. PATH will be used instead, so we should
ensure that the existing code that makes usage of these variables is
adapted to the new guidelines. More information:


f454d6960e

https://github.com/dotnet/runtime/issues/88754#issuecomment-1632957579

Additionally, to avoid confusion, we are using a dedicate
DOTNET_CUSTOM_PATH variable with the path of the dotnet used by the XMA
Build Agent, so it can be used internally by the tasks without mixing it
with the existing dotnet variables

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-07-26 20:01:42 -04:00
VS MobileTools Engineering Service 2 8d875fd3e9 Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 8130882 2023-07-23 05:05:23 -07:00
JonnHard d1d3dcdf68
Add getFileProviderConnectionWithCompletionHandler signature to start… (#18533)
… supporting XPC on File Provider instance

File Provider Service can act as an standalone XPC that you can
establish the connection with.
To open up the capability this new signature has to be exposed

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-07-20 10:39:08 -04:00
TJ Lambert fb147a155b
[Localization] Bring More Localization Changes (#18558)
Prior to changing to the new PAT to help with the automatization, we had
these lcl files waiting to be brought over. It's not clear if the new
PAT is fully working - we will need to wait until more translation codes
are added.
2023-07-17 11:13:46 -05:00
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
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