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

11983 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge aa2f7c33d1
[src] Add .NET project files. (#13018) 2021-10-19 08:12:32 +02:00
Rolf Bjarne Kvinge 9844acf3b1
[src] Adapt some code to work with both C#'s nint/nuint and our custom System.nint/System.nuint types (#13019)
* Add explicit casts to/from IntPtr and other specific types in a few places
  to avoid relying on implicit conversions (which aren't the same between C#'s
  nint/nuint and our System.nint/nuint types).
* Add Dlfcn.[Get|Set]UIntPtr to match the signed versions (for nuint).
2021-10-19 08:12:20 +02:00
Rolf Bjarne Kvinge 7b74a82724
[Runtime] Skip code to verify the Mono version in .NET for Xamarin.Mac. (#13020)
1. We're not using Mono for macOS in .NET.
2. Even if we were, we're not using a system mono anymore, which means we can't run
   into unexpected mono versions at runtime.
2021-10-19 08:11:57 +02:00
Rolf Bjarne Kvinge fc26c72b2a
[ObjCRuntime] Add nullability attributes to the Runtime class + numerous other code updates. (#13021)
Add nullability attributes to the Runtime class and fix the code accordingly.

This snowballed a bit, because it ended up requiring changes in multiple other
classes. While at it, I also updated the code to:

* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
* Use CFString.CreateNative/ReleaseNative instead of other means to create
  native strings (the fasets and least memory hungry option).
* Use 'nameof (parameter)' instead of string constants.
2021-10-19 08:11:45 +02:00
dotnet-maestro[bot] 313bc16bc7
[main] Update dependencies from dotnet/installer (#12987)
* Update dependencies from https://github.com/dotnet/installer build 20211014.1

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21512.45 -> To Version 6.0.100-rtm.21514.1

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21512.45 -> To Version 6.0.100-rtm.21514.70

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21512.45 -> To Version 6.0.100-rtm.21516.9

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21512.45 -> To Version 6.0.100-rtm.21516.10

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-10-18 09:22:40 +02:00
Rolf Bjarne Kvinge 6d065a7dcc
[tests] Minor fixes wrt executing packaged macOS tests. (#12982)
* Don't execute .NET tests in the 'legacy' targets (it's wasteful because
  we're already executing those .NET tests elsewhere).
* Fix reporting failures in the legacy tests.
2021-10-18 07:30:36 +02:00
Rolf Bjarne Kvinge 17641a8ccc
[VTFrameSilo] There's no reason to have a class-level GCHandle. (#12993)
The GCHandle created in ForEach is only needed for the duration of the method
call, and will be freed at the end of it.
2021-10-18 07:30:08 +02:00
Rolf Bjarne Kvinge 32d98535c7
[CFStream] Delay the creation of the GCHandle until we actually need it. (#12995) 2021-10-18 07:28:03 +02:00
Rolf Bjarne Kvinge 9d7e5eb4f6
[src] Remove dead code from the Class class. (#12996) 2021-10-18 07:27:53 +02:00
Rolf Bjarne Kvinge 56892d996d
[src] Rename MAC_* variables to MACOS_* variables. (#12998)
This makes it easier to iterate over the platforms we're building for, because
we can use "macOS" to compute the variable names we're interested in (like we
already can for iOS, tvOS, watchOS and MacCatalyst).
2021-10-18 07:24:37 +02:00
Rolf Bjarne Kvinge 2087a30476
[CGDataProvider] Subclass NativeObject + numerous other code updates (#12999)
* Subclass NativeObject to reuse object lifetime code.
* Merge the CGDataProvider-2.cs file into the CGDataProvider.cs file.
* Enable nullability and fix code accordingly.
* Use 'is' and 'is not' instead of '==' and '!=' for object identity.
2021-10-18 07:24:24 +02:00
Rolf Bjarne Kvinge cae4de3019
[ObjCRuntime] Make BaseWrapper subclass NativeObject + numerous other code updates (#13000)
* Subclass NativeObject to reuse object lifetime code.
* Enable nullability and fix code accordingly.
2021-10-18 07:22:08 +02:00
TJ Lambert 5819dc7a10
[ApiDiffs] Creating Api Diffs for the Dotnet Assemblies (#12886) 2021-10-15 12:04:35 -05:00
Rachel Kang eba62b59e9
Update based on feedback 2021-10-15 11:37:52 -04:00
Rachel Kang 5c07a90efd
Remove attributes 2021-10-14 12:17:22 -04:00
Rachel Kang 72dc7f5d01
[NetworkExtension] Updates for Catalyst 2021-10-14 12:11:10 -04:00
dotnet-maestro[bot] 30198fb245
Update dependencies from https://github.com/dotnet/installer build 20211012.45 (#12984)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21512.4 -> To Version 6.0.100-rtm.21512.45

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-10-14 07:53:12 +02:00
Rachel Kang 6041aad59b
[VideoToolbox] Updates for Catalyst 2021-10-13 16:40:09 -04:00
Rachel Kang cc9e213444
Remove Catalyst availability and deprecation 2021-10-13 09:44:48 -04:00
dotnet-maestro[bot] ed85420b58
Update dependencies from https://github.com/dotnet/installer build 20211012.4 (#12976)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21508.19 -> To Version 6.0.100-rtm.21512.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-10-13 08:27:21 +02:00
Rachel Kang a8b0c29cc2
[iTunesLibrary] Updates for MacCatalyst 2021-10-12 17:25:07 -04:00
Rachel Kang d657af6ba9
[ExecutionPolicy] Updates for MacCatalyst 2021-10-12 14:59:39 -04:00
Rachel Kang 6e43ee83f1
[MediaLibrary] Update MacCatalyst Support 2021-10-11 14:38:17 -04:00
Rolf Bjarne Kvinge 3c2c3d062d
[generator] Fix the return type for blocks returning a type we've bound as an INativeObject. (#12941)
* Create all INativeObject subclasses using 'Runtime.GetINativeObject<T>' instead
  of 'new T ()'. Although it's somewhat slower, it automatically handles any IntPtr.Zero
  handles, and it also makes the generator code simpler. If something turns out to
  be a performance problem, we can always add custom static creation methods (like
  some of the existing types already have).

* This makes it so that the zero pointer check logic in the generator isn't necessary
  anymore.

* The most important part is where we use IntPtr as the marshalling type for returned
  INativeObjects in blocks (instead of the INativeObject class - which doesn't make
  sense really, because I have no idea how that's marshalled).

Example:

```diff
diff --git a/build/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs b/build-new/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs
index 97e58f3a91b..8a40748de8b 100644
--- a/build/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs
+++ b/build-new/dotnet/ios/generated-sources/ObjCRuntime/Trampolines.g.cs
@@ -214,7 +214,7 @@ namespace ObjCRuntime {
    } /* class NIDAVAudioEngineManualRenderingBlock */
    [UnmanagedFunctionPointerAttribute (CallingConvention.Cdecl)]
    [UserDelegateType (typeof (global::AVFoundation.AVAudioIONodeInputBlock))]
-   internal delegate global::AudioToolbox.AudioBuffers DAVAudioIONodeInputBlock (IntPtr block, uint frameCount);
+   internal delegate IntPtr DAVAudioIONodeInputBlock (IntPtr block, uint frameCount);
    //
    // This class bridges native block invocations that call into C#
    //
@@ -223,11 +223,11 @@ namespace ObjCRuntime {
      [Preserve (Conditional = true)]
      [global::System.Diagnostics.CodeAnalysis.DynamicDependency ("Handler")]
      [MonoPInvokeCallback (typeof (DAVAudioIONodeInputBlock))]
-     static unsafe global::AudioToolbox.AudioBuffers Invoke (IntPtr block, uint frameCount) {
+     static unsafe IntPtr Invoke (IntPtr block, uint frameCount) {
        var descriptor = (BlockLiteral *) block;
        var del = (global::AVFoundation.AVAudioIONodeInputBlock) (descriptor->Target);
        AudioToolbox.AudioBuffers retval = del (frameCount);
-       return retval;
+       return retval.GetHandle ();
      }
    } /* class SDAVAudioIONodeInputBlock */
    internal sealed class NIDAVAudioIONodeInputBlock : TrampolineBlockBase {
@@ -249,7 +249,7 @@ namespace ObjCRuntime {
      [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
      unsafe global::AudioToolbox.AudioBuffers Invoke (uint frameCount)
      {
-       var ret = invoker (BlockPointer, frameCount);
+       var ret = Runtime.GetINativeObject<global::AudioToolbox.AudioBuffers> (invoker (BlockPointer, frameCount), false);
        return ret!;
      }
    } /* class NIDAVAudioIONodeInputBlock */
```
2021-10-11 19:13:17 +02:00
VS MobileTools Engineering Service 2 b1b4285109
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 5313177 (#12967) 2021-10-11 10:26:55 -05:00
Rolf Bjarne Kvinge 51ddcc4cd4
[CoreVideo/XKit] Add missing availability attributes. (#12963)
Fixes introspection on macOS 10.14.
2021-10-11 14:09:42 +02:00
dotnet-maestro[bot] e201828254
[main] Update dependencies from dotnet/installer (#12960)
* Update dependencies from https://github.com/dotnet/installer build 20211007.9

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21506.22 -> To Version 6.0.100-rtm.21507.9

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21506.22 -> To Version 6.0.100-rtm.21508.19

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-10-11 08:01:20 +02:00
Peter Collins c930ef845c
[dotnet/Templates] Add preview language (#12965)
Fixes: https://github.com/xamarin/xamarin-macios/issues/12955

Update the .NET 6 project templates to include "(Preview)" in the title
and include the "Mobile" classification where applicable. The phrase
".NET 6" has also been added to the description to help them stand out
from the regular Xamarin templates.
2021-10-11 08:00:01 +02:00
Rolf Bjarne Kvinge 7da7ab0c5b
[.NET/VideoToolbox] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the managed callbacks called from native code. (#12961)
Ref https://github.com/xamarin/xamarin-macios/issues/10470.
2021-10-11 07:52:29 +02:00
Rachel Kang f6b344946c
[PushKit] Update PushKit MacCatalyst (#12957) 2021-10-08 16:17:05 -04:00
Rolf Bjarne Kvinge 2930c052b3
[actions] Fix name of the dotnet-maestro bot. (#12959) 2021-10-08 16:32:42 +02:00
Rolf Bjarne Kvinge 4f613f4c9d
[xharness] Don't copy xharness.[css|js] to the output directory when they're already in the output directory. (#12958)
The problem is that cleaning the project would then remove these files, which
would break the next build.
2021-10-08 16:31:52 +02:00
dotnet-maestro[bot] cb475d8c8b
[main] Update dependencies from dotnet/installer (#12935)
* Update dependencies from https://github.com/dotnet/installer build 20211004.5

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21480.21 -> To Version 6.0.100-rtm.21504.5

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21480.21 -> To Version 6.0.100-rtm.21505.64

* [src] Bump bgen to .NET 6

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

Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.100-rtm.21480.21 -> To Version 6.0.100-rtm.21506.22

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-10-08 14:12:23 +02:00
Rolf Bjarne Kvinge 7339b27a43
[devops] Show a better message when ESRP fails (#12934)
* Show a better error in the GitHub comment if ESRP signing failed.
* Show a better message when supposedly signed packages fail signature validation.
2021-10-08 08:02:24 +02:00
Rolf Bjarne Kvinge 9f2ff42da5
[.NET/AudioUnit] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the ScheduledAudioFileRegionCallback function. (#12948)
Ref https://github.com/xamarin/xamarin-macios/issues/10470.
2021-10-08 07:58:22 +02:00
Rolf Bjarne Kvinge 7a46df3dbd
[.NET/CoreFoundation] Use [UnmanagedCallersOnly] instead of [MonoPInvokeCallback] for the CGPDFDictionaryApplyFunction function. (#12956)
I had to change the first argument from 'string' to 'IntPtr', because 'string'
isn't blittable. In order to diverge the code paths as little as possible, I
also made this change for the legacy Xamarin version.

Ref https://github.com/xamarin/xamarin-macios/issues/10470.
2021-10-08 07:53:43 +02:00
Rolf Bjarne Kvinge 6d8ef62705
[AVFoundation] Fix a few issues with AudioUnit. (#12954)
* Add an (IntPtr, bool) constructor so that AudioUnit works with Runtime.GetINativeObject.
* Keep track of ownership, so that AudioUnit doesn't free the native resources
  when it doesn't own them.
* Update a test to verify that calling 'AVAudioIONode.AudioUnit' multiple
  times and disposing the result between them works (this fails if AudioUnit
  doesn't keep track of ownership).
2021-10-08 07:52:40 +02:00
github-actions[bot] da9c95d604
[Localization] Pulling New Localization Translations 1304543339 (#12924) 2021-10-07 20:34:18 -05:00
Rolf Bjarne Kvinge b9de02c457
[introspection] Skip verifying the objc_msgSend[Super]_stret on all platforms. (#12939)
Now that macOS runs on ARM64 (and also the simulators soon), we need to have to same logic for all platforms.

Fixes:

    Introspection.iOSApiPInvokeTest
        [FAIL] Could not find the field 'objc_msgSend_stret' in /usr/lib/libobjc.dylib
        [FAIL] Could not find the field 'objc_msgSendSuper_stret' in /usr/lib/libobjc.dylib
        [FAIL] SymbolExists :   2 errors found in 5300 functions validated: objc_msgSend_stret, objc_msgSendSuper_stret
            Expected: 0
            But was:  2
                at Introspection.ApiPInvokeTest.SymbolExists() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/introspection/ApiPInvokeTest.cs:line 182
2021-10-07 20:15:54 +02:00
Rachel Kang 9ebf14e85b
Merge pull request #12936 from rachelkang/xcode13.0-appkit-b1-b2-b3-b4-b5
[AppKit] Update Xcode 13.0 bindings for betas 1,2,3,4,5
2021-10-07 13:14:59 -04:00
Manuel de la Pena ed3d9fd74c
[CI] Add empty insertion pipeline to be used in release. (#12888) 2021-10-07 11:54:54 -04:00
Rolf Bjarne Kvinge 694ec2d0b3
[tests] Ignore TemplateProjectTest.CreateAppBundleDependsOnTest when the specified platform isn't included in the build. (#12933) 2021-10-07 09:10:16 +02:00
Rolf Bjarne Kvinge 6b27debb63
[tests] Bump our generic min macOS version to 10.14 for .NET tests. (#12938)
Fixes this when running our test suites on macOS 10.14:

    dyld: Library not loaded: /System/Library/Frameworks/AuthenticationServices.framework/Versions/A/AuthenticationServices
      Referenced from: /Users/runner/work/1/s/artifacts/mac-test-package/tests/./introspection/dotnet/macOS/bin/Debug/net6.0-macos/osx-x64/introspection.app/Contents/MacOS/introspection
      Reason: image not found
    make[2]: *** [exec-mac-dotnet-x64-introspection] Abort trap: 6
2021-10-07 09:09:46 +02:00
Rolf Bjarne Kvinge 79b4c9234d
[msbuild] Rename ResolveFrameworksBase.cs to ResolveNativeReferencesBase.cs (#12943)
This way the filename matches the class within.
2021-10-07 08:18:16 +02:00
Rolf Bjarne Kvinge f12d09f405
[msbuild] Share the CompileEntitlements task implementation between iOS and macOS. (#12946) 2021-10-07 08:17:50 +02:00
Rolf Bjarne Kvinge 646443e019
[runtime] Set a min macOS version when compiling Objective-C source code for macOS. (#12942)
Fixes warnings such as these:

    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(coreclr-bridge-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(runtime-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(bindings-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(bindings-generated-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(xamarin-support-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(shared-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(trampolines-invoke-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(nsstring-localization-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(monotouch-main-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(trampolines-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(monotouch-debug-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
    ld: warning: object file ([...]/libxamarin-dotnet-coreclr-debug.a(trampolines-x86_64-dotnet-coreclr-debug.x86_64.o)) was built for newer macOS version (11.0) than being linked (10.15)
2021-10-07 08:14:38 +02:00
Manuel de la Pena d86d23fdf5
[CI] Fix path to script. (#12949) 2021-10-07 07:30:41 +02:00
Rolf Bjarne Kvinge 7a6c6fcf80
[devops] Return a non-zero exit code if tests fail on older macOS versions. (#12937)
Return a non-zero exit code if tests fail on older macOS versions, but keep
running tests. This way the step shows up as orange if something fails (and
not green, which is confusing).
2021-10-06 18:56:40 +02:00
Rolf Bjarne Kvinge afff63f04d
[tests] Fix make variables usage in template code. (#12940) 2021-10-06 18:54:27 +02:00
Rachel Kang 21db142e5f
Update based on feedback 2021-10-06 10:56:16 -04:00