Skip to content

Commit d9150f6

Browse files
authored
[net8.0] Merge main into net8.0. (#18636)
2 parents 0c0e5d7 + b13d2b7 commit d9150f6

File tree

17 files changed

+94
-787
lines changed

17 files changed

+94
-787
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,9 @@
5757
<Uri>https://github.com/dotnet/templating</Uri>
5858
<Sha />
5959
</Dependency>
60+
<Dependency Name="Microsoft.DotNet.XHarness.iOS.Shared" Version="8.0.0-prerelease.23401.3">
61+
<Uri>https://github.com/dotnet/xharness</Uri>
62+
<Sha>c1216531b6c19ac4a6dcd447503e09fe28687cbd</Sha>
63+
</Dependency>
6064
</ToolsetDependencies>
6165
</Dependencies>

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<MicrosoftNETRuntimeMonoTargetsSdkPackageVersion>7.0.7</MicrosoftNETRuntimeMonoTargetsSdkPackageVersion>
1111
<MicrosoftTemplateEngineTasksVersion>7.0.100-alpha.1.21601.1</MicrosoftTemplateEngineTasksVersion>
1212
<MicrosoftDotNetCecilPackageVersion>0.11.4-alpha.23360.2</MicrosoftDotNetCecilPackageVersion>
13+
<MicrosoftDotNetXHarnessiOSSharedPackageVersion>8.0.0-prerelease.23401.3</MicrosoftDotNetXHarnessiOSSharedPackageVersion>
1314
<!-- Manually updated versions -->
1415
<Emscriptennet7WorkloadVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</Emscriptennet7WorkloadVersion>
1516
<EmscriptenWorkloadVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</EmscriptenWorkloadVersion>

src/UIKit/UIMenu.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#if !WATCH
2+
using System;
3+
using System.Runtime.InteropServices;
4+
5+
using ObjCRuntime;
6+
using Foundation;
7+
8+
namespace UIKit {
9+
public partial class UIMenu {
10+
#if !XAMCORE_5_0
11+
12+
#if NET
13+
[SupportedOSPlatform ("tvos15.0")]
14+
[SupportedOSPlatform ("ios15.0")]
15+
[SupportedOSPlatform ("maccatalyst15.0")]
16+
#else
17+
[iOS (15, 0)]
18+
[TV (15, 0)]
19+
#endif
20+
public virtual UIMenuElement [] SelectedElements {
21+
get {
22+
// check if we are on tvos earlier than 15, if so, return and empty array, else return
23+
// the correct value
24+
#if TVOS
25+
if (SystemVersion.ChecktvOS (15, 0)) {
26+
return _SelectedElements;
27+
} else {
28+
return Array.Empty<UIMenuElement> ();
29+
}
30+
#else
31+
return _SelectedElements;
32+
#endif
33+
}
34+
#endif
35+
}
36+
}
37+
}
38+
#endif

src/frameworks.sources

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,7 @@ UIKIT_SOURCES = \
17411741
UIKit/UIKeyboard.cs \
17421742
UIKit/UIKitSynchronizationContext.cs \
17431743
UIKit/UIListSeparatorConfiguration.cs \
1744+
UIKit/UIMenu.cs \
17441745
UIKit/UINavigationBar.cs \
17451746
UIKit/UINavigationController.cs \
17461747
UIKit/UIPageViewController.cs \

src/storekit.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,9 +916,6 @@ enum SKCloudServiceSetupMessageIdentifier {
916916
[Mac (11, 0), Watch (7, 0)]
917917
[MacCatalyst (13, 1)]
918918
[BaseType (typeof (NSObject))]
919-
#if XAMCORE_3_0 // Avoid breaking change in iOS
920-
[DisableDefaultCtor]
921-
#endif
922919
interface SKCloudServiceController {
923920
[Static]
924921
[Export ("authorizationStatus")]

src/uikit.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8926,9 +8926,14 @@ interface UIMenu {
89268926
[Export ("options")]
89278927
UIMenuOptions Options { get; }
89288928

8929-
[iOS (15, 0), MacCatalyst (15, 0)]
8929+
[iOS (15, 0), MacCatalyst (15, 0), TV (15, 0)]
89308930
[Export ("selectedElements")]
8931+
#if XAMCORE_5_0
89318932
UIMenuElement [] SelectedElements { get; }
8933+
#else
8934+
[Internal]
8935+
UIMenuElement [] _SelectedElements { get; }
8936+
#endif
89328937

89338938
[Export ("children")]
89348939
UIMenuElement [] Children { get; }
@@ -24829,7 +24834,7 @@ interface UIDeferredMenuElement {
2482924834
[Export ("elementWithProvider:")]
2483024835
UIDeferredMenuElement Create (UIDeferredMenuElementProviderHandler elementProvider);
2483124836

24832-
[iOS (15, 0), MacCatalyst (15, 0)]
24837+
[iOS (15, 0), MacCatalyst (15, 0), TV (15, 0)]
2483324838
[Static]
2483424839
[Export ("elementWithUncachedProvider:")]
2483524840
UIDeferredMenuElement CreateUncached (UIDeferredMenuElementProviderHandler elementProvider);

tests/common/Configuration.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,9 @@ public static string GetNuGetVersionNoMetadata (TargetFramework framework)
541541

542542
public static string GetNuGetVersionNoMetadata (ApplePlatform platform)
543543
{
544-
return GetVariable ($"{platform.AsString ().ToUpper ()}_NUGET_VERSION_NO_METADATA", string.Empty);
544+
var workloadVersion = Environment.GetEnvironmentVariable ($"{platform.AsString ().ToUpper ()}_WORKLOAD_VERSION");
545+
return string.IsNullOrEmpty (workloadVersion) ?
546+
GetVariable ($"{platform.AsString ().ToUpper ()}_NUGET_VERSION_NO_METADATA", string.Empty) : workloadVersion;
545547
}
546548

547549
// This is only applicable for .NET

tests/introspection/ApiBaseTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ protected bool SkipDueToAttributeInProperty (MemberInfo member)
170170

171171
// FIXME: In the future we could cache this to reduce memory requirements
172172
var property = m.DeclaringType
173-
.GetProperties ()
174-
.SingleOrDefault (p => p.GetGetMethod () == m || p.GetSetMethod () == m);
173+
.GetProperties (BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
174+
.SingleOrDefault (p => p.GetGetMethod (true) == m || p.GetSetMethod (true) == m);
175175
return property is not null && SkipDueToAttribute (property);
176176
}
177177

tests/xharness/Xharness.Tests/TestImporter/Tests/ProjectDefinitionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void TearDown ()
2626
[Test]
2727
public void GetTypeForAssembliesNullMonoPath ()
2828
{
29-
var projectDefinition = new ProjectDefinition ("MyProject", assemblyLocator.Object, factory.Object, new List<ITestAssemblyDefinition> (), "");
29+
var projectDefinition = new ProjectDefinition ("MyProject", assemblyLocator.Object, factory.Object, new List<ITestAssemblyDefinition> ());
3030
Assert.Throws<ArgumentNullException> (() => projectDefinition.GetTypeForAssemblies (null, Platform.iOS));
3131
}
3232
}

tests/xharness/Xharness.Tests/Tests/AppRunnerTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public async Task InstallOnDeviceTest ()
229229
var processResult = new ProcessExecutionResult () { ExitCode = 1, TimedOut = false };
230230
processManager.SetReturnsDefault (Task.FromResult (processResult));
231231

232-
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false)).ReturnsAsync (mockDevices [0]);
232+
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [0]);
233233

234234
// Act
235235
var appRunner = new AppRunner (processManager.Object,
@@ -274,7 +274,7 @@ public async Task UninstallFromDeviceTest ()
274274
var processResult = new ProcessExecutionResult () { ExitCode = 3, TimedOut = false };
275275
processManager.SetReturnsDefault (Task.FromResult (processResult));
276276

277-
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false)).ReturnsAsync (mockDevices [1]);
277+
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [1]);
278278

