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

15101 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 5844f64ffc
[Foundation] Share custom constructor code between iOS and macOS for NSAttributedString. (#16880)
This also makes the set of constructors for NSAttributedString identical
between all platforms.

Ref: https://github.com/xamarin/xamarin-macios/issues/14489
2022-11-29 08:56:49 +01:00
Rolf Bjarne Kvinge 2c001cac1c
[tools] Exclude Driver.Concurrency from .NET. (#16898)
Fixes this compiler warning:

    tools/common/Driver.cs(302,14): warning CS0649: Field 'Driver.Jobs' is never assigned to, and will always have its default value 0
2022-11-29 08:35:02 +01:00
Mauro Agnoletti fddd44b4f7
Updated Xamarin.Messaging to 1.8.49 (#16899)
We need this for 17.5 Preview 2 so feel free to backport it to the needed branches
2022-11-29 07:51:32 +01:00
Haritha Mohan 51afd316cc
[tests] Ensure proper capitalization in API (#16840)
Use reflection to detect incorrectly capitalized public methods, fields,
properties, and events.
Fixes #15733

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-11-28 12:11:27 -08:00
Rolf Bjarne Kvinge ff585dca2d
[tests] Move code to avoid unreachable code warning. (#16876)
Fixes this warning:

> xamarin-macios/tests/common/TestRuntime.cs(1321,4): warning CS0162: Unreachable code detected
2022-11-28 18:18:11 +01:00
Rolf Bjarne Kvinge d627b203eb
[tests] Create a shared AppDelegate class and use it everywhere. (#16877)
Create a shared AppDelegate class, which contains all the identical
AppDelegate code for all test projects. This reduces a lot of code duplication.
2022-11-28 18:17:49 +01:00
Rolf Bjarne Kvinge 712d84c18b
[xharness] Use a different identifier than '%...%' for replacement text. (#16878)
When the autoformatter runs into the '%...%' pattern in *.cs files, it
will re-format the text (to '% ... %'), but that breaks our text replacement
logic. So instead use a valid C# identifier as a replacement token, in which
case the autoformatter won't confuse our replacement logic.
2022-11-28 18:17:23 +01:00
Rolf Bjarne Kvinge e9e56473c4
[Foundation] Remove some conditional logic from NSAttributedString's API definition. (#16882)
This simplifies the code a little bit.

Ref: https://github.com/xamarin/xamarin-macios/issues/14489
2022-11-28 18:08:10 +01:00
Rolf Bjarne Kvinge 7af808fa46
[Foundation] Merge multiple partial NSAttributedString definitions. (#16889)
It just ends up being confusing and difficult to get a full picture of the type's
API definition if it's spread over multiple places.

Ref: https://github.com/xamarin/xamarin-macios/issues/14489
2022-11-28 18:07:11 +01:00
Rolf Bjarne Kvinge 5957b98085
[ObjCRuntime] Fix double dots in exception message. (#16890)
Don't add a dot after showing another exception message, because that another
exception message might also add a dot.

Example:

> An exception occurred while trying to invoke the function System.Void VisualStudioMac.AppDelegate.DidFinishLaunching (Foundation.NSNotification): Object of type 'CoreLocation.CLLocationManager' cannot be converted to type 'Foundation.NSNotification'..
2022-11-28 18:04:06 +01:00
Rolf Bjarne Kvinge e7653c5cde
[tests] Adjust the NoAvailabilityOnError cecil test to look in and work with .NET assemblies as well. (#16891)
Also remove some unnecessary null-checking code.
2022-11-28 18:03:47 +01:00
dependabot[bot] 52e3e2f4ee
Bump peterjgrainger/action-create-branch from 2.2.0 to 2.3.0 (#16895)
Bumps
[peterjgrainger/action-create-branch](https://github.com/peterjgrainger/action-create-branch)
from 2.2.0 to 2.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/peterjgrainger/action-create-branch/releases">peterjgrainger/action-create-branch's
releases</a>.</em></p>
<blockquote>
<h2>v2.3.0</h2>
<p>From <a
href="https://github-redirect.dependabot.com/peterjgrainger/action-create-branch/issues/356">#356</a>
update to version <code>16</code> of node and set
<code>BRANCH_CREATED</code> environment variable instead of
<code>set-output</code></p>
<p>I've left set output there so others can update their action but
added a warning not to use the output any longer.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="64aa569aea"><code>64aa569</code></a>
deprecate set output</li>
<li><a
href="4db6058d3c"><code>4db6058</code></a>
upgrade node version</li>
<li><a
href="9b788a6dcc"><code>9b788a6</code></a>
added some explanation about the branch name</li>
<li><a
href="98f5309f9a"><code>98f5309</code></a>
Update readme</li>
<li>See full diff in <a
href="https://github.com/peterjgrainger/action-create-branch/compare/v2.2.0...v2.3.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peterjgrainger/action-create-branch&package-manager=github_actions&previous-version=2.2.0&new-version=2.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 10:38:56 -05:00
dotnet-maestro[bot] dff5ff3769
[main] Update dependencies from dotnet/runtime (#16885)
This pull request updates the following dependencies

## From https://github.com/dotnet/runtime
- **Subscription**: 38d2313f-22d5-4062-c8e1-08dabd6d8c77
- **Build**: 20221123.10
- **Date Produced**: November 24, 2022 9:36:11 AM UTC
- **Commit**: de84cf9f723f5d4342e95c692d088ed2af63fdbe
- **Branch**: refs/heads/release/7.0

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

[1]: 5223f01...de84cf9

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-11-24 22:57:06 +01:00
Tim Miller 97ec7c12c8
Add Accent Color to ACTool task (#16844)
This PR addresses https://github.com/xamarin/xamarin-macios/issues/10275

`actool` can set an application's "Global" color set, overwriting the system defaults. XCode sets this as "AccentColor," but when we call it directly, we don't pass in anything. This means a user cannot overwrite this setting themselves unless they rewrite the ACTool task.

This PR adds support for the "AccentColor" property to set the accent color.

To use this:

- Create a new Asset Catalog or use the default.
- Add a new ColorSet.
- Set the "AccentColor" property in the project file:

    <PropertyGroup>
        <AccentColor>AccentColor</AccentColor>
    </PropertyGroup>

You should now see the colors reflected in the application.
2022-11-23 17:15:04 +01:00
Rolf Bjarne Kvinge e4c940cdb8
[Foundation] Fix NSDate's explicit conversion operators with DateTime. (#16872)
We recently tried to fix NSDate's conversion operators with DateTime
(3c65ab1756), but unfortunately a corner case
was missed.

The new approach in the above-mentioned commit would get the individual
date/time components for a given date and use the appropriate constructor for
the other type to re-construct the date/time in question.

However, one case was missed: when converting from NSDate to DateTime, we'd
get a fractional number of milliseconds. This fractional number could be
something like 999.99 milliseconds, and when converting that to the int the
DateTime constructor expected for the number of milliseconds, then DateTime
would throw an exception, because the number of milliseconds could only be
between 0 and 999.

I've solved this by not using floating-point math in the computations. We're
now getting the number of nanoseconds from the NSDate (which is a natural
number, and represents the total number of nanoseconds less than a whole
second), and then converting that to the number of milliseconds, microseconds
and ticks that can be used with DateTime using integral math. Unfortunately
DateTime doesn't have a constructor that takes the remaining number of ticks
after all the other fields have been provided, but that can be added
afterwards.

I've also made a few other improvements:

* Improve the validation for the NSDate -> DateTime conversion to detect BC
  dates by using the NSDate's Era component (to throw because DateTime only
  supports AC dates). Also don't allow a tick later than year 10.000 (DateTime
  only supports up to a tick before year 10.000) - but explicitly support
  exactly year 10.000, and convert it to DateTime.MaxValue (this is because
  due to precision errors NSDate can't actually express 'a tick before year
  10.000', it ends up being rounded up to year 10.000 exactly). This means
  there are no more magical values in the range validation checks.
* Increase precision in the DateTime -> NSDate conversion by starting with the
  sub-second amount of ticks from the DateTime instance (instead of the number
  of milliseconds). This allows us to compute the nanoseconds NSDate expects
  with much higher precision.
* More tests!

Fixes this test:

    MonoTouchFixtures.Foundation.DateTest.DateTimeToNSDate : 2 ms
        [FAIL] Precision32022 : System.ArgumentOutOfRangeException : Valid values are between 0 and 999, inclusive.
            Parameter name: millisecond
            at System.DateTime..ctor (System.Int32 year, System.Int32 month, System.Int32 day, System.Int32 hour, System.Int32 minute, System.Int32 second, System.Int32 millisecond, System.DateTimeKind kind) [0x0002d] in <4d40c65adfc14d7fb19bad9310f3eb2a>:0
            at Foundation.NSDate.op_Explicit (Foundation.NSDate d) [0x000b8] in <9cb1e1018c034b75ba5f4ed7b83ba2f2>:0
            at MonoTouchFixtures.Foundation.DateTest.Precision32022 () [0x0000c] in <c44b5df5f7b84b69b737e9fd61bddaed>:0
            at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
            at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <4d40c65adfc14d7fb19bad9310f3eb2a>:0

Fixes https://github.com/xamarin/maccore/issues/2632.

Date and time is difficult.

Ref: https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b923ca
Ref: the rest of internet...
2022-11-23 07:55:22 +01:00
Rolf Bjarne Kvinge 0e778737c7
[tests] Adjust TestNSurlSessionHandlerCookieContainer* tests to not fail in CI in case of network problems. Fixes #2197. (#16817)
Fixes:

    [FAIL] TestNSurlSessionHandlerCookieContainerSetCookie :   Cookies received from server.
        Expected: 1
        But was:  0
            at MonoTests.System.Net.Http.MessageHandlerTest.TestNSurlSessionHandlerCookieContainerSetCookie() in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:line 233

    [FAIL] TestNSUrlSessionHandlerCookies :   Failed to get managed cookies
        Expected: True
        But was:  False
            at MonoTests.System.Net.Http.MessageHandlerTest.TestNSUrlSessionHandlerCookies () [0x000aa] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/System.Net.Http/MessageHandlers.cs:144

Fixes https://github.com/xamarin/maccore/issues/2197.
2022-11-23 07:54:04 +01:00
Rolf Bjarne Kvinge 08a162ad7f
[system-dependencies] Add diagnostics for duplicate sim download error. (#16845)
Trying to track down this:

    Downloading watchOS 9.1 Simulator (20S75): Installing (registering download)...
    Downloading watchOS 9.1 Simulator (20S75): Installing (registering download)...
    Downloading watchOS 9.1 Simulator (20S75): Error: Error Domain=SimDiskImageErrorDomain Code=5 "Duplicate of F879602F-0F22-47F5-8252-FF177B9032A0" UserInfo={NSLocalizedDescription=Duplicate of F879602F-0F22-47F5-8252-FF177B9032A0, unusableErrorDetail=}
2022-11-23 07:48:22 +01:00
Rolf Bjarne Kvinge 94c83d5595
[autoformat] Add the rest of the subdirectories in src/. (#16854) 2022-11-23 07:48:08 +01:00
Rolf Bjarne Kvinge f7c6a62ebb
[src] Skip building the 32-bit version of Microsoft.iOS.dll if no 32-bit architectures are enabled. (#16863) 2022-11-23 07:33:51 +01:00
dotnet-maestro[bot] 9cb285e513
[main] Update dependencies from dotnet/installer (#16866)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221121.1
- **Date Produced**: November 21, 2022 5:57:30 PM UTC
- **Commit**: d02d33e069bf59d00b6374e304d39d6ceb20e18a
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.101-servicing.22570.11 to 7.0.101-servicing.22571.1][1]

[1]: 3894bc5...d02d33e

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-11-22 21:30:20 +01:00
dotnet-maestro[bot] 5df7d08d3e
[main] Update dependencies from dotnet/runtime (#16868)
This pull request updates the following dependencies

## From https://github.com/dotnet/runtime
- **Subscription**: 38d2313f-22d5-4062-c8e1-08dabd6d8c77
- **Build**: 20221121.4
- **Date Produced**: November 22, 2022 3:52:46 AM UTC
- **Commit**: 5223f018f7c292b27ab2d1c0760ab5099a864340
- **Branch**: refs/heads/release/7.0

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

[1]: 9bc19b7...5223f01

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-11-22 20:33:34 +01:00
VS MobileTools Engineering Service 2 96c39dcaf9
Localized file check-in by OneLocBuild Task: Build definition ID 17751: Build ID 6990346 (#16843)
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/ceLocBug 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.
2022-11-22 10:35:04 -06:00
Alex Soto 27b27ee42a
[mono] Bump mono to match android (#16851)
New commits in mono/mono:

* mono/mono@6dd9def57c Change download URL for PCL reference assemblies
* mono/mono@d3f9882f92 Bump llvm to pick up 7424e2ca2f78a3c338fe5b07a2d4eb6dd6574195.
* mono/mono@ca8abcb6bc Bump NuGetSdkResolver in msbuild
* mono/mono@2ab67d5ef2 Bump nuget.exe to v6.3.1
* mono/mono@7cd0b7f82c Fix incorrect version comparison in loader
* mono/mono@a96bde9730 Backport fixes for sharing wrappers when type attributes are involved
* mono/mono@e7c645a340 Backporting https://github.com/dotnet/runtime/pull/59861

Diff: 2a19f878da..6dd9def57c
2022-11-22 07:28:50 +01:00
dotnet-maestro[bot] 25efb739fc
[main] Update dependencies from dotnet/installer (#16848)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221120.11
- **Date Produced**: November 21, 2022 5:38:59 AM UTC
- **Commit**: 3894bc56ac6b07f04c2de2cb7091fe2f74d3f6f6
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.101-servicing.22567.23 to
7.0.101-servicing.22570.11][1]

[1]: cf1b55e...3894bc5

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-11-21 21:08:46 +01:00
Rolf Bjarne Kvinge c1606d5497
[Foundation] Unify a few NSAttributedString constructor implementations. (#16804)
Unify the code for the following constructors:

* NSAttributedString (NSData data, NSDictionary options, out NSDictionary resultDocumentAttributes, ref/out NSError error);
* NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error);
* NSAttributedString (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error);

These functions use 'ref' arguments instead of 'out' arguments for mobile
platforms (likely due to the generator not having proper 'out' parameter
support when these functions were implemented), so improve to use 'out'
parameters in XAMCORE_5_0 (and macOS, where they already use 'out'
parameters).

Also fix nullability.

Ref: https://github.com/xamarin/xamarin-macios/issues/15216
2022-11-21 21:05:20 +01:00
Rolf Bjarne Kvinge d7f5544c18
[tests] Adjust ImageCaptioningTest to skip network-related failures in CI. (#16814)
Fixes:

    MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest
    	[FAIL] GetCaption : Ignore this failure when network is down
    		   at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption() in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs:line 36

Ref: https://github.com/xamarin/maccore/issues/2088.
2022-11-21 20:55:49 +01:00
Rolf Bjarne Kvinge 09da0bdfeb
[autoformat] Add the MetalKit, MetalPerformanceShaders, MobileCoreServices, ModelIO, MultipeerConnectivity, NaturalLanguage and NearbyInteraction frameworks. (#16829) 2022-11-21 20:52:01 +01:00
dotnet-maestro[bot] d301205b19
[main] Update dependencies from dotnet/runtime (#16827)
This pull request updates the following dependencies

## Coherency Updates

The following updates ensure that dependencies with a
*CoherentParentDependency*
attribute were produced in a build used as input to the parent
dependency's build.
See [Dependency Description
Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)

- **Coherency Updates**:
- **Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100**: from
7.0.1 to 7.0.1 (parent: Microsoft.NETCore.App.Ref)

## From https://github.com/dotnet/runtime
- **Subscription**: 38d2313f-22d5-4062-c8e1-08dabd6d8c77
- **Build**: 20221118.3
- **Date Produced**: November 18, 2022 9:27:38 PM UTC
- **Commit**: 9bc19b7ab7f6bc01e4dbe1a7220a89f5b67d6228
- **Branch**: refs/heads/release/7.0

- **Updates**:
  - **Microsoft.NETCore.App.Ref**: [from 7.0.1 to 7.0.1][5]
- **Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100**: [from
7.0.1 to 7.0.1][6]

[5]: 12b1873...9bc19b7
[6]: 3a6c724...73eb134

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-11-21 12:37:37 +01:00
Rolf Bjarne Kvinge 8ad6a27a12
[autoformat] Add the iAd, iTunesLibrary, WebKit, WatchKit and WatchConnectivity frameworks. (#16831) 2022-11-21 12:06:40 +01:00
Rolf Bjarne Kvinge 9ce7b75a42
[autoformat] Add the OpenGL framework. (#16833) 2022-11-21 12:05:46 +01:00
Rolf Bjarne Kvinge acca13229e
[apidiff] Generate a complete and valid html file for api-diff.html. (#16805)
This fixes an issue where emojis weren't rendered as such in some browsers,
because the browser would use a different character set than utf8.
2022-11-21 10:14:53 +01:00
Rolf Bjarne Kvinge 0076cd9920
[autoformat] Add .NET tests. (#16811) 2022-11-21 09:45:49 +01:00
Rolf Bjarne Kvinge 00e59771fe
[mtouch] Only package introspection dependencies if both iOS and legacy are enabled. (#16812)
Fixes this on the bots when iOS is not enabled even though legacy is:

    + make -C /Users/builder/azdo/_work/1/s/xamarin-macios/tools/mtouch package-introspection-dependencies.zip
    make: *** No rule to make target `../../runtime/.libs/iphonesimulator/libxamarin-debug.a', needed by `simlauncher32-sgen'.  Stop.
2022-11-21 09:45:21 +01:00
Rolf Bjarne Kvinge 1454fe6d13
[devops] Update according to renamed label. (#16813)
Also add 'run-packaged-macos-tests' to the labels we care about.

This fixes an issue where the label combination
'skip-all-tests,run-packaged-macos-tests' would not run any tests.
2022-11-21 09:43:25 +01:00
Rolf Bjarne Kvinge ce1a2a7036
[tests] Improve AsyncTests.Bug12221 to not fail on 403 errors on the bots. (#16815)
Fixes:

    [FAIL] Bug12221 : System.AggregateException : One or more errors occurred. (Response status code does not indicate success: 403 (Forbidden).)
    ----> System.Net.Http.HttpRequestException : Response status code does not indicate success: 403 (Forbidden).
          at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean )
          at System.Threading.Tasks.Task.Wait(Int32 , CancellationToken )
          at System.Threading.Tasks.Task.Wait()
          at LinkSdk.AsyncTests.Bug12221() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/linker/ios/link sdk/AsyncTest.cs:line 25
          at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
       --HttpRequestException
          at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
          at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage , CancellationToken )
          at LinkSdk.AsyncTests.<>c.<<LoadCategories>b__0_0>d.MoveNext() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/linker/ios/link sdk/AsyncTest.cs:line 16

One important detail is the change from calling 'Wait ()' to calling
'GetAwaiter ().GetResult ()': this is to avoid the AggregateException in the
stack trace above.

Fixes https://github.com/xamarin/maccore/issues/2570.
2022-11-21 09:37:31 +01:00
Rolf Bjarne Kvinge b3870ccb6d
[tests] Adjust MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback to ignore timeouts in CI. (#16816)
Fixes:

    MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback
    	[FAIL] TestCallback(True) :   timed out
      Expected: True
      But was:  False
    		   at MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback(Boolean stronglyTyped) in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/VideoToolbox/VTCompressionSessionTests.cs:line 171
    	[FAIL] TestCallback(False) :   timed out
      Expected: True
      But was:  False
    		   at MonoTouchFixtures.VideoToolbox.VTCompressionSessionTests.TestCallback(Boolean stronglyTyped) in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/VideoToolbox/VTCompressionSessionTests.cs:line 171
    		   at InvokeStub_VTCompressionSessionTests.TestCallback(Object, Object, IntPtr*)
2022-11-21 09:37:08 +01:00
Rolf Bjarne Kvinge 5ba78a77cd
[tests] Update the size-comparison test to work on .NET 7+. (#16818) 2022-11-21 09:36:46 +01:00
Rolf Bjarne Kvinge 5583f5c6b2
[dotnet] Ensure all templates are targetting .NET 7. (#16819) 2022-11-21 09:35:40 +01:00
Rolf Bjarne Kvinge 328f56fd4f
[tests] Ensure all .NET tests use the current .NET version. (#16820) 2022-11-21 09:35:04 +01:00
Rolf Bjarne Kvinge 5eab988136
[src] Simplify some code by using the discard operator in a few places. (#16821) 2022-11-21 09:34:32 +01:00
Rolf Bjarne Kvinge 3137ef5497
[src] Remove availability attributes on error enums. (#16810)
Fixes these test failures:

    1) Failed : Cecil.Tests.EnumTest.NoAvailabilityOnError("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/32bits/iOS/Xamarin.iOS.dll")
       CoreLocation.CLError.HistoricalLocationError
       Expected: <empty>
       But was:  < "CoreLocation.CLError.HistoricalLocationError" >
       at Cecil.Tests.EnumTest.NoAvailabilityOnError (System.String assemblyPath) [0x00067] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/cecil-tests/EnumTest.cs:29

    2) Failed : Cecil.Tests.EnumTest.NoAvailabilityOnError("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/64bits/iOS/Xamarin.iOS.dll")
       CoreLocation.CLError.HistoricalLocationError
       Expected: <empty>
       But was:  < "CoreLocation.CLError.HistoricalLocationError" >
       at Cecil.Tests.EnumTest.NoAvailabilityOnError (System.String assemblyPath) [0x00067] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/cecil-tests/EnumTest.cs:29

    3) Failed : Cecil.Tests.EnumTest.NoAvailabilityOnError("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/32bits/watchOS/Xamarin.WatchOS.dll")
       WatchKit.WKExtendedRuntimeSessionErrorCode.MustBeActiveToPrompt, WatchKit.WKExtendedRuntimeSessionErrorCode.UnsupportedSessionType, CoreLocation.CLError.HistoricalLocationError
       Expected: <empty>
       But was:  < "WatchKit.WKExtendedRuntimeSessionErrorCode.MustBeActiveToPrompt", "WatchKit.WKExtendedRuntimeSessionErrorCode.UnsupportedSessionType", "CoreLocation.CLError.HistoricalLocationError" >
       at Cecil.Tests.EnumTest.NoAvailabilityOnError (System.String assemblyPath) [0x00067] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/cecil-tests/EnumTest.cs:29

    4) Failed : Cecil.Tests.EnumTest.NoAvailabilityOnError("/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/64bits/tvOS/Xamarin.TVOS.dll")
       CoreLocation.CLError.HistoricalLocationError
       Expected: <empty>
       But was:  < "CoreLocation.CLError.HistoricalLocationError" >
       at Cecil.Tests.EnumTest.NoAvailabilityOnError (System.String assemblyPath) [0x00067] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/cecil-tests/EnumTest.cs:29

    5) Failed : Cecil.Tests.EnumTest.NoAvailabilityOnError("/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll")
       CoreLocation.CLError.HistoricalLocationError
       Expected: <empty>
       But was:  < "CoreLocation.CLError.HistoricalLocationError" >
       at Cecil.Tests.EnumTest.NoAvailabilityOnError (System.String assemblyPath) [0x00067] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/cecil-tests/EnumTest.cs:29

    6) Failed : Cecil.Tests.EnumTest.NoAvailabilityOnError("/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/Xamarin.Mac.dll")
       CoreLocation.CLError.HistoricalLocationError
       Expected: <empty>
       But was:  < "CoreLocation.CLError.HistoricalLocationError" >
       at Cecil.Tests.EnumTest.NoAvailabilityOnError (System.String assemblyPath) [0x00067] in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/cecil-tests/EnumTest.cs:29
2022-11-21 09:16:40 +01:00
Rolf Bjarne Kvinge 349b045263
[tests] Don't run watchOS tests for .NET. (#16809)
Fixes these tests:

```
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BuildMachineOSBuild: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleDevelopmentRegion: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleExecutable: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleIdentifier: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleInfoDictionaryVersion: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleName: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundlePackageType: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleSignature: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleSupportedPlatforms: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).BundleVersion: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).DeviceFamily: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).MinimumOSVersion: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).MissingBundleIdentifier: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).MissingDisplayName: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).NormalPlist: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).NoWatchCompanion: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).PlistMissing: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).VerifyAllDT: System.InvalidOperationException : Invalid platform: WatchOS
* Xamarin.MacDev.Tasks.GeneratePlistTaskTests_watchOS_WatchKitExtension(True).XamarinVersion: System.InvalidOperationException : Invalid platform: WatchOS
```
2022-11-21 09:16:15 +01:00
dotnet-maestro[bot] 8976d0bff8
[main] Update dependencies from dotnet/installer (#16825)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221117.23
- **Date Produced**: November 18, 2022 12:09:07 AM UTC
- **Commit**: cf1b55e9735de4935c764e97a95c8fb87b87ebdc
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.101-servicing.22566.14 to 7.0.101-servicing.22567.23][3]

[3]: 7a63b1b...cf1b55e

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-11-21 09:15:22 +01:00
TJ Lambert ea74ef3396
[Localization] Change the Cron Job to trigger weekend scheduled build (#16835)
I have been testing these changes inside the xamarin-macios-translations
pipeline.
The last run was green (found
[here](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6984912&view=results)).
I had to use some placeholder code for the actual calls for the
OneLocBuild task that will communicate with the Loc Team but it reached
those points as expected!

This PR also rips out calls to the main-stage.yml template to only use
the stages necessary for the OneLocBuild run over the weekend!

I think these changes are set to see if the main branch can trigger the
OneLocBuild Task over the weekend build!

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-11-18 17:22:17 -06:00
Rolf Bjarne Kvinge 68ec0ffe88
[generator] Unify generation/copying of Obsolete attributes. (#16776)
Unify generation/copying of Obsolete attributes from api definitions to generated code.

This reduces code dupliation a bit, but it will also result in more
"[EditorBrowsable (Never)]" attributes (which we weren't generating in a few
cases).

In addition we're now copying Obsolete attributes for smart fields to the
generated code.
2022-11-18 16:46:41 +01:00
Rolf Bjarne Kvinge ae140f245a
[autoformat] Add the PassKit, PdfKit, Photos, PhotosUI, PrintCore, QTKit, QuickLookUI, ReplayKit, SafariServices, ScreenCaptureKit, ScriptingBridge and SearchKit frameworks. (#16775) 2022-11-18 15:21:16 +01:00
dotnet-maestro[bot] e5265aeb8d
[main] Update dependencies from dotnet/installer (#16797)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221116.14
- **Date Produced**: November 16, 2022 11:48:39 PM UTC
- **Commit**: 7a63b1bfae183bade22d4e67900f7d56745fa993
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.101-servicing.22565.2 to 7.0.101-servicing.22566.14][1]

[1]: d62cd31...7a63b1b

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-11-18 08:08:27 +01:00
Rolf Bjarne Kvinge 1fe87884f4
[dotnet] Make sure to create a directory before we try to put files into it. (#16778)
Fixes this random build error:

    cp: Workloads/Microsoft.NET.Sdk.tvOS/LICENSE: clonefile failed: No such file or directory
    make[1]: *** [Makefile:193: Workloads/Microsoft.NET.Sdk.tvOS/LICENSE] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory '/Users/rolf/work/maccore/dotnet/xamarin-macios/dotnet'

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-18 08:03:01 +01:00
Rolf Bjarne Kvinge 1c29665f72
[tests] Ignore SWCollaborationView in DelegateAndSourceTest. (#16777)
[SWCollaborationView setDelegate:] crashes when passed null.

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-18 08:02:42 +01:00
Rolf Bjarne Kvinge 6812cc4b25
[static registrar] Handle metadata token lookup failure gracefully. (#16749)
Change the static registrar to fail gracefully if it can't compute a metadata token
for a given metadata item, and instead fall back to doing the lookup of whatever
we need at runtime.

This is a step towards making per-assembly static registrar working.

Ref: https://github.com/xamarin/xamarin-macios/issues/12067.

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-18 08:00:36 +01:00