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

15025 Коммитов

Автор SHA1 Сообщение Дата
dotnet-maestro[bot] 796c2360a1
[main] Update dependencies from dotnet/installer (#16948)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221201.12
- **Date Produced**: December 1, 2022 7:29:30 PM UTC
- **Commit**: de57a6e8e4d65a03405f6aac5c0384159bd8fa70
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.102-servicing.22579.14 to 7.0.102-servicing.22601.12][3]

[3]: ce2f541...de57a6e

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-12-05 08:36:43 +01:00
Rolf Bjarne Kvinge 1c80823582
[autoformat] Add all of tests/. (#16857) 2022-12-05 08:23:34 +01:00
Jonathan Peppers b7170fb735
[build] Add support for Visual Studio on win-arm64 (#16935)
Context: https://github.com/xamarin/yaml-templates/pull/204
Context: https://github.com/xamarin/xamarin-android/pull/7471

Updates the VSMAN files generated for our .NET workload to support Visual Studio on windows-arm64.
2022-12-02 09:08:56 +01:00
dotnet-maestro[bot] 146c929ed4
[main] Update dependencies from dotnet/installer (#16914)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221129.14
- **Date Produced**: November 29, 2022 9:31:33 PM UTC
- **Commit**: ce2f5419193c53e197d1ca96c4cbee22e44369cc
- **Branch**: refs/heads/release/7.0.1xx

- **Updates**:
  - **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.101-servicing.22578.9 to 7.0.102-servicing.22579.14][2]

[2]: ca64f84...ce2f541

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-02 09:06:21 +01:00
Rolf Bjarne Kvinge d2d7c0b7cf
Bump Xamarin.MacDev. (#16936)
New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@ac2647b Fix build by always including the System.Diagnostics.CodeAnalysis namespace.
* xamarin/Xamarin.MacDev@8f2b596 Fix nullability issues in MacCatalystSupport

Diff: 33502e15ba..ac2647b643
2022-12-02 08:57:12 +01:00
Rolf Bjarne Kvinge e062c2282e
[Foundation] Fix random memory access / memory corruption in NSFastEnumerator. Fixes #xamarin/maccore@1347. (#16920)
The NSFastEnumerator protocol in Objective-C works like this:

1. A selector is called on the collection in question, where we give the
   native method a pointer to a state structure. Upon return, the state
   structure will have two important pointers: one to a C array with the
   pointers to enumerate, and another pointer that points to a value
   determining whether the collection was modified since enumeration started.
2. In the original managed implementation, we'd store the state (a struct) as
   an instance field of NSFastEnumerator.

This works fine... most of the time. Unfortunately most of the time isn't good
enough, because this may happen:

a. The native iterator function might store a pointer into the state structure
   itself as the pointer to check for a modified collection.
b. The GC runs, and moves memory around.

Now suddenly the pointer we have to read to check if the collection was
modified is pointing to the previous location of the state structure, which
could be anything or anywhere, and the app subsequently tries to summon Murphy
from his pantheon in the sky (admittedly with limited success).

The fix is to use native memory (which the GC won't move around) to store the
enumeration state.

Also optimize memory usage a little bit by allocating one big blob for both
the state and the array of pointers we pass to the native iterator method.

Fixes https://github.com/xamarin/maccore/issues/1347.
Fixes https://github.com/xamarin/maccore/issues/2606.
2022-12-01 22:16:03 +01:00
dotnet-maestro[bot] bc2699fcfa
[main] Update dependencies from dotnet/runtime (#16917)
This pull request updates the following dependencies

## From https://github.com/dotnet/runtime
- **Subscription**: 38d2313f-22d5-4062-c8e1-08dabd6d8c77
- **Build**: 20221130.14
- **Date Produced**: December 1, 2022 9:51:31 AM UTC
- **Commit**: 4f15a5cfb18fd1a92e22d43b71ee89b13fda83f1
- **Branch**: refs/heads/release/7.0

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

[2]: de84cf9...4f15a5c
[3]: 73eb134...d71ea7c

## 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.2 (parent: Microsoft.NETCore.App.Ref)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-01 22:03:15 +01:00
Rolf Bjarne Kvinge 084f056855
[tests] Enable nullability in tests/common/DotNet.cs. (#16927) 2022-12-01 21:57:36 +01:00
Haritha Mohan 1dc6cacafb
[UIKit] Add GetWeight method for UIFontWeight (#16922)
Made UIFontWeightConstants visible and added an extensions method to
access font weights easily.
Also added test to ensure GetWeight works as expected. 
Fixes #10753

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-12-01 11:02:24 -08:00
Rolf Bjarne Kvinge 84dd56cd08
[devops] Become paranoid about making sure there are no artifacts around from previous builds. (#16903) 2022-12-01 18:25:40 +01:00
Rolf Bjarne Kvinge 59910e6147
[msbuild] Fix nullability issue. (#16897)
Return early after a failure, in order to fix a nullability problem where the
out variable from a method call can be null if the function returns false - in
which case we can't keep doing things, we need to return, because the
subsequent code doesn't handle the potential null value from the out
parameter.
2022-12-01 16:47:47 +01:00
Rolf Bjarne Kvinge b1d8dcf280
[Foundation] Fix NSAttributedStringDocumentAttributes.HyphenationFactor to use the correct underlying field. (#16888) 2022-12-01 08:47:24 +01:00
Rolf Bjarne Kvinge 786346cf0c
[autoformat] Update some new code. (#16921)
This is code from PRs that were started before we started autoformatting the
files in question, and then merged afterwards.
2022-12-01 08:31:34 +01:00
Rolf Bjarne Kvinge 7b2b1c746c
[xharness] Packaged macOS tests are a thing now. (#16905)
While this value isn't used directly in xharness, we can add a
'skip-packaged-macos-tests' label for a PR, which xharness will try to match
with a test label, so the test label must exist, otherwise all tests will
fail.
2022-11-29 21:47:30 +01:00
dotnet-maestro[bot] 619e8a2ddf
[main] Update dependencies from dotnet/installer (#16906)
This pull request updates the following dependencies

## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20221128.9
- **Date Produced**: November 29, 2022 12:14:11 AM UTC
- **Commit**: ca64f84e41c3fd04bdeb199f59cc5ffb02929261
- **Branch**: refs/heads/release/7.0.1xx

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

[1]: d02d33e...ca64f84

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
2022-11-29 21:32:10 +01:00
TJ Lambert af965ceddc
[Localization] Set OneLocBuild Task to not delete Lego Branch (#16909)
In our localization process, the Loc team builds the translations (in
the not-user-readable .lcl files) and merges them into the
'Localization' branch from a 'Lego/...' branch. After this happens, our
'Get Localization Translations' github action takes that commits and
creates a PR into main with those changes. It is really important that
this github action works because we will later delete the 'Localization'
branch and create a new one from the 'main' branch so that the branches
stay in sync.

There worked fine, but there is now a 'isDeletePrSourceBranchSelected'
input to the OneLocBuild task that defaults to true that deletes the
'Lego/...' branch right after the commit to 'Localization' is made. Due
to this, the github action cannot bring the commit to 'main' because the
'Lego/...' branch no longer exists.

The hope is that setting this input to false will successfully not
delete the 'Lego/...' branch allowing the rest of the flow to be
uninterrupted.

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-11-29 14:03:09 -06:00
Haritha Mohan 64bb06c71d
[src] use HashCode.Combine to generate hashcodes (#16841)
Fixes #16677

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: VS MobileTools Engineering Service 2 <vsmobiletoolsengsvc2@microsoft.com>
2022-11-29 10:43:46 -08:00
github-actions[bot] d2eb43a708
[Localization] Pulling New Localization Translations 3525173584 (#16870)
Automated PR. Bring new translated changes in the lcl files for
OneLocBuild to create translated resx files.

Co-authored-by: csigs <csigs@users.noreply.github.com>
Co-authored-by: CSIGS <csigs@outlook.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2022-11-29 10:46:39 -06:00
Haritha Mohan 5a0366a9fa
[Foundation] Add missing bindings in NSTask (#16856)
Added new bindings for deprecated methods/properties: 

Launch -> LaunchAndReturnError
LaunchFromPath -> LaunchFromUrl
LaunchPath -> ExecutableUrl
CurrentDirectoryPath -> CurrentDirectoryUrl

Fixes #14659
2022-11-29 08:32:36 -08:00
Rolf Bjarne Kvinge 8ca5c8fb70
[tools] Rename a few lowercased types to fix compiler warning. (#16896)
Fixes:

    tools/common/PathUtils.cs(175,10): warning CS8981: The type name 'timespec' only contains lower-cased ascii characters. Such names may become reserved for the language.
    tools/common/PathUtils.cs(180,10): warning CS8981: The type name 'stat' only contains lower-cased ascii characters. Such names may become reserved for the language.
2022-11-29 09:57:37 +01:00
Rolf Bjarne Kvinge eed66a2e21
[tests] Use CFString.FromHandle instead of NSString.FromHandle. (#16874)
Fixes this warning:

> warning CS0618: 'NSString.FromHandle(NativeHandle)' is obsolete: 'Use of 'CFString.FromHandle' offers better performance.'
2022-11-29 09:30:17 +01:00
Rolf Bjarne Kvinge 053078c167
[tests] Ignore CA1422 for some code. (#16875)
Fixes these warnings:

    xamarin-macios/tests/common/TestRuntime.cs(1228,8): warning CA1422: This call site is reachable on: 'MacCatalyst' 13.3 and later. 'ABAuthorizationStatus.Denied' is obsoleted on: 'maccatalyst' 9.0 and later (Use the 'Contacts' API instead.).
    xamarin-macios/tests/common/TestRuntime.cs(1227,8): warning CA1422: This call site is reachable on: 'MacCatalyst' 13.3 and later. 'ABAuthorizationStatus.Restricted' is obsoleted on: 'maccatalyst' 9.0 and later (Use the 'Contacts' API instead.).
    xamarin-macios/tests/common/TestRuntime.cs(1221,8): warning CA1422: This call site is reachable on: 'MacCatalyst' 13.3 and later. 'ABAuthorizationStatus.NotDetermined' is obsoleted on: 'maccatalyst' 9.0 and later (Use the 'Contacts' API instead.).
2022-11-29 09:29:59 +01:00
Rolf Bjarne Kvinge cbfcabacf6
[msbuild] Fix parsing -gcc_flags when the value is the next argument. Fixes #16861. (#16862)
The -gcc_flags in the extra mtouch/mmp arguments can either be of the format
'-gcc_flags=<value>' or '-gcc_flags <value>'. Previously we only parsed the
former correctly, and now fix the parsing logic to handle the latter version
correctly as well.

Fixes https://github.com/xamarin/xamarin-macios/issues/16861.
2022-11-29 09:29:27 +01:00
Rolf Bjarne Kvinge 5222ed4ba4
[dotnet-linker] Only enable ForceLoad for native binding libraries if that's actually requested in the binding library. Fixes #16861. (#16879)
We don't want to pass -force_load unnecessarily to the native linker, because
that defeats -dead_strip and makes apps bigger than necessary. So make sure to
honor the correct value for native libraries from binding libraries.

Ref https://github.com/xamarin/xamarin-macios/issues/16861.
2022-11-29 09:28:57 +01:00
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