279279
// Act
280280
var appRunner = new AppRunner (processManager.Object,
@@ -323,13 +323,13 @@ public async Task RunOnSimulatorWithNoAvailableSimulatorTest ()
323323

324324
// Mock finding simulators
325325
simulators
326-
.Setup (x => x.LoadDevices (It.IsAny<ILog> (), false, false, false, true))
326+
.Setup (x => x.LoadDevices (It.IsAny<ILog> (), false, false, false, true, CancellationToken.None))
327327
.Returns (Task.FromResult (true));
328328

329329
string simulatorLogPath = Path.Combine (Path.GetTempPath (), "simulator-logs");
330330

331331
simulators
332-
.Setup (x => x.FindSimulators (TestTarget.Simulator_tvOS, mainLog.Object, true, false))
332+
.Setup (x => x.FindSimulators (TestTarget.Simulator_tvOS, mainLog.Object, true, false, CancellationToken.None))
333333
.ReturnsAsync ((null, null));
334334

335335
var listenerLogFile = new Mock<IFileBackedLog> ();
@@ -406,7 +406,7 @@ public async Task RunOnSimulatorSuccessfullyTest ()
406406

407407
// Mock finding simulators
408408
simulators
409-
.Setup (x => x.LoadDevices (It.IsAny<ILog> (), false, false, false, true))
409+
.Setup (x => x.LoadDevices (It.IsAny<ILog> (), false, false, false, true, CancellationToken.None))
410410
.Returns (Task.FromResult (true));
411411

412412
string simulatorLogPath = Path.Combine (Path.GetTempPath (), "simulator-logs");
@@ -418,7 +418,7 @@ public async Task RunOnSimulatorSuccessfullyTest ()
418418
simulator.SetupGet (x => x.SystemLog).Returns (Path.Combine (simulatorLogPath, "system.log"));
419419

420420
simulators
421-
.Setup (x => x.FindSimulators (TestTarget.Simulator_iOS64, mainLog.Object, true, false))
421+
.Setup (x => x.FindSimulators (TestTarget.Simulator_iOS64, mainLog.Object, true, false, CancellationToken.None))
422422
.ReturnsAsync ((simulator.Object, null));
423423

424424
var testResultFilePath = Path.GetTempFileName ();
@@ -519,9 +519,9 @@ public async Task RunOnSimulatorSuccessfullyTest ()
519519
[Test]
520520
public void RunOnDeviceWithNoAvailableSimulatorTest ()
521521
{
522-
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false)).ReturnsAsync ((IHardwareDevice) null);
522+
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false, CancellationToken.None)).ReturnsAsync ((IHardwareDevice) null);
523523
simulators
524-
.Setup (s => s.FindSimulators (It.IsAny<TestTarget> (), It.IsAny<ILog> (), true, false))
524+
.Setup (s => s.FindSimulators (It.IsAny<TestTarget> (), It.IsAny<ILog> (), true, false, CancellationToken.None))
525525
.ReturnsAsync ((null, null));
526526

527527
// Crash reporter
@@ -574,7 +574,7 @@ public async Task RunOnDeviceSuccessfullyTest ()
574574
{
575575
var harness = GetMockedHarness ();
576576

577-
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false)).ReturnsAsync (mockDevices [1]);
577+
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [1]);
578578

579579
// Crash reporter
580580
var crashReporterFactory = new Mock<ICrashSnapshotReporterFactory> ();
@@ -683,7 +683,7 @@ public async Task RunOnDeviceWithFailedTestsTest ()
683683
{
684684
var harness = GetMockedHarness ();
685685

686-
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false)).ReturnsAsync (mockDevices [1]);
686+
devices.Setup (d => d.FindDevice (It.IsAny<RunMode> (), It.IsAny<ILog> (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [1]);
687687

688688
// Crash reporter
689689
var crashReporterFactory = new Mock<ICrashSnapshotReporterFactory> ();

0 commit comments

Comments
 (0)