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

15147 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge e0d64e8f61 [msbuild] Add props and targets files for Visual Basic.
These are just the C# versions changed just enough to use Visual Basic instead of C#.
2023-01-31 13:20:19 +01:00
Rolf Bjarne Kvinge eb7914cfc2 [tests] Update the .NET template tests.
* Make these tests be able to build Visual Basic templates.
* Add the new Visual Basic templates.
2023-01-31 13:01:46 +01:00
Rolf Bjarne Kvinge ecbdf18ec1 Add editorconfig entries for Visual Basic. 2023-01-31 13:14:46 +01:00
Rolf Bjarne Kvinge bd74a1c266 [dotnet] Copy localizations from C# templates to the Visual Basic templates. 2023-01-31 13:04:41 +01:00
Rolf Bjarne Kvinge 52850559fb [dotnet] Add templates for Visual Basic projects.
Add a Visual Basic templates for:

* All our platforms (iOS, tvOS, macOS and Mac Catalyst).
* A simple project (the ios, tvos, macos and maccatalyst templates).
* A class library property (the ioslib, tvoslib, macoslib and maccatalystlib templates).
2023-01-31 13:12:48 +01:00
Rolf Bjarne Kvinge 1130e1c472 [dotnet] Move templates around a bit to make room for more language-specific project templates. 2023-01-30 17:21:22 +01:00
dustin-wojciechowski 51bee958f0
Added GPSLatitudeRef and GPSLongitudeRef to CGImagePropertiesGPS. (#17166)
Fixes #17162

Added GPSLatitudeRef and GPSLongitudeRef to CGImagePropertiesGPS. 
Added new photo to all resources folders that has GPS data. 
Created new test that reads GPS information off a photo and verifies that it is correct.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2023-01-28 09:31:25 -08:00
Rolf Bjarne Kvinge 3f4ce6ca36
[generator] Remove redundant calls to PrintAttributes. (#17380)
The PrintAttributes method defaults to not printing anything, and when then
asked to not print platform attributes, it still adds up to doing nothing, so
just remove this redundant method call.
2023-01-27 08:32:15 +01:00
Rolf Bjarne Kvinge b654db9f2d
[tools] Fix MT1302 to show the correct path to the assembly. (#17362)
We used to show this:

> ILLINK warning MT1302: Could not extract the native library 'StaticLibrary.a' from '~/Downloads/BindingTest/obj/Debug/net7.0-ios/iossimulator-x64/linker-cache/StaticLibrary.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary').

now we show the assembly:

> ILLINK warning MT1302: Could not extract the native library 'StaticLibrary.a' from '~/Downloads/BindingTest/obj/Debug/net7.0-ios/iossimulator-x64/linker-cache/BindingLibrary.dll'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary').

Also increase diagnostics for this failure scenario to list all the resources
in the given assembly.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2023-01-26 17:01:41 +01:00
Rolf Bjarne Kvinge 41384c6af8
[tools] Add diagnostics when a native library turns off -dead_link support. (#17361)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2023-01-26 16:16:13 +01:00
Rolf Bjarne Kvinge e64bd31791
[Foundation] Add a 'None' option to NSKeyValueObservingOptions. (#17365)
It's a [Flags] enum, so it makes sense to have an option to have no flags.
2023-01-26 14:14:00 +01:00
Rolf Bjarne Kvinge 63abb2d419
[AVFoundation] Add a few missing APIs. Fixes #16954. (#17310)
Fixes https://github.com/xamarin/xamarin-macios/issues/16954.
2023-01-26 08:20:38 +01:00
Rolf Bjarne Kvinge 688fa45856
[tests] Improve the AttributeTest.FindSupportedOnElementsThatDoNotExistInThatAssembly cecil test. (#17367)
* Fix an issue where it would not compute the correct grouping key for each member,
  effectively grouping unrelated members together and coming up with weird and incorrect
  results.
* Make it match failures exactly, which makes it possible to detect (and report,
  which it now does) when a known failure is fixed.
* Ignore any hidden members (EditorBrowsableState.Never), because they're most
  likely mistakes.
* Ignore any members in AppKit and UIKit, because these namespaces have a lot of
  conflicting availability attributes. This is tracked in a separate bug (#17292).

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-01-25 20:55:28 +01:00
dotnet-maestro[bot] a7e5034767
[main] Update dependencies from dotnet/installer (#17370)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20230123.22
- **Date Produced**: January 24, 2023 3:32:06 AM UTC
- **Commit**: e36f7f3feaa561782a66165b8db55f4c0bbdf963
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.103-servicing.23067.22 to
7.0.103-servicing.23073.22][1]

[1]: 33d44bc...e36f7f3
2023-01-25 20:53:57 +01:00
Mauro Agnoletti 2a79c3dc1b
Updated Xamarin.Messaging to 1.9.5 (#17363)
This should bring the fix to correctly build iOS applications with references to class libraries

Ref: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1684986
2023-01-25 15:37:00 +01:00
Rolf Bjarne Kvinge 98819287cc
[runtime/generator] Add support for BindAs with CMVideoDimensions. (#17308)
This is required for some new iOS 16 APIs.
2023-01-25 15:34:28 +01:00
Rolf Bjarne Kvinge a57695bcf5
[generator] Fix property accessor attributes when one accessor's iOS availability is different than the property itself. (#17298)
This PR handles two scenarios (fixed in separate commits):

Scenario 1:

* The property has different availability attributes than the containing type.
* The property's accessor(s) do not have availability attributes.

We'd generate the wrong availability attributes for the property accessors,
because we'd take the type's availability attributes and add them to the
accessors.

As for the fix: I can't really explain it. This code is rather impenetrable,
and the parameter names don't make much sense, but whatever I did seems to
work?

And it turns out this fix shows up in an existing test as well (the
generator's Bug35176 test), which I had to modify to remove the expectation of
(now redundant) availability attributes that we no longer produce.

Scenario 2:

* Type is available on iOS, tvOS.
* Property in the type is available on iOS (and not tvOS).
* Property accessor has explicit availability attributes for iOS.

Then the property accessor would get the availability attribute for tvOS from
the type, and not the (un)availability attribute from the property.

The fix is to make sure the parent context is the property (and not the type)
when processing availability attributes for the accessor.
2023-01-25 09:27:58 +01:00
Rolf Bjarne Kvinge d27667f48a
[dotnet] Change the order of the linker steps. Fixes #17347. (#17360)
The bug manifests like this:

> Could not create an native instance of the type WindowsAzure.Messaging.SBNotificationHub: the native class hasn't been loaded.

which happens because the SBNotificationHub doesn't exist in the final
executable. We asked the linker to link with the static library containing
this type, but the linker didn't link with the library because it didn't need
any of the symbols in it.

We should have collected all the exported Objective-C types from this library
and asked the native linker to keep them, but that didn't happen because:

1. We collect bound Objective-C classes from binding libraries here (the
   ListExportedSymbolsStep): 608765e2c9/tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs (L148-L157)

2. That only happens for attributes with a LinkWith attribute.
	* We compute if an assembly has a LinkWith attribute here:
	  608765e2c9/tools/common/Assembly.cs (L266)
	* Which is called from here:
	  608765e2c9/tools/common/Assembly.cs (L198)
	* Which is called from here (the ExtractBindingLibrariesStep):
	  608765e2c9/tools/dotnet-linker/Steps/ExtractBindingLibrariesStep.cs (L18)

Now, we must obviously compute if an assembly has a LinkWith attribute before
doing anything that depends on that value, but we weren't doing things in that
order.

Changing the custom linker steps to run the ListExportedSymbols step *after*
the ExtractBindingLibrariesStep fixes this logic problem.

Fixes https://github.com/xamarin/xamarin-macios/issues/17347.
2023-01-25 08:59:56 +01:00
Rolf Bjarne Kvinge 40b98b650d
[CoreAnimation] Add missing CAMetalLayer properties. Fixes #17340. (#17345)
Also make CAEdrMetadata available on iOS and add a missing CAEdrMetadata
property.

Fixes https://github.com/xamarin/xamarin-macios/issues/17340.
2023-01-25 08:57:46 +01:00
Rolf Bjarne Kvinge 6af8da73af
[tools] Try to fix #xamarin/maccore@2637 by making sure a file's timestamp changes. (#17352)
Try to fix #xamarin/maccore@2637 by making sure a file's timestamp changes
after make runs the corresponding target.

Otherwise it seems make may run into some sort of infinite loop.

Fixes https://github.com/xamarin/maccore/issues/2637.
2023-01-25 08:56:56 +01:00
Manuel de la Pena 8be73c7b04
[AppKit] Add nullability to the manual code. (#17182)
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-01-24 16:45:56 -05:00
Steve Hawley ede46ed426
[dotnet] CoreFont delegates (#17338) 2023-01-24 15:43:24 -05:00
Rolf Bjarne Kvinge 608765e2c9 [Metal] Adjust conditional compilation directives to make sure some MTLRenderCommandEncoder API is available on the correct platforms. (#17307) 2023-01-24 14:22:39 +01:00
github-actions[bot] 8514c71596 [Localization] Pulling New Localization Translations $GITHUB_RUN_ID (#17342)
Automated PR. Bring new translated changes in the lcl files for
OneLocBuild to create translated resx files.

Co-authored-by: Alex Hsu <csigs@users.noreply.github.com>
Co-authored-by: CSIGS <csigs@outlook.com>
2023-01-24 14:22:37 +01:00
Rolf Bjarne Kvinge 9f0955be9c [HealthKit] Remove HKSeriesBuilder compliance of NSSecureCoding. (#17302)
There's no trace of this in the headers, so I assume it's something that
happened in a beta and then got removed, and we didn't notice to update our
bindings.
2023-01-24 14:22:36 +01:00
Rolf Bjarne Kvinge 86ee42a39d [tests] Bump the timeout to 10min for monotouch-test/xammac_tests on older macOS bots. (#17317)
I've started seeing more random network delays on these tests recently - which
the tests themselves handle, but the test run ends up taking much longer, and
we need to give the test run more time to finish.
2023-01-24 14:22:35 +01:00
dustin-wojciechowski 9c0bfd4e42 [src] Added manual binding to prevent issue of AVAudioPlayer FromData() and FromUrl() throwing exceptions. (#17073)
Provided manual binding of AVAudioPlayer::initWithContentsOfURL:error: and AVAudioPlayer::initWithData:error: to prevent an issue where AVAudioPlayer::FromData() and FromUrl() do not throw exceptions when returning null.

Fixes #16229

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-01-24 14:22:34 +01:00
Rolf Bjarne Kvinge bd158d9162 [NearbyInteraction] Remove NISession.SetARSession from Mac Catalyst. (#17300)
ARKit is in a weird spot on Mac Catalyst: it exists, but it doesn't do
anything. Since it doesn't actually work, we don't have bindings for ARKit.

This means that while the method '[NISession setARSession:]' technically
exists on Mac Catalyst, we can't bind it properly, since the type of the
parameter (ARSession) isn't available in our bindings for Mac Catalyst.

Due to how we hack around the lack of ARSession in our source code, we ended
up binding the method with an NSObject argument instead. This is still wrong,
so here I'm removing that method from the API.

But of course, removing that API is a breaking change, so until then the
method is obsoleted and hidden, and only removed in XAMCORE_5_0.

Also hide a few other obsoleted API in NISession, and remove those as well in
XAMCORE_5_0.
2023-01-24 14:22:33 +01:00
Rolf Bjarne Kvinge 9c57a3fab3 [MediaPlayer] Adjust availability attributes for MPMediaItem/MPMediaEntity. (#17305)
The API for MPMediaItem/MPMediaEntity varies wildly between platforms (for
historical reasons), so move availability attributes around a bit so that they
match reality a bit better: MPMediaEntity is not available on macOS, only
MPMediaItem is.
2023-01-24 14:22:32 +01:00
Rolf Bjarne Kvinge 3cbd86aba2 [AVFoundation] Adjust availability attributes according to conditional compilation directives. (#17311)
According to the compilation compilation directives, these APIs are not
available on tvOS nor macOS, so update the availability attributes
accordingly.
2023-01-24 14:22:31 +01:00
Rolf Bjarne Kvinge 41ae9626ee [Foundation] There's no reason to conditionally exclude code for macOS when the member has a NoMac attribute. (#17299)
This ensures that all platform assemblies know that the member doesn't exist
on macOS.
2023-01-24 14:22:28 +01:00
Rolf Bjarne Kvinge 91ac625192
[GameKit] Move availability attributes out of conditional code. (#17301)
So that all platforms know which other platforms the API is available on.
2023-01-20 08:09:34 +01:00
Rolf Bjarne Kvinge 4b7d672f6c
[Foundation] NSItemProvider is available on all platforms. (#17295) 2023-01-20 07:53:47 +01:00
Rolf Bjarne Kvinge 9016b2273f
[MetricKit] Add availability attributes to MXMetaData.DictionaryRepresentation. (#17294) 2023-01-20 07:52:20 +01:00
Rolf Bjarne Kvinge 6095fb3d0f
[AudioUnit] Adjust availability attributes according to conditional compilation directives. (#17309)
According to the compilation compilation directives, these two APIs are only
available on macOS, so update the availability attributes accordingly.
2023-01-20 07:48:26 +01:00
Rolf Bjarne Kvinge 137c6a49f1
[tests] Add makefile to run the generator tests in .NET mode. (#17296) 2023-01-19 16:40:42 +01:00
Rolf Bjarne Kvinge eae346af69
[Foundation] Hide NSTask.LaunchFromPath from intellisense for Mac Catalyst. (#17297)
Since it doesn't work anyway, there's no reason to show it.
2023-01-19 16:40:20 +01:00
github-actions[bot] 49ceaba587
[Localization] Pulling New Localization Translations $GITHUB_RUN_ID (#17304)
Automated PR. Bring new translated changes in the lcl files for
OneLocBuild to create translated resx files.

Co-authored-by: CSIGS <csigs@outlook.com>
2023-01-19 10:32:09 -05:00
Rolf Bjarne Kvinge 10accc2cd7
[dotnet/msbuild] Only compile entitlements once for universal builds. Fixes #15632. (#17096)
Fixes https://github.com/xamarin/xamarin-macios/issues/15632.
2023-01-19 16:01:34 +01:00
Rolf Bjarne Kvinge ec9db0e769
[AVFoundation/Intents/QuickLook] Don't add introduced attributes for a platform when the type itself isn't available on that platform. (#17293) 2023-01-19 15:45:05 +01:00
Rolf Bjarne Kvinge 3e83810910
[AudioUnit] Cleanup ifdefs in AUEnums. (#17267)
The ifdefs here were confusing, so I cleaned them up a bit.

Note that No* attributes in enum members won't prevent the enum members from
being generated, they'll just get an unavailable attribute, so adding No*
attributes to an enum member is not a breaking change (which allows for some
of this cleanup).

Contributes towards #14802.
2023-01-19 07:40:27 +01:00
Rolf Bjarne Kvinge 30cab5a5ae
[PushToTalk] Add missing Model attribute to the PTChannelManagerDelegate and PTChannelRestorationDelegate declarations. Fixes #16792. (#17273)
Fixes https://github.com/xamarin/xamarin-macios/issues/16792.
2023-01-19 07:39:45 +01:00
dotnet-maestro[bot] 10d4bb251e
[main] Update dependencies from dotnet/runtime (#17280)
This pull request updates the following dependencies

## From https://github.com/dotnet/runtime
- **Subscription**: 38d2313f-22d5-4062-c8e1-08dabd6d8c77
- **Build**: 20230117.6
- **Date Produced**: January 18, 2023 12:56:45 AM UTC
- **Commit**: 7db1c3333302d4d5ac97a5cfb28e88e5c2cde968
- **Branch**: refs/heads/release/7.0

- **Updates**:
  - **Microsoft.NETCore.App.Ref**: [from 7.0.3 to 7.0.3][1]

[1]: c8a73af...7db1c33
2023-01-18 21:38:56 +01:00
dotnet-maestro[bot] 4a1cfc3adf
[main] Update dependencies from dotnet/installer (#17277)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20230117.22
- **Date Produced**: January 18, 2023 2:09:01 AM UTC
- **Commit**: 33d44bcd2251c000f797df6cab241d0e8581e08d
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.103-servicing.23063.7 to
7.0.103-servicing.23067.22][1]

[1]: 4a2d55e...33d44bc
2023-01-18 20:16:48 +01:00
Rolf Bjarne Kvinge ddda284da5
[tools] Enable the PushToTalk framework in the simulator. (#17274)
Apple provides the headers to target PushToTalk (so using PushToTalk in code
builds just fine for the simulator in Xcode), but it doesn't work at runtime.

I believe it's better to allow the same thing in our bindings, for two reasons:

* Apple prints out a helpful error message at runtime, instead of our rather
  incomprehensible build error.
* Apple might implement simulator support in the future, in which case we
  won't need to do anything else.
2023-01-18 18:55:04 +01:00
Rolf Bjarne Kvinge b1957c91ce
[generator] Fix an issue with regards to attributes from inlined protocols. Fixes #17268. (#17269)
In the following scenario:

* Type T is not available on a platform (say tvOS).
* Protocol P is available on said platform.
* A member M of P has its own availability attribute for said platform (for
  instance if P is available on tvOS 11.0, and the member is available on tvOS
  12.0).
* The protocol P is inlined into the type T.

We'd include the SupportedOSPlatform attribute from the inlined member on
generated code on other platforms (so the iOS assembly would say that the
inlined member M in T is available on tvOS).

Fixes https://github.com/xamarin/xamarin-macios/issues/17268.
2023-01-18 18:54:15 +01:00
Rolf Bjarne Kvinge 49c3fd44f5
[fabricbot] Handle the 'need-repro' label. (#17272)
Handle the 'need-repro' label like the 'need-info' label:

* Add a comment that we need a repro, and how to get one.
* Close the issue if no comments within 7 days.
* Add a 'need-attention' label if reporter comments.

Also add a document explaining how to create a repro, modeled after (copied)
MAUI's document (https://github.com/dotnet/maui/blob/main/.github/repro.md).
2023-01-18 18:33:48 +01:00
Rolf Bjarne Kvinge f2cbd7657c
[fabricbot] Add bot rule to manage 'move-to-vs-feedback' issues (#17270)
New workflows:

1. When a `move-to-vs-feedback` label is applied to an issue, tell the
user to use the VS Feedback tool instead.
2. If issue is commented on within 3 days, mark as `needs-attention`.
3. If issue is inactive for 3 days, close the issue.

This is a shameless copy of
05c5e202a3.
2023-01-18 18:33:16 +01:00
Rolf Bjarne Kvinge 0fa793ee28
[StoreKit] Add missing setters to several StoreProductParameters properties. Fixes #16838. (#17275)
Fixes https://github.com/xamarin/xamarin-macios/issues/16838.
2023-01-18 18:32:57 +01:00
Rolf Bjarne Kvinge 75499e4253
Update DOWNLOADS.md with new releases. Fixes #16625. (#17271)
Fixes https://github.com/xamarin/xamarin-macios/issues/16625.
2023-01-18 18:25:01 +01:00