Skip to content

Commit 6903dfa

Browse files
committed
Merge branch 'main' into net10_merge_main
# Conflicts: # eng/Signing.props # eng/Versions.props # src/Controls/samples/Controls.Sample/Pages/PlatformSpecifics/iOS/iOSSafeAreaPage.xaml.cs # src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs # src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs # src/Controls/src/Core/ICornerElement.cs # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionCenterAndAbsoluteLayoutContent.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionCenterAndHorizontalLayoutContentWhenOrientationHorizontal.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionCenterAndImageContent.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionEndAndAbsoluteLayoutContent.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionEndAndHorizontalLayoutContentWhenOrientationHorizontal.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionEndAndImageContent.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionMakeVisibleAndHorizontalLayoutContentWhenOrientationHorizontal.png # src/Controls/tests/TestCases.Android.Tests/snapshots/android/VerifyScrollViewWithScrollToPositionStartAndHorizontalLayoutContentWhenOrientationHorizontal.png # src/Controls/tests/TestCases.HostApp/CoreViews/CorePageView.cs # src/Controls/tests/TestCases.HostApp/FeatureMatrix/ScrollView/ScrollViewOptionsPage.xaml.cs # src/Controls/tests/TestCases.HostApp/FeatureMatrix/ScrollView/ScrollViewViewModel.cs # src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyScrollViewWithScrollToPositionCenterAndAbsoluteLayoutContent.png # src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyScrollViewWithScrollToPositionCenterAndImageContent.png # src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyScrollViewWithScrollToPositionEndAndAbsoluteLayoutContent.png # src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/VerifyScrollViewWithScrollToPositionEndAndImageContent.png # src/Controls/tests/TestCases.Shared.Tests/Tests/FeatureMatrix/ScrollViewFeatureTests.cs # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyCharacterSpacingWhenFontFamily.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyCharacterSpacingWhenMaxLengthSet.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyEntryControlWhenFlowDirectionSet.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyHorizontalTextAlignmentBasedOnCharacterSpacing.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyHorizontalTextAlignmentWhenVerticalTextAlignmentSet.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyIsPasswordBasedOnCharacterSpacing.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyIsPasswordBasedOnHorizontalTextAlignment.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyIsPasswordBasedOnVerticalTextAlignment.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyIsPasswordWhenFontSizeSet.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyIsPasswordWhenMaxLenghtSetValue.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWhenFlowDirectionSet.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWithFontAttributes.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWithFontFamily.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWithFontSize.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWithHorizontalAlignment.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWithPasswordTrue.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyPlaceholderWithVerticalAlignment.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenAlingnedHorizontally.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenAlingnedVertically.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenCharacterSpacingSetValues.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenFontAttributesSet.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenFontFamilySetValue.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenFontSizeSetCorrectly.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenIsPasswordTrueOrFalse.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyTextWhenTextColorSetCorrectly.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/VerifyVerticalTextAlignmentBasedOnCharacterSpacing.png # src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ClearButtonVisiblityButton_TextPresent.png # src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyScrollViewWithScrollToPositionCenterAndAbsoluteLayoutContent.png # src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyScrollViewWithScrollToPositionCenterAndImageContent.png # src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyScrollViewWithScrollToPositionEndAndAbsoluteLayoutContent.png # src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/VerifyScrollViewWithScrollToPositionEndAndImageContent.png # src/Core/src/Platform/Android/MauiScrollView.cs # src/Core/src/Platform/iOS/MauiScrollView.cs
2 parents 2b13a90 + b76f5b0 commit 6903dfa

File tree

652 files changed

+12524
-1114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

652 files changed

+12524
-1114
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## DO NOT MODIFY THIS FILE MANUALLY. This is part of auto-baselining from 1ES Pipeline Templates. Go to [https://aka.ms/1espt-autobaselining] for more details.
2+
3+
pipelines:
4+
1095:
5+
retail:
6+
source:
7+
credscan:
8+
lastModifiedDate: 2024-11-20
9+
policheck:
10+
lastModifiedDate: 2024-11-20
11+
eslint:
12+
lastModifiedDate: 2024-11-20
13+
psscriptanalyzer:
14+
lastModifiedDate: 2024-11-20
15+
armory:
16+
lastModifiedDate: 2024-11-20
17+
binary:
18+
credscan:
19+
lastModifiedDate: 2024-11-20
20+
binskim:
21+
lastModifiedDate: 2025-02-18
22+
1445:
23+
retail:
24+
source:
25+
credscan:
26+
lastModifiedDate: 2025-04-29
27+
policheck:
28+
lastModifiedDate: 2025-04-29
29+
eslint:
30+
lastModifiedDate: 2025-04-29
31+
psscriptanalyzer:
32+
lastModifiedDate: 2025-04-29
33+
armory:
34+
lastModifiedDate: 2025-04-29

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ body:
4242
label: Version with bug
4343
description: In what version do you see this issue? Run `dotnet workload list` to find your version.
4444
options:
45+
- 10.0.0-preview.7
4546
- 10.0.0-preview.6
4647
- 10.0.0-preview.5
4748
- 10.0.0-preview.4
@@ -133,6 +134,7 @@ body:
133134
- 10.0.0-preview.4
134135
- 10.0.0-preview.5
135136
- 10.0.0-preview.6
137+
- 10.0.0-preview.7
136138
validations:
137139
required: true
138140
- type: dropdown

