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

12416 Коммитов

Автор SHA1 Сообщение Дата
dotnet-maestro[bot] 0bbafbfe08
Update dependencies from https://github.com/dotnet/runtime build 20211216.2 (#13601)
Microsoft.NETCore.App.Ref
 From Version 6.0.1-mauipre.1.21602.7 -> To Version 6.0.1-mauipre.1.21616.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-12-20 08:24:02 +01:00
Rolf Bjarne Kvinge 3dd3c52503
[.NET/AudioSession] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the managed callbacks called from native code. (#13567)
Ref: https://github.com/xamarin/xamarin-macios/issues/10470.
2021-12-17 22:35:18 +01:00
Rolf Bjarne Kvinge 09f349b8ce
[generator] Fix reporting BI1042. (#13587)
Fix reporting BI1042 to include the type + property that triggered the error +
add a test.
2021-12-17 21:47:24 +01:00
Rolf Bjarne Kvinge bcbb6c8438
[src] Define XAMCORE_3_0 for .NET for all platforms. (#13566)
Also update xtro and tests accordingly.
2021-12-17 07:44:02 +01:00
Rolf Bjarne Kvinge bc2a5e2251
[xharness] Inline the dotnet-shared.csproj file as well when inlining shared imports. (#13514)
This fixes a problem where we'd build the same project reference from
dotnet-shared.csproj in parallel, and each build would stomp on eachother
(because we'll now clone the project references in dotnet-shared.csproj).

This als required updating project files to use MSBuildThisFileDirectory
instead of MSBuildProjectDirectory, which makes it easier for xharness to
inline/process these files, because MSBuildThisFileDirectory is easy to know
when processing a file, while MSBuildProjectDirectory depends on the calling
project, which complicates matters significantly.

A fix in MonoTouch.Dialog was also required.

New commits in migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@59fbf5b [dotnet] Shared project files don't need the DefaultTargets/ToolsVersion/xmlns attributes.

Diff: 4d0e0a9a5f..59fbf5bb1b

Fixes https://github.com/xamarin/maccore/issues/2527.
2021-12-16 19:01:39 +01:00
Rolf Bjarne Kvinge 32b112bad9
[tests] Shutdown build servers when rebuilding. (#13581)
This makes sure that MSBuild picks up rebuilt task assemblies.
2021-12-16 17:40:12 +01:00
dotnet-maestro[bot] 298c8089e8
[main] Update dependencies from dotnet/installer (#13561)
This pull request updates the following dependencies

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

- **Subscription**: 9d0987bd-c9b3-4f3a-a267-08d9ba6248b0
- **Build**: 20211215.3
- **Date Produced**: December 15, 2021 9:16:41 PM UTC
- **Commit**: 2dc0c5a0c9e30b861916e288676dc81d09ec9454
- **Branch**: refs/heads/release/6.0.2xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 6.0.102-servicing.21609.9 to 6.0.200-preview.21614.17][3]

[3]: 65bbb44...0ce201e

---

# .net ChangeLog for https://github.com/xamarin/xamarin-macios/pull/13561
## Level 1
* https://github.com/dotnet/installer [65bbb44...0ce201e](65bbb444f8...0ce201ed68)

## Level 2
* https://github.com/dotnet/templating [7d94161...7c35333](7d94161304...7c35333b66)
* https://github.com/dotnet/sdk [2c798cb...4a935da](2c798cbf6b...4a935da067)
* https://github.com/dotnet/fsharp [6d626ff...c12acdb](6d626ff075...c12acdbfa5)
* https://github.com/microsoft/vstest [68bd10d...a809880](68bd10d3ae...a809880e02)
* https://github.com/dotnet/roslyn [c7d6f9f...8183134](c7d6f9fab8...8183134263)
* https://github.com/dotnet/msbuild [c9eb9dd...96a618c](c9eb9dd64e...96a618ca59)
* https://github.com/nuget/nuget.client [078701b...9187a50](078701b97e...9187a50dae)
* https://github.com/dotnet/arcade [ee9b7f1...7421b55](ee9b7f1985...7421b55f46)
* https://github.com/dotnet/source-build-reference-packages [897a970...9c7c56c](897a9709eb...9c7c56c010)

Generated using https://github.com/spouliot/dotnet-tools/tree/master/changelog

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-16 17:35:17 +01:00
Rolf Bjarne Kvinge a26d78c842
[AppKit] NSFontPanelMode and NSAlertButtonReturn are defined as NS[U]Integer, so keep these as such in .NET. (#13584) 2021-12-16 17:02:28 +01:00
Rolf Bjarne Kvinge f4fa54d4d2
[AppKit] NSOpenGLProfile is an untyped enum, so make it non-native in .NET. (#13585) 2021-12-16 17:01:51 +01:00
TJ Lambert c4e3ab85c2
[Dotnet] Fix building twice in a row issue (#13573) 2021-12-16 09:07:47 -06:00
Rolf Bjarne Kvinge 40905dd1f7
[msbuild/dotnet] Add a FilterStaticFramework task to filter out frameworks of static libraries from frameworks we copy to the app bundle. (#13551)
A later PR will include a test case for this.
2021-12-16 07:41:53 +01:00
Rolf Bjarne Kvinge c6efb26432
[AppKit] Make sure NSFunctionKey doesn't come into Mac Catalyst in .NET. (#13582)
If NSFunctionKey isn't in Mac Catalyst in legacy Xamarin, it shouldn't be in
.NET either, so adjust the conditional logic accordingly.

Also make the NSFunctionKey enum a non-native enum in .NET, like it's in the
headers.
2021-12-16 07:40:58 +01:00
Chris Hamons 4cf12e3623
[msbuild] Teach _StripAssemblyIL task to support inputs with duplicate file names but different paths (#13571)
- Fixes https://github.com/xamarin/xamarin-macios/issues/13526
- F#, along with some other cases, have files to publish that have the same filename but different folder
- The most obvious example being resources assemblies: cs/FSharp.Core.resources.dll vs de/FSharp.Core.resources.dll
- I naively copied all files into one directory ignoring path, which does not work here at all
- DestinationSubPath seems to be set unconditionally by ResolvePackageAssets but #msbuild suggested not assuming it was always there (0fc72ddb75/src/Tasks/Common/ItemUtilities.cs (L126-L128))
- So use DestinationSubPath when it is around, else fall back to the old Filename + Extension
- Since there are now subdirectories inside stripped folder, extend MakeDir to cover all file's Directory path
- Tested by hand with FSharpiOSCoolApp (.NET), I can extend an auto test if desired
2021-12-15 16:35:41 -06:00
Rolf Bjarne Kvinge b169c806fc
[dotnet] Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst. Fixes #10312. (#13562)
Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst, because they don't
apply for a Mac Catalyst app (which is neither a simulator environment, nor a
device environment).

This means that code using these APIs will have to be re-evaluated to
determine what's the correct behavior for Mac Catalyst.

Also update our tests accordingly.

Fixes https://github.com/xamarin/xamarin-macios/issues/10312.
2021-12-15 22:32:14 +01:00
Rolf Bjarne Kvinge 30f7ba83f6
Bump mono. (#13574)
New commits in mono/mono:

* mono/mono@b8d7525156 [2020-02] [cominterop] Add coop handle enter/return on native CCW methods
* mono/mono@2ca650f1f6 [2020-02] Adds full path to libcairo for correct assembly directory resolution in monterey
* mono/mono@e750cb3ee5 [aot] Prepend the assembly name to the names of gsharedvt wrappers to avoid duplicate symbol errors during static linking.
* mono/mono@b32801a63c Remove NuGet.config
* mono/mono@dfcef74640 Allow nfloat to be in the ObjCRuntime namespace, and make it work for Xamarin.MacCatalyst.dll as well.
* mono/mono@5ce143a1a8 Revert "[2020-02] Start a dedicated thread for MERP crash reporting (mono/mono#21126)"

Diff: 4150e65c9e..b8d7525156
2021-12-15 20:53:08 +01:00
Rolf Bjarne Kvinge b0b768ff57
[Foundation] Fix return type for NSUrlSessionHandler.AutomaticDecompression. Fixes #13576. (#13577)
This was probably a c&p error.

Fixes https://github.com/xamarin/xamarin-macios/issues/13576.
2021-12-15 20:49:58 +01:00
Manuel de la Pena 3f43eef35b
[CI] Add missing env. (#13570) 2021-12-15 08:55:01 -05:00
Rolf Bjarne Kvinge 69015b3cec
[dotnet] Honor 'TrimMode' to specify linker behavior if LinkMode/MtouchLink aren't set. Fixes #13518. (#13543)
* Change dotnet-linker to only care about whether we're actually trimming anything or not.
* Allow LinkMde/MtouchLink to not be set if TrimMode is set.
* Detect if any assemblies are linked or not by checking the global TrimMode
  property + any TrimMode properties on assemblies.

Fixes https://github.com/xamarin/xamarin-macios/issues/13518.
2021-12-15 09:27:00 +01:00
Rolf Bjarne Kvinge 8dc6e129bb
[VTCompressionSession] Enable nullability + a few other code updates (#13565)
* Remove unnecessary destructor and Dispose method.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Use the null-safe NativeObjectExtensions.GetHandle extension method to get
  the handle instead of checking for null (avoids some code duplication).
* Call 'GetCheckedHandle ()' (which will throw an ObjectDisposedException if
  Handle == IntPtr.Zero) instead of manually checking for IntPtr.Zero and
  throwing ObjectDisposedException.
* Simplify some block code.
2021-12-15 09:25:59 +01:00
Rolf Bjarne Kvinge c158f83a93
[VTUtilities] Enable nullability + a few other code updates. (#13568)
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use 'nameof (parameter)' instead of string constants.
* Use 'GetCheckedHandle' to check for disposed objects instead of doing it
  manually.
2021-12-15 09:25:16 +01:00
Marek Safar 462d6286c5
Include recently two more feature switches (#13532)
NullabilityInfoContextSupport - saves a lot by trimming all C# compiler generated nullable information
BuiltInComInteropSupport - no COM support on iOS
2021-12-15 08:17:37 +01:00
TJ Lambert b72ef031f7
[ApiDiff] Add Current PR Diffs in a similar style as API Diffs (#13512) 2021-12-14 22:19:36 -06:00
Manuel de la Pena 06bacc24a4
[CI] Allow to force a build to be usable for insertions. (#13563)
This change allows to have a parameter (false by default) that allows to
get a build to be able to do an insertion even when it is comming from a
not predefined branch.

Uses cases:

1. Trigger a buiild with no tests from a special branch to insert.
2. Work with the CI to test the deployment.
2021-12-14 18:08:59 -05:00
Manuel de la Pena 5c68aca748
[CI] Rearrange the parameters so that we have all booleans grouped. (#13564)
The UI uses the order in which the parmaeters are found in the file,
which makes it look ugly because it adds a text bos ni between all
options.
2021-12-14 17:19:33 -05:00
Rolf Bjarne Kvinge 342b312a73
Our current behavior is to detect any None, BundleResource or Content item that's (#13550)
named 'Info.plist', and assume that's the app manifest.

That doesn't quite work when we end up with multiple 'Info.plist' entries in any
of those item groups (one example being a framework as a BundleResource - all frameworks
have an Info.plist, and there's no good way to distinguish what the developer's intention
was).

So:

1. Implement a 'AppManifestDetectionEnabled' property to disable automatic app manifest
   detection.

2. Add a public 'AppBundleManifest' property that specifies the app manifest
   (this is just a renamed version of our previously private '_AppManifest' property).

This makes it possible for app developers to:

* Disable automatic app manifest detection.
* Still have an app manifest by specifying it manually.
* Disable automatic app manifest detection, but also not specify an app manifest
  manually (so no custom app manifest at all).

Also:

* Rename '_AppBundleManifest' to '_AppBundleManifestPath' to make it less confusing
  with the new 'AppBundleManifest' property.
2021-12-14 20:56:52 +01:00
Rolf Bjarne Kvinge bb2572fba5
[tests] Remove workaround for an objc_msgSend bug that's been fixed for a while. (#13556)
We're not executing anywhere where this bug is present anymore.
2021-12-14 17:07:14 +01:00
Rolf Bjarne Kvinge 0bd6cf095c
[tests] Remove a few Assert.Inconclusive calls that won't be executed anymore. (#13557)
Don't conditionally ignore tests that fail on Snow Leopard (or earlier),
because we're always executing on a later OS now.
2021-12-14 17:06:09 +01:00
Rolf Bjarne Kvinge 6fe346e004
[tests] Remove some dead code. (#13558) 2021-12-14 17:05:53 +01:00
Rolf Bjarne Kvinge 61bf0a804b
[tests] Remove a few useless Assert.Inconclusive calls at the end of test methods. (#13559)
There's no reason to call Assert.Inconclusive at the end up a test method,
because we won't get that far in the test method if it fails.
2021-12-14 17:05:18 +01:00
Rolf Bjarne Kvinge 0e4392624e
[.NET/AppKit] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the managed callbacks called from native code. (#13554)
Ref: https://github.com/xamarin/xamarin-macios/issues/10470.
2021-12-14 17:04:52 +01:00
Rolf Bjarne Kvinge ed1c769017
[tests] Remove dead code from test that's already ignored (#13555) 2021-12-14 17:04:17 +01:00
Manuel de la Pena bffe61eec2
[CI] Fix indentation mistake that made timeouts result in errors. (#13552) 2021-12-14 09:27:40 -05:00
Manuel de la Pena 97ca13a358
[CI] Do not use the ciBuild tag for cronjobs. (#13553)
The tag is used by the release pipeline to indentify builds that we can
release from. This will ensure we do not get releases from the cronjobs.
2021-12-14 09:27:18 -05:00
Rolf Bjarne Kvinge a93d76304e
[src] Modify some logic for Mac Catalyst that tests the current runtime architecture (Runtime.Arch) to behave like macOS instead (which doesn't check Runtime.Arch). (#13536) 2021-12-14 08:26:14 +01:00
Rolf Bjarne Kvinge 7b753916d8
[dotnet-linker] We must store the availability attributes when linking. (#13547)
We must store the availability attributes when linking, so that the registrar
can access them when the linker is done linking the app.

Fixes this test failure:

* Xamarin.Registrar.MT4162_dotnet(iOS,"iOS",LinkAll)

Ref: https://github.com/xamarin/xamarin-macios/issues/13517
2021-12-14 08:20:05 +01:00
Rolf Bjarne Kvinge ce7e49d9df
[dotnet-linker] Touch the build output to avoid make confusion. (#13549)
Make gets confused sometimes if running a rule doesn't update the timestamp of
the target of those rules (and make may in certain cases end up with an
infinite loop).

Avoid this by making sure to always update the timestamp of the
dotnet-linker.dll we build, even if MSBuild decides no re-compilation was
necessary.
2021-12-14 08:19:41 +01:00
Rolf Bjarne Kvinge c708eba312
[runtime] Make sure dlls come before exes in TRUSTED_PLATFORM_ASSEMBLIES. (#13545)
This works around dotnet/runtime's https://github.com/dotnet/runtime/issues/62735.
2021-12-14 08:18:47 +01:00
Rolf Bjarne Kvinge f348e045a1
[AVFoundation] Fix typo in attribute name and add missing availability attributes. (#13548) 2021-12-14 08:11:23 +01:00
Rolf Bjarne Kvinge d0f33c7931
[msbuild] Fix merging of apps with symlinks to directories. (#13546)
Symlinks to directories are treated the same as other symlinks (as files), not
as directories. This way we don't end up re-creating a directory hierarchy
when we only have to create a symlink.
2021-12-14 08:10:23 +01:00
Rolf Bjarne Kvinge 2f33f5b020
[CFNetworkHandler] Only use public API to set cookies in CookieContainers. Fixes #8072. (#13535)
https://github.com/xamarin/xamarin-macios/issues/8072
2021-12-14 08:08:02 +01:00
Rolf Bjarne Kvinge c85d7721d5
[dotnet] Pass -dead_strip to the native linker when we can. (#13541)
Pass -dead_strip to the native linker like we do for legacy Xamarin:

* If there are no custom linker arguments.
* If all third-party bindings in the app has SmartLink = true (this doesn't
  show up in the PR, but the logic exists for legacy Xamarin and is already
  executed for .NET, the resulting Application.DeadStrip value just wasn't
  taken into account).

This shrinks the app size a bot for a Hello World app:

* Before:     10.659.731 (https://gist.github.com/rolfbjarne/b5892a5c7fb8663d38e2b69f67bce90c)
* After:       9.940.240 (https://gist.github.com/rolfbjarne/8404394180fb9971bd2f1475b747c70a)
* Difference:   -719.491 (-6.7 %)
2021-12-13 20:41:43 +01:00
Rolf Bjarne Kvinge c93cd3a99c
[Metal] Usher the Metal API into the golden age of .NET. (#13533)
* Change all XAMCORE_4_0 conditions to NET conditions.
* Add numerous Release attributes that xtro started complaining about.
* Misc other minor API changes/updates.
2021-12-13 20:40:29 +01:00
dotnet-maestro[bot] afe1b85031
[main] Update dependencies from dotnet/installer (#13505)
* Update dependencies from https://github.com/dotnet/installer build 20211206.5

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.101-servicing.21606.5

* Update dependencies from https://github.com/dotnet/installer build 20211207.22

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.102-servicing.21607.22

* Update dependencies from https://github.com/dotnet/installer build 20211208.3

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.102-servicing.21608.3

* Update dependencies from https://github.com/dotnet/installer build 20211209.9

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.101-servicing.21567.21 -> To Version 6.0.102-servicing.21609.9

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-12-13 15:42:49 +01:00
Rolf Bjarne Kvinge b8e9c61409
[dotnet] Parse the -gcc_flags and -link_flags mtouch/mmp arguments and pass them to the native linker. (#13521) 2021-12-13 08:33:26 +01:00
Rolf Bjarne Kvinge bc65a52227
[CoreMidi] Fix detecting whether MIDIPacket needs alignment for macOS and Mac Catalyst on ARM64. (#13534) 2021-12-13 08:31:11 +01:00
Manuel de la Pena bf26c64e72
[CI] Add missing import directive. (#13537) 2021-12-11 14:25:24 -05:00
Manuel de la Pena dee9381b4b
Revert "[CI] Use Build artifacts so that they are copied to the release pipeline. (#13501)" (#13538)
This reverts commit 3977d7531d.
2021-12-11 14:25:14 -05:00
Rolf Bjarne Kvinge e5ace3d345
[generator] Generate the same invoke code for Mac Catalyst like we already do for macOS. (#13513)
This makes the generated code much smaller, and also avoids calling Runtime.Arch for Mac Catalyst.

Also don't generate a dual arch-specific call unless needed (this makes the generated code *much* smaller).
2021-12-10 17:36:55 +01:00
Manuel de la Pena 9a07446244
[CI] Add a better comment when we add code in the static page. (#13528) 2021-12-10 08:25:09 +01:00
Manuel de la Pena 5c4db77a15
[CI] Increase timeouts so that we do not have failures. (#13529)
We have added more files and the API seems to take long sometimes,
increase the timeouts to avoid failures like in https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=5532523&view=logs&j=704af8c3-a112-593d-cee6-636e1ea22709&t=62b5d5ee-dc4f-530c-7279-a3bef6bd6bc7
2021-12-10 08:24:42 +01:00