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

13007 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 8f5c8b1685
Bump ObjectiveSharpie to 3.5.50. (#14256)
This also requires updating the xtro definitions, because sharpie now finds
many more Mac Catalyst frameworks than before (and we haven't bound those
frameworks yet).
2022-02-26 01:59:11 +01:00
Rolf Bjarne Kvinge 8ce2d33d09
[dotnet-linker] Improve the error message from the linker when we run into a problem. (#14253)
* Better text.
* Better number ("7000" is more like "this is kind of normal" - while "6999"
  was more like "something quite expected happened").
* Use resources to make it localizable.
2022-02-26 01:58:00 +01:00
Rolf Bjarne Kvinge fec9a29756
[tests] Remove ignore for test that has been fixed in .NET. (#14255) 2022-02-26 01:56:12 +01:00
Rolf Bjarne Kvinge 0c039226f7
[WebKit] Make the enums api definitions. (#14252)
This also allows us to remove the .NET-style availability attributes, because
the generator will generate them.
2022-02-25 19:12:07 +01:00
Rolf Bjarne Kvinge 4a18a67784
[src] Remove .NET-style availability attributes from API definitions. (#14251)
It's not necessary, the generator will generate the .NET-style attributes.
2022-02-25 17:08:52 +01:00
Rolf Bjarne Kvinge b746b04b2d
[xtro] Generate a proj file that contains variables for the current pch and assembly. (#14249)
Generate a proj file that contains variables for the current pch and assembly,
and include this proj file in the main xtro-sharpie project file. This way we
can use these variables for the pch and assembly arguments in the run
configurations, so we don't have to update the project file every time these
change (in particular the pch file changes name with every Xcode bump).
2022-02-25 17:03:01 +01:00
Rolf Bjarne Kvinge af2c68288c
[xtro] Add a makefile target to generate C# code for Mac Catalyst like we do for the other platforms. (#14250) 2022-02-25 17:02:49 +01:00
Rolf Bjarne Kvinge 681b45bd41
[monotouch-test] Fix the BaseEffectTest and EffectPropertyMaterialTest tests. (#14243)
The [Culture ("en")] attribute means: only run this test if the culture is
"en". This usually meant not running this test (apparently we don't run often
with culture = "en"), leading to outdated tests that happened to fail when
actually run under culture = "en" (such as on older macOS bots).

So change these tests to actually change the culture to "en" (by using the
SetCulture attribute), and also fix them.
2022-02-25 09:19:08 +01:00
Rolf Bjarne Kvinge 2a1f24f2cc
[CoreTelephony] Fix multiple issues. Fixes #13931. (#14242)
* Add to Mac Catalyst. Fixes #13931.
* Manually include CoreTelephony headers in xtro. There's no umbrella header
  in CoreTelephony 😡 😞
* Fix availability attributes
	* Only CTCall and CTCallCenter are deprecated in the CoreTelephony API.
	* None of these APIs are obsolete, just deprecated.
	* Add Mac Catalyst attributes.

One curious fact is that the PCSC framework interferes with compiling CTCarrer.h:

    In file included from /private/var/folders/43/h027tm1n101cdrq2_b6n9n2m0000gn/T/n0b0byrt.h:163:
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h:62:41: error: reference to 'BOOL' is ambiguous
    @property (nonatomic, readonly, assign) BOOL allowsVOIP __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
                                            ^
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/PCSC.framework/Headers/wintypes.h:59:18: note: candidate found by name lookup is 'BOOL'
            typedef int16_t BOOL;
                            ^
    /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/objc/./objc.h:78:18: note: candidate found by name lookup is 'BOOL'
        typedef bool BOOL;
                     ^
    1 error generated.

but since we don't bind the PCSC framework, we can just ask ObjectiveSharpie
to exclude it.

Fixes https://github.com/xamarin/xamarin-macios/issues/13931.
2022-02-24 23:41:52 +01:00
Rolf Bjarne Kvinge 3fb288ff5c
[Foundation] Remove NSUrlSessionHandler.TrustOverride in .NET. (#14214)
It's better to use the TrustOverrideForUrl property instead, which already exists.
2022-02-24 23:08:21 +01:00
Rolf Bjarne Kvinge 2f494665bc
[Network] Remove obsolete API from .NET. (#14211)
All the obsolete API has replacement API that works just fine.
2022-02-24 23:07:53 +01:00
Rolf Bjarne Kvinge b99e75d6ad
[Metal] Name the enum fields consistently, and obsolete/remove the rest. (#14240) 2022-02-24 23:00:26 +01:00
Rolf Bjarne Kvinge 1ad6af9ac7
[ModelIO] Remove MDLVoxxelArray API in iOS that don't exist in iOS for .NET. (#14239)
It looks like these were bound by mistake for iOS, so take the opportunity now
to remove these binding mistakes.
2022-02-24 22:59:27 +01:00
Rolf Bjarne Kvinge b1e8605826
[Metal] De-obsolete two MTLRenderCommandEncoder members. (#14238)
MTLRenderCommandEncoder.SetViewports and
MTLRenderCommandEncoder.SetScissorRects aren't deprecated/obsoleted anywhere as
far as I can tell, so unmark them as such.
2022-02-24 22:58:52 +01:00
Rolf Bjarne Kvinge 3ad499f4fc
[AVFoundation] Remove fields already bound better elsewhere in .NET. (#14237) 2022-02-24 22:58:19 +01:00
Rolf Bjarne Kvinge d414aa2eb1
[AVFoundation] Remove the AVAssetsDownloadTaskKeys and AVAssetDownloadOptions API in .NET for tvOS. (#14233)
These API were never valid for tvOS, and now we can completely remove them in .NET.
2022-02-24 22:58:01 +01:00
Rolf Bjarne Kvinge 83136c4507
[tests] Fix packaging mac tests by generating valid bash code for test.config. (#14236)
Fixes this failure:

    ++ DOTNET_CSC_COMMAND=/Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/dotnet
    ++ exec /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll
    test.config: line 22: /Users/builder/azdo/_work/1/s/xamarin-macios/builds/downloads/dotnet-sdk-6.0.300-preview.22118.1-osx-x64/sdk/6.0.300-preview.22118.1/Roslyn/bincore/csc.dll: Permission denied
    make[1]: *** [mac-test-package.zip] Error 1
    make: *** [package-tests] Error 2
2022-02-24 22:57:25 +01:00
Rolf Bjarne Kvinge e3424ae344
[CoreBluetooth] Remove fields already bound better elsewhere in .NET. (#14231) 2022-02-24 22:55:25 +01:00
Rolf Bjarne Kvinge 1b4a671215
[PassKit] Remove the PKErrorCode enum from .NET, it doesn't exist in the headers anymore. (#14230) 2022-02-24 22:54:52 +01:00
Rolf Bjarne Kvinge c589b4cf4e
[msbuild] Store the .NET version in the app's Info.plist when building an app using .NET. Fixes #14108. (#14215)
Also change the key for our Info.plist entry with the version number in .NET, and document the change.

We now use "com.microsoft.<platform in lower case>" instead of "com.xamarin.ios" (for all platforms).

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

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-24 20:44:42 +01:00
Rolf Bjarne Kvinge 027b8f0aae
[AppKit] Mark deprecated API as deprecated, not obsolete. (#14234)
These APIs are marked as deprecated in the headers (i.e. they still exist), so
mark them as such.
2022-02-24 19:00:49 +01:00
Rolf Bjarne Kvinge de93edc1f8
[CoreGraphics] Remove the CGColorConverterTransformType enum from .NET, it doesn't exist in the headers anymore. (#14229) 2022-02-24 19:00:13 +01:00
Rolf Bjarne Kvinge 159c99f570
[Foundation] Hide the LinkerSafe attribute in .NET, and remove it the next time we can do breaking changes. (#14220) 2022-02-24 18:52:00 +01:00
Rolf Bjarne Kvinge b770d1eae8
[CoreGraphics] Improve matrix types for .NET. Fixes #14125. (#14208)
Hoping that one day we'll have a System.Numerics.Matrix3x3 type we can replace our
RMatrix3 type with:

* Add all API in OpenTK.Matrix3 that also exists in equivalent form in System.Numerics.Matrix4x4.
* Remove all API that doesn't exist in equivalent form in System.Numerics.Matrix4x4.

For NMatrix2 and NMatrix3:

* Change the fields to be M## instead of R#C# (this is how System.Numerics does
  it, and also how we do it in other matrix types).
* Add obsolete and hidden R#C# versions of the fields to ease migrating existing
  code to .NET (but let's try to remove these in xamcore 5).
* Add properties in legacy Xamarin recommending users to use the new naming.
* A few other API additions to add equivalent API to the matrix types in System.Numerics.

For CGAffineMatrix:

* Add obsolete and hidden versions of the legacy field names to .NET to ease
  migrating existing (but let's try to remove these in xamcore 5).

Fixes https://github.com/xamarin/xamarin-macios/issues/14125.
2022-02-24 18:42:19 +01:00
Rolf Bjarne Kvinge 15c17ddece
[msbuild] Implement proper MSBuild logging in FileCopier. (#14176)
Fixes https://github.com/xamarin/xamarin-macios/issues/12422.
Fixes https://github.com/xamarin/xamarin-macios/issues/13697.
Fixes https://github.com/xamarin/xamarin-macios/issues/14157.
2022-02-24 16:51:49 +01:00
Rolf Bjarne Kvinge bd97933b60
[runtime] Remove ObjCRuntime.nfloat in favor of System.Runtime.InteropServices.NFloat. (#14197)
* Remove ObjCRuntime.nfloat (in favor of   System.Runtime.InteropServices.NFloat).
* Automatically add a reference to the System.Runtime.InteropServices.Internal
  package, so that developers get the new NFloat API (with operators) we've
  added post .NET 6 (but don't do this for .NET 7).
* Automatically add a global using alias for
  System.Runtime.InteropServices.NFloat -> nfloat. This is not behind the
  usual `ImplicitUsings` condition our other implicit usings are, because
  they're off by default for existing projects, and the main target for the
  global using alias for nfloat is upgraded projects.
* Automatically generate a global using alias (like above) in the generator
  for all code the generator compiles.
* Update xtro entries to reference System.Runtime.InteropServices.NFloat
  instead of ObjCRuntime.nfloat.
* Add a workaround for a hopefully temporary issue with .NET/CoreCLR where the
  wrong runtime pack is selected otherwise (without the new NFloat API, so
  nothing works at runtime).

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2022-02-24 16:51:12 +01:00
Rolf Bjarne Kvinge 3b617adb0f
[CloudKit] Remove API that no longer exists in the headers from .NET. (#14228) 2022-02-24 08:20:26 +01:00
Rolf Bjarne Kvinge 2c13696d8b
[VideoToolbox] Remove VTDecompressionSession.Create overload requiring manual reference counting. (#14218)
We already have a better overload that does not need manual reference counting.
2022-02-23 23:25:55 +01:00
Rolf Bjarne Kvinge d9a2e9d3b2
[CoreGraphics] Remove a CGPDFOperatorTable.SetCallback overload in .NET. (#14219)
Remove the CGPDFOperatorTable.SetCallback overload that takes a normal managed
delegate, because on platforms that are AOT'ed, this delegate must point to a
static function with the MonoPInvokeCallback attribute, and if you don't
follow this requirement, you'll either get an exception at runtime (which is
not very nice to the app developer) or make the AOT compiler crash (which is a
completely different level of not being nice to developers).

In .NET, we already have an overload that takes an unmanaged function pointer,
where these requirements are enforced by the C# compiler, so just use that
instead.
2022-02-23 23:24:40 +01:00
Rolf Bjarne Kvinge 3b655ec5ed
[src] Remove dead NET code inside !NET blocks. (#14227) 2022-02-23 23:22:36 +01:00
Rolf Bjarne Kvinge 20ceeae4c4
[Foundation] Hide obsolete NSString/NSArray API with CoreFoundation replacements. (#14212) 2022-02-23 23:21:46 +01:00
Sebastien Pouliot e82711f73e
[corefoundation] Optimize `CFString` creation (#12736)
* Add fast path if string is empty (`length == 0`)
* Add fast path (less allocations) for short string (`stackalloc`)
* Use `Marshal.AllocHGlobal`
	* we were the only consumer of `Marshal.AllocCoTaskMem` and `FreeCoTaskMem` (inside most apps) so those symbols can now be removed
	* `Marshal.AllocCoTaskMem` simply calls `AllocHGlobal` (with some extra casts) so it does not really have any other impact

* Add a few `CFString.FromHandle`` performance tests

To cover cases for

* `nil` which returns `null`
* `128` characters, which is the limit for `stackalloc`
* `129` characters, which is just over the limit for `stackalloc`

**Expectations**

* `empty` should be faster, since it now returns earlier
* `short_*` and `stackalloc_limit` should be a bit faster as they use `stackalloc`
* `allochglobal` and `long_string` should be (nearly) identical

**Before**

|              Method |             name |         Mean |       Error |     StdDev |
|-------------------- |----------------- |-------------:|------------:|-----------:|
| CFString_FromString |     allochglobal |   547.765 ns | 245.5782 ns | 13.4610 ns |
| CFString_FromString |            empty |   377.983 ns |   6.7926 ns |  0.3723 ns |
| CFString_FromString |      long_string | 5,480.664 ns | 264.9473 ns | 14.5227 ns |
| CFString_FromString |              nil |     4.848 ns |   0.0412 ns |  0.0023 ns |
| CFString_FromString |      short_7bits |   442.096 ns |  30.4907 ns |  1.6713 ns |
| CFString_FromString |     short_accent |   221.221 ns |   2.2069 ns |  0.1210 ns |
| CFString_FromString |      short_emoji |   221.870 ns |   2.4471 ns |  0.1341 ns |
| CFString_FromString |    short_unicode |   217.954 ns |   1.8771 ns |  0.1029 ns |
| CFString_FromString | stackalloc_limit |   484.019 ns |   6.3940 ns |  0.3505 ns |


**After**

|              Method |             name |         Mean |       Error |     StdDev |
|-------------------- |----------------- |-------------:|------------:|-----------:|
| CFString_FromString |     allochglobal |   554.028 ns | 317.1811 ns | 17.3858 ns |
| CFString_FromString |            empty |    95.442 ns |   7.6434 ns |  0.4190 ns |
| CFString_FromString |      long_string | 5,468.565 ns | 251.2252 ns | 13.7705 ns |
| CFString_FromString |              nil |     3.299 ns |   0.0229 ns |  0.0013 ns |
| CFString_FromString |      short_7bits |   352.567 ns |  25.7539 ns |  1.4117 ns |
| CFString_FromString |     short_accent |   221.132 ns |   0.9760 ns |  0.0535 ns |
| CFString_FromString |      short_emoji |   222.557 ns |   4.5978 ns |  0.2520 ns |
| CFString_FromString |    short_unicode |   216.375 ns |   5.1619 ns |  0.2829 ns |
| CFString_FromString | stackalloc_limit |   427.663 ns |  77.9610 ns |  4.2733 ns |
2022-02-23 20:49:10 +01:00
Sebastien Pouliot c918142101
[objcruntime] Fix some `IntPtr` -> `NativeHandle` inside `Class` (#14174)
* Using `NativeHandle` avoids implicit casts [1]
* Do not expose `IntPtr` as the type for the `SuperClass` handle

[1] likely not an issue with JIT/AOT optimization, less sure for the
interpreter. No harm in not having those in the product assembly.
2022-02-23 20:45:43 +01:00
Rolf Bjarne Kvinge c0074d0c79
[dotnet] Hardcode the version band instead of inferring it. (#14225) 2022-02-23 20:43:27 +01:00
TJ Lambert b2cc6d9c2e
[assetslibrary] Add nullability to (generated and manual) bindings (#14222)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-23 11:29:58 -06:00
github-actions[bot] 7af9f78ae4
[Localization] Pulling New Localization Translations 1877675209 (#14206)
* LEGO: Merge pull request 12848

LEGO: Merge pull request 12848

* LEGO: Merge pull request 12923

LEGO: Merge pull request 12923

* LEGO: Merge pull request 13022

LEGO: Merge pull request 13022

* LEGO: Merge pull request 13612

LEGO: Merge pull request 13612

* LEGO: Merge pull request 13638

LEGO: Merge pull request 13638

* LEGO: Merge pull request 14101

LEGO: Merge pull request 14101

* LEGO: check in for Localization to temporary branch.

Co-authored-by: csigs <csigs@users.noreply.github.com>
Co-authored-by: CSIGS <csigs@outlook.com>
2022-02-23 11:25:19 -06:00
Rolf Bjarne Kvinge 4fd770c3c4
[msbuild/generator] Pass .NET's C# compiler to bgen to use. Fixes #12922. (#14192)
We can't execute mono's C# compiler when using .NET, so we need to tell bgen
where csc is in that case.

Fixes https://github.com/xamarin/xamarin-macios/issues/12922.
2022-02-23 09:36:43 +01:00
Rolf Bjarne Kvinge 05398b5ff3
[src] Remove .NET availability attributes for files that are processed by the generator. (#14207) 2022-02-23 08:22:41 +01:00
Rolf Bjarne Kvinge 166f42b987
[dotnet] Name all templates as preview templates. (#14210)
All templates except one were named "... (Preview)".

Now the one outlier has joined the rest.
2022-02-23 08:19:23 +01:00
Rolf Bjarne Kvinge cff92006d5
[src] For .NET remove misc API that's either unusable or a an obsolete simple wrapper around other functional API. (#14209) 2022-02-23 08:19:08 +01:00
Rolf Bjarne Kvinge 101e3346c9
[UIKit] Hide the obsolete UIApplication.Main overload. (#14217)
Hide the obsolete UIApplication.Main overload that takes string parameters
from intellisense. This overload is used *a lot*, so it's not worth it to
remove it, since it would break a lot of user code.
2022-02-23 08:16:37 +01:00
Rolf Bjarne Kvinge 5acea1a41f
[runtime] Ask curl to fail (--fail) if fetching the URL fails for coreclrhost.h. (#14216)
This fixes an issue where the build would continue if the server in question
serves an error page (and eventually fail with weird errors because the error
page wouldn't be valid C code).
2022-02-23 08:10:51 +01:00
Sebastien Pouliot 868dad9bbd
Reduce string duplication in the platform assemblies (part 1) (#14191)
The size of unicode strings for the minimal MySingleView.app (.net
version) goes from 6315 to 5171 characters (each being 2 bytes).

Part of the work to solve/minimize https://github.com/xamarin/xamarin-macios/issues/14188

This also removes the recent `Console.WriteLine` and replace it
with a call to `NSLog` so `System.Console.dll` is not part of the
final app bundle (size regression).

Fixes https://github.com/xamarin/xamarin-macios/issues/14182
2022-02-22 16:39:45 +01:00
Rolf Bjarne Kvinge 66dcb94e1f
[AVFoundation] Simplify code behind + api definition for AVCaptureConnection. (#14199)
* Remove the code behind for AVCaptureConnection.SupportsVideoMinFrameDuration
  and AVCaptureConnection.SupportsVideoMaxFrameDuration. The codebehind looks like
  a workaround for Apple renaming the selector, but from history it looks like that
  happened before the earliest version of iOS we support today, so this can be expressed
  in an api definition now without any code behind.
* Add these fields to macOS, where they're not even deprecated (like they are on
  other platforms).
* Remove conditional code in api definition, and distribute [No*] attributes as
  required.
* Remove the AVCaptureConnection.AudioChannels property from .NET, it doesn't do
  anything useful.
2022-02-21 20:58:47 +01:00
Rolf Bjarne Kvinge 08f38b3f90
[AVFoundation] AVAudioUnitManufacturerNameApple and AVAudioUnitType aren't deprecated neither in headers nor documentation. (#14198) 2022-02-21 14:28:08 +01:00
TJ Lambert 188a35d879
[ApiDiffs] More renaming to enable ApiDiffs (#14187)
There was a large change to rename a lot of our Xamarin assemblies to Microsoft
ie) Xamarin.iOS -> Microsoft.iOS

There is a mismatch with some of the prerequisites in our tools/apidiff/Makefile where dependencies 
are looking for ...Microsoft.iOS... but they are still named ...Xamarin.iOS...

This PR takes any remaining "Xamarin" names and changes them to "Microsoft" for all dotnet related rules.
We will also change other dotnet rules to use the new naming convention of "macOS" and "tvOS"

The only exception is to the Xamarin.PLATFORM.dll's coming from the zip - those remain as Xamarin.iOS.dll

We should expect to see the gists showing up in ApiDiffs from this PR!

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-02-21 10:39:07 +01:00
Rolf Bjarne Kvinge 96c32e380e
[msbuild/dotnet] Make codesigning createdump work in universal apps. Fixes #14155. (#14196)
We don't sign each rid-specific bundle, but we sign the final merged app bundle instead.
This means that we must store the list of files to codesign from the rid-specific
build and load those lists before running codesign on the merged app bundle.

https://github.com/xamarin/xamarin-macios/issues/14155.
2022-02-21 08:24:09 +01:00
Rolf Bjarne Kvinge f83857638d
[tests/msbuild] Use full path to binlogs and executables. (#14195)
This way it's easier to copy-paste the path to the these files from terminal output
and open/run it (with a relative/partial path you'll need to know the current directory,
which is just an annoying thing to figure out sometimes).
2022-02-21 08:02:23 +01:00
dotnet-maestro[bot] 2d2650605a
Update dependencies from https://github.com/dotnet/installer build 20220218.1 (#14194)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.300-preview.22116.1 -> To Version 6.0.300-preview.22118.1

Dependency coherency updates

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-1.21519.4 -> To Version 6.0.200-1.22069.1 (parent: Microsoft.Dotnet.Sdk.Internal

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-02-21 07:58:44 +01:00
Rolf Bjarne Kvinge 74d947e72f
[CoreGraphics] Remove CGColorConversionInfo and CGColorConversionInfoTriple from .NET. (#14200)
These types aren't used anywhere in the exposed API, nor do they do anything
useful today.
2022-02-19 08:45:19 -05:00