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
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>
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.
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'..
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>
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.
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...
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.
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.
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
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.
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>
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.
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.
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.
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*)
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>
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.
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>