Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net8.0] Merge main to net8 #17649

Merged
merged 25 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
129326c
Bump powershell from 7.3.6 to 7.3.7 (#17511)
dependabot[bot] Sep 21, 2023
993a8d6
Improve comments in customer facing project templates (#17518)
jfversluis Sep 22, 2023
179fdf9
Enable WinUI Controls Test Pipeline (#17221)
PureWeen Sep 22, 2023
ac2b2d1
[create-pull-request] automated change (#17562)
github-actions[bot] Sep 22, 2023
2c8e446
Bump Microsoft.Web.WebView2 from 1.0.1938.49 to 1.0.2045.28 (#17486)
dependabot[bot] Sep 22, 2023
429f61e
Enable performance CAs for more Core classes (#17524)
hartez Sep 22, 2023
ee32276
[C] Convert values on AppThemeBinding (#17567)
StephaneDelcroix Sep 22, 2023
087fb7b
Add the missing package to the Blazor template (#17579)
mattleibow Sep 22, 2023
5e77c2a
[controls] improve "setter specificity" performance (#17527)
jonathanpeppers Sep 23, 2023
9eb2c5b
Recreate the Navigation Host If It's been Destroyed (#17594)
PureWeen Sep 25, 2023
b1ebcc4
Update SkiaSharp to 2.88.6 (#17558)
mattleibow Sep 25, 2023
b910a8c
[housekeeping] Automated PR to fix formatting errors (#17595)
github-actions[bot] Sep 25, 2023
e4f66f7
try fix #17396 (#17505)
StephaneDelcroix Sep 25, 2023
e69c7bd
[X] Double cast for OnPlat in StaticResource (#17545)
StephaneDelcroix Sep 25, 2023
36700a8
Remove Previous TitleView from Toolbar (#17353)
PureWeen Sep 25, 2023
5c9437b
Document return values for animation extensions (#17627)
hartez Sep 25, 2023
3017613
Recreate Details Fragment, if its been destroyed (#17604)
PureWeen Sep 25, 2023
34072d8
Reenable WinUI Device Tests parallel running (#17613)
jfversluis Sep 25, 2023
f09e3d5
Remove reference to concrete native host app (#16803)
dansiegel Sep 25, 2023
ca12263
[Windows] Fixes border content clipping (#17310)
emaf Sep 25, 2023
4695f21
Remove Navigation Delegate When Disposed (#17544)
PureWeen Sep 26, 2023
b446a47
Bump the xunit group with 3 updates (#17619)
dependabot[bot] Sep 26, 2023
4d83685
Fix typo in build.sh (#17305)
eltociear Sep 26, 2023
93095ab
Update dependencies from https://github.com/dotnet/xharness build 202…
dotnet-maestro[bot] Sep 26, 2023
836376f
Merge branch 'main' into net8.0
rmarinho Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"powershell": {
"version": "7.3.6",
"version": "7.3.7",
"commands": [
"pwsh"
]
Expand All @@ -21,7 +21,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "8.0.0-prerelease.23431.1",
"version": "8.0.0-prerelease.23471.1",
"commands": [
"xharness"
]
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ done
dotnet tool restore

if [ $? -ne 0 ]; then
echo "An error occured while installing Cake."
echo "An error occurred while installing Cake."
exit 1
fi

echo "${CAKE_ARGUMENTS[@]}"

# Start Cake
dotnet tool run dotnet-cake "$SCRIPT" "${CAKE_ARGUMENTS[@]}"
dotnet tool run dotnet-cake "$SCRIPT" "${CAKE_ARGUMENTS[@]}"
46 changes: 45 additions & 1 deletion eng/Microsoft.Extensions.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
<Project>
<ItemGroup>
<PackageReference
Update="HarfBuzzSharp"
Version="$(_HarfBuzzSharpVersion)"
/>
<PackageReference
Update="HarfBuzzSharp.NativeAssets.Linux"
Version="$(_HarfBuzzSharpVersion)"
/>
<PackageReference
Update="HarfBuzzSharp.NativeAssets.macOS"
Version="$(_HarfBuzzSharpVersion)"
/>
<PackageReference
Update="HarfBuzzSharp.NativeAssets.Win32"
Version="$(_HarfBuzzSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.HarfBuzz"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.Extended"
Version="$(_SkiaSharpExtendedVersion)"
/>
<PackageReference
Update="SkiaSharp"
Version="$(_SkiaSharpVersion)"
Expand All @@ -8,12 +32,32 @@
Update="SkiaSharp.Views"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.Views.Gtk3"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.Views.WinUI"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.HarfBuzz"
Update="SkiaSharp.Views.WPF"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.NativeAssets.Linux"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.NativeAssets.Linux.NoDependencies"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.NativeAssets.macOS"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Update="SkiaSharp.NativeAssets.Win32"
Version="$(_SkiaSharpVersion)"
/>
<PackageReference
Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@
<Uri>https://github.com/dotnet/templating</Uri>
<Sha>3f4da9ced34942d83054e647f3b1d9d7dde281e8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="8.0.0-prerelease.23431.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="8.0.0-prerelease.23471.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>1446eababf78d7787af2aa86d5393c342c4b1b0b</Sha>
<Sha>06fd591dc00862e415eddbec734ae9ea77d35486</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="8.0.0-prerelease.23431.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="8.0.0-prerelease.23471.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>1446eababf78d7787af2aa86d5393c342c4b1b0b</Sha>
<Sha>06fd591dc00862e415eddbec734ae9ea77d35486</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="8.0.0-prerelease.23431.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="8.0.0-prerelease.23471.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>1446eababf78d7787af2aa86d5393c342c4b1b0b</Sha>
<Sha>06fd591dc00862e415eddbec734ae9ea77d35486</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration" Version="8.0.0-rc.2.23457.7">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down
15 changes: 8 additions & 7 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<SystemIOUnmanagedMemoryStreamPackageVersion>4.3.0</SystemIOUnmanagedMemoryStreamPackageVersion>
<SystemObjectModelPackageVersion>4.3.0</SystemObjectModelPackageVersion>
<SystemRuntimeCompilerServicesUnsafePackageVersion>6.0.0</SystemRuntimeCompilerServicesUnsafePackageVersion>
<_MicrosoftWebWebView2Version>1.0.1938.49</_MicrosoftWebWebView2Version>
<_MicrosoftWebWebView2Version>1.0.2045.28</_MicrosoftWebWebView2Version>
<!-- GLIDE - the android maven artifact in /src/Core/AndroidNative/maui/build.gradle -->
<!-- must be kept in sync with the binding library version to it here: -->
<_XamarinAndroidGlideVersion>4.15.1.2</_XamarinAndroidGlideVersion>
Expand All @@ -78,13 +78,14 @@
- Feed URI in the nuget.config
- Native assets build and sha
-->
<_SkiaSharpVersion>2.88.4-preview.82</_SkiaSharpVersion>
<_HarfBuzzSharpVersion>2.8.2.4-preview.82</_HarfBuzzSharpVersion>
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.936270ba9372ac6c94505de44884ef4ba5d96aa2.588</_SkiaSharpNativeAssetsVersion>
<_SkiaSharpVersion>2.88.6</_SkiaSharpVersion>
mattleibow marked this conversation as resolved.
Show resolved Hide resolved
<_SkiaSharpExtendedVersion>2.0.0-preview.86</_SkiaSharpExtendedVersion>
<_HarfBuzzSharpVersion>7.3.0</_HarfBuzzSharpVersion>
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.e2c5c86249621857107c779af0f79b4d06613766.655</_SkiaSharpNativeAssetsVersion>
<MicrosoftTemplateEngineTasksVersion>7.0.100-preview.5.22226.1</MicrosoftTemplateEngineTasksVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>8.0.0-prerelease.23431.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>8.0.0-prerelease.23431.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>8.0.0-prerelease.23431.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>8.0.0-prerelease.23471.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>8.0.0-prerelease.23471.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>8.0.0-prerelease.23471.1</MicrosoftDotNetXHarnessCLIVersion>
<TizenUIExtensionsVersion>0.9.0</TizenUIExtensionsVersion>
<SvgSkiaPackageVersion>0.5.13</SvgSkiaPackageVersion>
<FizzlerPackageVersion>1.2.0</FizzlerPackageVersion>
Expand Down
112 changes: 101 additions & 11 deletions eng/devices/windows.cake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ string DOTNET_PLATFORM = $"win10-x64";
bool DEVICE_CLEANUP = Argument("cleanup", true);
string certificateThumbprint = "";
bool isPackagedTestRun = TEST_DEVICE.ToLower().Equals("packaged");
bool isControlsProjectTestRun = PROJECT.FullPath.EndsWith("Controls.DeviceTests.csproj");

// Certificate Common Name to use/generate (eg: CN=DotNetMauiTests)
var certCN = Argument("commonname", "DotNetMAUITests");
Expand Down Expand Up @@ -176,11 +177,13 @@ Task("Build")
s.MSBuildSettings.Properties.Add("PackageCertificateThumbprint", new List<string> { certificateThumbprint });
s.MSBuildSettings.Properties.Add("AppxPackageSigningEnabled", new List<string> { "True" });
s.MSBuildSettings.Properties.Add("SelfContained", new List<string> { "True" });
s.MSBuildSettings.Properties.Add("ExtraDefineConstants", new List<string> { "PACKAGED" });
}
else
{
// Apply correct build properties for unpackaged builds
s.MSBuildSettings.Properties.Add("WindowsPackageType", new List<string> { "None" });
s.MSBuildSettings.Properties.Add("ExtraDefineConstants", new List<string> { "UNPACKAGED" });
}

// Set correct launchSettings.json setting for packaged/unpackaged
Expand All @@ -207,14 +210,23 @@ Task("Test")

Information("Cleaned directories");

var testResultsFile = MakeAbsolute((DirectoryPath)TEST_RESULTS).FullPath.Replace("/", "\\") + $"\\TestResults-{PACKAGEID.Replace(".", "_")}.xml";
var testResultsPath = MakeAbsolute((DirectoryPath)TEST_RESULTS).FullPath.Replace("/", "\\");
var testResultsFile = testResultsPath + $"\\TestResults-{PACKAGEID.Replace(".", "_")}.xml";
var testsToRunFile = MakeAbsolute((DirectoryPath)TEST_RESULTS).FullPath.Replace("/", "\\") + $"\\devicetestcategories.txt";

Information($"Test Results File: {testResultsFile}");
Information($"Tests To Run File: {testsToRunFile}");

if (FileExists(testResultsFile))
{
DeleteFile(testResultsFile);
}

if (FileExists(testsToRunFile))
{
DeleteFile(testsToRunFile);
}

if (isPackagedTestRun)
{
// Try to uninstall the app if it exists from before
Expand All @@ -238,24 +250,66 @@ Task("Test")
// Install the DeviceTests app
StartProcess("powershell", "Add-AppxPackage -Path \"" + MakeAbsolute(msixPath).FullPath + "\"");

var startArgs = "Start-Process shell:AppsFolder\\$((Get-AppxPackage -Name \"" + PACKAGEID + "\").PackageFamilyName)!App -Args \"" + testResultsFile + "\"";
if (isControlsProjectTestRun)
{
// Start the app once, this will trigger the discovery of the test categories
var startArgsInitial = "Start-Process shell:AppsFolder\\$((Get-AppxPackage -Name \"" + PACKAGEID + "\").PackageFamilyName)!App -ArgumentList \"" + testResultsFile + "\", \"-1\"";
StartProcess("powershell", startArgsInitial);

Information($"Waiting 10 seconds for process to finish...");
System.Threading.Thread.Sleep(10000);

var testCategoriesToRun = System.IO.File.ReadAllLines(testsToRunFile).Length;

for (int i = 0; i <= testCategoriesToRun; i++)
{
var startArgs = "Start-Process shell:AppsFolder\\$((Get-AppxPackage -Name \"" + PACKAGEID + "\").PackageFamilyName)!App -ArgumentList \"" + testResultsFile + "\", \"" + i + "\"";

Information(startArgs);

Information(startArgs);
// Start the DeviceTests app for packaged
StartProcess("powershell", startArgs);

// Start the DeviceTests app for packaged
StartProcess("powershell", startArgs);
Information($"Waiting 10 seconds for the next...");
System.Threading.Thread.Sleep(10000);
}
}
else
{
var startArgs = "Start-Process shell:AppsFolder\\$((Get-AppxPackage -Name \"" + PACKAGEID + "\").PackageFamilyName)!App -ArgumentList \"" + testResultsFile + "\"";

Information(startArgs);

// Start the DeviceTests app for packaged
StartProcess("powershell", startArgs);
}
}
else
{
// Unpackaged process blocks the thread, so we can wait shorter for the results
waitForResultTimeoutInSeconds = 30;

// Start the DeviceTests app for unpackaged
StartProcess(TEST_APP, testResultsFile);
if (isControlsProjectTestRun)
{
// Start the app once, this will trigger the discovery of the test categories
StartProcess(TEST_APP, testResultsFile + " -1");

var testCategoriesToRun = System.IO.File.ReadAllLines(testsToRunFile).Length;

for (int i = 0; i <= testCategoriesToRun; i++)
{
// Start the DeviceTests app for unpackaged
StartProcess(TEST_APP, testResultsFile + " " + i);
}
}
else
{
StartProcess(TEST_APP, testResultsFile);
}
}

var waited = 0;
while (!FileExists(testResultsFile)) {
while (System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml").Length == 0) {
System.Threading.Thread.Sleep(1000);
waited++;

Expand All @@ -264,12 +318,48 @@ Task("Test")
break;
}

if(!FileExists(testResultsFile))
// If we're running the Controls project, double-check if we have all test result files
// and if the categories we expected to run match the test result files
if (isControlsProjectTestRun)
{
throw new Exception($"Test results file not found after {waited} seconds, process might have crashed or not completed yet.");
var expectedCategoriesRanCount = System.IO.File.ReadAllLines(testsToRunFile).Length-1;
var actualResultFileCount = System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml").Length;

while (actualResultFileCount < expectedCategoriesRanCount) {
actualResultFileCount = System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml").Length;
System.Threading.Thread.Sleep(1000);
waited++;

Information($"Waiting {waited} additional second(s) for tests to finish...");
if (waited >= 30)
break;
}

if (FileExists(testsToRunFile))
{
DeleteFile(testsToRunFile);
}

// While the count should match exactly, if we get more files somehow we'll allow it
// If it's less, throw an exception to fail the pipeline.
if (actualResultFileCount < expectedCategoriesRanCount)
{
throw new Exception($"Expected test result files: {expectedCategoriesRanCount}, actual files: {actualResultFileCount}, some process(es) might have crashed.");
}
}

Information($"Tests Finished");
if(System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml").Length == 0)
{
throw new Exception($"Test result file(s) not found after {waited} seconds, process might have crashed or not completed yet.");
}

foreach(var file in System.IO.Directory.GetFiles(testResultsPath, "TestResults-*.xml"))
{
var failed = XmlPeek(file, "/assemblies/assembly[@failed > 0 or @errors > 0]/@failed");
if (!string.IsNullOrEmpty(failed)) {
throw new Exception($"At least {failed} test(s) failed.");
}
}
});


Expand Down
3 changes: 1 addition & 2 deletions eng/pipelines/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ stages:
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
catalyst: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
# Skip this one for Windows for now, it's crashing
windows: #$(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
windows: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
- name: blazorwebview
desc: BlazorWebView
androidApiLevelsExclude: [ 27, 26, 25, 24, 23, 22, 21 ] # BlazorWebView requires a recent version of Chrome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// base.OnCreate(savedInstanceState);

//#pragma warning disable CS0612 // Type or member is obsolete
// Forms.Init(new MauiContext(MauiApplication.Current.Services, this));
// Forms.Init(new MauiContext(IPlatformApplication.Current.Services, this));
//#pragma warning restore CS0612 // Type or member is obsolete
// LoadApplication(new Issue10182Application());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void OnConfigureLifeCycle(IAndroidLifecycleBuilder android)
// any UI has appeared.
// This creates a dummy MauiContext that wraps the Application.

var services = MauiApplication.Current.Services;
var services = IPlatformApplication.Current.Services;
var mauiContext = new MauiContext(services, app);
var state = new ActivationState(mauiContext);
#pragma warning disable CS0612 // Type or member is obsolete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void OnConfigureLifeCycle(ITizenLifecycleBuilder tizen)
// Forms.Init(). This happens before any UI has appeared.
// This creates a dummy MauiContext.

var services = MauiApplication.Current.Services;
var services = IPlatformApplication.Current.Services;
MauiContext mauiContext = new MauiContext(services);
ActivationState state = new ActivationState(mauiContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void OnConfigureLifeCycle(IWindowsLifecycleBuilder windows)
// Inside OnLaunched we grab the MauiContext that's on the window so we can have the correct
// MauiContext inside Forms

var services = MauiWinUIApplication.Current.Services;
var services = IPlatformApplication.Current?.Services ?? throw new InvalidOperationException("Unable to find Application Services");
var mauiContext = new MauiContext(services);
var state = new ActivationState(mauiContext, args);
#pragma warning disable CS0612 // Type or member is obsolete
Expand Down
3 changes: 2 additions & 1 deletion src/Compatibility/Core/src/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ public void Initialize(IServiceProvider services)
#if WINDOWS
var dispatcher =
services.GetService<IDispatcher>() ??
MauiWinUIApplication.Current.Services.GetRequiredService<IDispatcher>();
IPlatformApplication.Current?.Services.GetRequiredService<IDispatcher>() ??
throw new InvalidOperationException("Unable to find Application Services");

dispatcher.DispatchIfRequired(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void OnConfigureLifeCycle(IiOSLifecycleBuilder iOS)
// Forms.Init(). This happens before any UI has appeared.
// This creates a dummy MauiContext.

var services = MauiUIApplicationDelegate.Current.Services;
var services = IPlatformApplication.Current.Services;
var mauiContext = new MauiContext(services);
var state = new ActivationState(mauiContext);
#pragma warning disable CS0612 // Type or member is obsolete
Expand Down
Loading
Loading