docs/DevelopmentTips.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,19 @@ To build and run Blazor Desktop samples, check out the [Blazor Desktop](https://
5353

5454
# Advanced Scenarios
5555

56-
### Compile using a local `bin\dotnet` via `dotnet-local.*`
56+
### Compile using a local `.dotnet\dotnet` via `build.*` scripts on the root folder
5757

58-
This method will use the .NET and workload versions that are specific to the branch you are on. There may be occasions when your global installation of .NET is not compatible with a particular branch. In such cases, this method will create a local folder containing all the .NET versions specific to that branch.
58+
This method uses the arcade build infraestructure. For more information you can look [here](https://github.com/dotnet/arcade/blob/main/Documentation/ArcadeSdk.md#build-scripts-and-extensibility-points)
59+
60+
```
61+
./build.sh -restore -pack
62+
```
63+
or
64+
65+
```
66+
./build.cmd -restore -pack
67+
```
5968

60-
Use `dotnet-local.cmd` on Windows or `dotnet-local.sh` on Unix to ensure that `PATH` is set consistently.
6169

6270
#### Cake
6371

dotnet-local.cmd

Lines changed: 0 additions & 10 deletions
This file was deleted.

dotnet-local.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

eng/cake/dotnet.cake

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,15 @@ Dictionary<string, string> GetDotNetEnvironmentVariables()
684684
void SetDotNetEnvironmentVariables(string dotnetDir = null)
685685
{
686686
var dotnet = dotnetDir ?? MakeAbsolute(Directory("./.dotnet/")).ToString();
687-
687+
var dotnetHostPath = IsRunningOnWindows() ? $"{dotnet}/dotnet.exe" : $"{dotnet}/dotnet";
688688
SetEnvironmentVariable("VSDebugger_ValidateDotnetDebugLibSignatures", "0");
689689
SetEnvironmentVariable("DOTNET_INSTALL_DIR", dotnet);
690690
SetEnvironmentVariable("DOTNET_ROOT", dotnet);
691+
if (IsRunningOnWindows())
692+
{
693+
//workaround for dev18
694+
SetEnvironmentVariable("DOTNET_HOST_PATH", dotnetHostPath);
695+
}
691696
SetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", dotnet);
692697
SetEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0");
693698
SetEnvironmentVariable("DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT", "true");
@@ -814,6 +819,12 @@ void RunMSBuildWithDotNet(
814819
// .SetVerbosity(Verbosity.Diagnostic)
815820
;
816821

822+
var loggerArg = GetMSBuildForwardingLoggerPath();
823+
if (loggerArg != null)
824+
{
825+
msbuildSettings.WithArgumentCustomization(args => args.Append(loggerArg));
826+
}
827+
817828
if (warningsAsError)
818829
{
819830
msbuildSettings.TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error);
@@ -902,6 +913,12 @@ void RunTestWithLocalDotNet(string csproj, string config, string pathDotnet = nu
902913
// Verbosity = Cake.Common.Tools.DotNetCore.DotNetCoreVerbosity.Diagnostic,
903914
ArgumentCustomization = args =>
904915
{
916+
var loggerArg = GetMSBuildForwardingLoggerPath();
917+
if (loggerArg != null)
918+
{
919+
args.Append(loggerArg);
920+
}
921+
905922
args.Append($"-bl:{binlog}");
906923
if(maxCpuCount > 0)
907924
{
@@ -1003,3 +1020,25 @@ void ProcessTFMSwitches()
10031020
DeleteFile("Directory.Build.Override.props");
10041021
}
10051022
}
1023+
1024+
string GetMSBuildForwardingLoggerPath()
1025+
{
1026+
if (!IsCIBuild())
1027+
return null;
1028+
1029+
// Download and extract MSBuild logger
1030+
var loggerUrl = "https://vstsagenttools.blob.core.windows.net/tools/msbuildlogger/3/msbuildlogger.zip";
1031+
var loggerDir = MakeAbsolute(Directory("./artifacts/msbuildlogger"));
1032+
EnsureDirectoryExists(loggerDir);
1033+
var loggerZip = loggerDir.CombineWithFilePath("msbuildlogger.zip");
1034+
1035+
if (!FileExists(loggerZip))
1036+
{
1037+
DownloadFile(loggerUrl, loggerZip.FullPath);
1038+
Unzip(loggerZip.FullPath, loggerDir.FullPath);
1039+
}
1040+
1041+
var loggerArg = $"-dl:CentralLogger,\"{loggerDir}/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"*ForwardingLogger,\"{loggerDir}/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll\"";
1042+
1043+
return loggerArg;
1044+
}

eng/devices/android.cake

Lines changed: 144 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const int DefaultApiLevel = 30;
66

77
const int EmulatorStartProcessTimeoutSeconds = 1 * 60;
88
const int EmulatorBootTimeoutSeconds = 2 * 60;
9+
const int EmulatorKillTimeoutSeconds = 1 * 60;
10+
const int AdbCommandTimeoutSeconds = 30;
911

1012
Information("Local Dotnet: {0}", localDotnet);
1113

@@ -473,8 +475,51 @@ void CleanUpVirtualDevice(AndroidEmulatorProcess emulatorProcess, AndroidAvdMana
473475

474476
// kill the process if it has not already exited
475477
Information("emulatorProcess.Kill()");
476-
try { emulatorProcess.Kill(); }
477-
catch { }
478+
try
479+
{
480+
// Wrap Kill() operation with timeout to prevent indefinite hanging
481+
var killTask = System.Threading.Tasks.Task.Run(() => emulatorProcess.Kill());
482+
if (killTask.Wait(TimeSpan.FromSeconds(EmulatorKillTimeoutSeconds)))
483+
{
484+
Information("Emulator process kill signal sent successfully.");
485+
486+
// Now wait for the process to actually exit
487+
var waitTask = System.Threading.Tasks.Task.Run(() => emulatorProcess.WaitForExit());
488+
if (waitTask.Wait(TimeSpan.FromSeconds(EmulatorKillTimeoutSeconds)))
489+
{
490+
Information("Emulator process killed successfully.");
491+
}
492+
else
493+
{
494+
Warning("Emulator process did not exit within {0} seconds after kill signal.", EmulatorKillTimeoutSeconds);
495+
}
496+
}
497+
else
498+
{
499+
Warning("Emulator process kill operation timed out after {0} seconds. Attempting to restart ADB server...", EmulatorKillTimeoutSeconds);
500+
501+
try
502+
{
503+
Information("Stopping ADB server...");
504+
AdbKillServer(adbSettings);
505+
System.Threading.Thread.Sleep(2000);
506+
507+
Information("Starting ADB server...");
508+
AdbStartServer(adbSettings);
509+
System.Threading.Thread.Sleep(2000);
510+
511+
Information("ADB server restart completed successfully.");
512+
}
513+
catch (Exception adbEx)
514+
{
515+
Error("Failed to restart ADB server after emulator kill timeout: {0}", adbEx.Message);
516+
}
517+
}
518+
}
519+
catch (Exception ex)
520+
{
521+
Warning("Failed to kill emulator process: {0}", ex.Message);
522+
}
478523

479524
if (deviceCreate)
480525
{
@@ -617,6 +662,44 @@ void GetDevices(string version, string toolPath)
617662
DotNetTool("tool", settings);
618663
}
619664

665+
IEnumerable<string> SafeAdbShell(string command, AdbToolSettings settings, int timeoutSeconds = AdbCommandTimeoutSeconds)
666+
{
667+
try
668+
{
669+
var shellTask = System.Threading.Tasks.Task.Run(() => AdbShell(command, settings));
670+
if (shellTask.Wait(TimeSpan.FromSeconds(timeoutSeconds)))
671+
{
672+
return shellTask.Result;
673+
}
674+
else
675+
{
676+
Warning("ADB shell command '{0}' timed out after {1} seconds", command, timeoutSeconds);
677+
return new string[0]; // Return empty array on timeout
678+
}
679+
}
680+
catch (Exception ex)
681+
{
682+
Warning("ADB shell command '{0}' failed: {1}", command, ex.Message);
683+
return new string[0]; // Return empty array on error
684+
}
685+
}
686+
687+
void SafeAdbLogcat(AdbLogcatOptions options, int timeoutSeconds = AdbCommandTimeoutSeconds)
688+
{
689+
try
690+
{
691+
var logcatTask = System.Threading.Tasks.Task.Run(() => AdbLogcat(options));
692+
if (!logcatTask.Wait(TimeSpan.FromSeconds(timeoutSeconds)))
693+
{
694+
Warning("ADB logcat operation timed out after {0} seconds", timeoutSeconds);
695+
}
696+
}
697+
catch (Exception ex)
698+
{
699+
Warning("ADB logcat operation failed: {0}", ex.Message);
700+
}
701+
}
702+
620703
void PrepareDevice(bool waitForBoot)
621704
{
622705
var settings = new AdbToolSettings { SdkRoot = androidSdkRoot };
@@ -632,7 +715,7 @@ void PrepareDevice(bool waitForBoot)
632715
// Wait for the emulator to finish booting
633716
var waited = 0;
634717
var total = EmulatorBootTimeoutSeconds;
635-
while (AdbShell("getprop sys.boot_completed", settings).FirstOrDefault() != "1")
718+
while (SafeAdbShell("getprop sys.boot_completed", settings).FirstOrDefault() != "1")
636719
{
637720
System.Threading.Thread.Sleep(1000);
638721

@@ -642,10 +725,40 @@ void PrepareDevice(bool waitForBoot)
642725
throw new Exception("The emulator did not finish booting in time.");
643726
}
644727

645-
if (waited % 60 == 0 && IsCIBuild())
728+
// At 90 seconds, restart ADB server to recover from authorization issues
729+
if (waited == 90 && IsCIBuild())
730+
{
731+
Information("Emulator boot taking longer than expected (90/{0} seconds). Restarting ADB server...", total);
732+
try
733+
{
734+
Information("Stopping ADB server...");
735+
AdbKillServer(settings);
736+
System.Threading.Thread.Sleep(2000);
737+
738+
Information("Starting ADB server...");
739+
AdbStartServer(settings);
740+
System.Threading.Thread.Sleep(2000);
741+
742+
Information("ADB server restart completed. Continuing to wait for emulator boot...");
743+
}
744+
catch (Exception ex)
745+
{
746+
Warning("Failed to restart ADB server during boot wait: {0}", ex.Message);
747+
// Continue without throwing - this is a recovery attempt
748+
}
749+
}
750+
else if (waited % 60 == 0 && IsCIBuild())
646751
{
647752
// Ensure ADB keys are configured
648-
EnsureAdbKeys(settings);
753+
try
754+
{
755+
EnsureAdbKeys(settings);
756+
}
757+
catch (Exception ex)
758+
{
759+
Warning("Failed to ensure ADB keys during boot wait: {0}", ex.Message);
760+
// Continue without throwing - this is a recovery attempt
761+
}
649762
}
650763
}
651764

@@ -656,22 +769,38 @@ void PrepareDevice(bool waitForBoot)
656769
{
657770
Information("Setting Logcat properties...");
658771

659-
AdbLogcat(new AdbLogcatOptions() { Clear = true });
660-
661-
AdbShell("logcat -G 16M", settings);
662-
663-
Information("Finished setting Logcat properties.");
772+
try
773+
{
774+
SafeAdbLogcat(new AdbLogcatOptions() { Clear = true });
775+
776+
SafeAdbShell("logcat -G 16M", settings);
777+
778+
Information("Finished setting Logcat properties.");
779+
}
780+
catch (Exception ex)
781+
{
782+
Warning("Failed to set Logcat properties: {0}", ex.Message);
783+
// Continue without throwing - logcat setup is not critical for device function
784+
}
664785
}
665786

666787
Information("Setting the ADB properties...");
667788

668-
var lines = AdbShell("setprop debug.mono.log default,mono_log_level=debug,mono_log_mask=all", settings);
669-
Information("{0}", string.Join("\n", lines));
789+
try
790+
{
791+
var lines = SafeAdbShell("setprop debug.mono.log default,mono_log_level=debug,mono_log_mask=all", settings);
792+
Information("{0}", string.Join("\n", lines));
670793

671-
lines = AdbShell("getprop debug.mono.log", settings);
672-
Information("{0}", string.Join("\n", lines));
794+
lines = SafeAdbShell("getprop debug.mono.log", settings);
795+
Information("{0}", string.Join("\n", lines));
673796

674-
Information("Finished setting ADB properties.");
797+
Information("Finished setting ADB properties.");
798+
}
799+
catch (Exception ex)
800+
{
801+
Warning("Failed to set ADB properties: {0}", ex.Message);
802+
// Continue without throwing - property setup failure should not stop the process
803+
}
675804
}
676805

677806
void EnsureAdbKeys(AdbToolSettings settings)

0 commit comments

Comments
 (0)