Skip to content

Commit 18fdf8f

Browse files
Merge branch 'main' into span-line-height-android-fix
Conflicts: src/Core/src/maui.aar
2 parents ce1b722 + 83960b0 commit 18fdf8f

File tree

56 files changed

+721
-353
lines changed

Some content is hidden

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

56 files changed

+721
-353
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
]
2222
},
2323
"microsoft.dotnet.xharness.cli": {
24-
"version": "9.0.0-prerelease.24160.7",
24+
"version": "9.0.0-prerelease.24168.2",
2525
"commands": [
2626
"xharness"
2727
]

.github/DEVELOPMENT.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,21 @@ This page contains steps to build and run the .NET MAUI repository from source.
1313
### Mac
1414
- Install VS Code and dependencies
1515
- Follow [these steps](https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation?view=net-maui-8.0&tabs=visual-studio-code), installing VS Code, MAUI extension, .NET8, Xcode, OpenJDK, and Android SDK
16+
- Install Mono from [Mono Project](https://www.mono-project.com)
1617
- For Xcode, you can install from the [App Store](https://apps.apple.com/us/app/xcode/id497799835?mt=12) or [Apple Developer portal](https://developer.apple.com/download/more/?name=Xcode)
18+
- As of 26 March 2024, Xcode 15.3 is not yet supported. Check [this issue](https://github.com/dotnet/maui/issues/21057) for updates
19+
- Edit your `.zprofile` file to ensure that the following environment variables are set/modified (you may need to adjust the version of OpenJDK):
20+
```shell
21+
export JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home
22+
export ANDROID_HOME=~/Library/Android/sdk
23+
export ANDROID_SDK_ROOT=~/Library/Android/sdk
24+
export PATH="$PATH:~/.dotnet/tools"
25+
export PATH="$PATH:$ANDROID_HOME/platform-tools"
26+
export PATH="$PATH:$ANDROID_HOME/tools"
27+
export PATH="$PATH:$ANDROID_HOME/tools/bin"
28+
export PATH="$PATH:$ANDROID_HOME/tools/emulator"
29+
```
30+
- In VSCode do `command--shift-P` then type `code path` and select the option `Shell Command: Install 'code' in PATH`
1731

1832
## Building the Build Tasks
1933
Before opening the solution in Visual Studio / VS Code you **MUST** build the build tasks.
@@ -142,6 +156,21 @@ These are tests that will not run on a device. This is useful for testing device
142156
│ │ ├── Essentials.UnitTests
143157
```
144158

159+
### Reproducing an Issue/Debugging .NET MAUI Code
160+
Open the .NET MAUI workspace in VSCode.
161+
In VSCode, select the device that you will be testing on. Using the command palette (ctrl-shift-P/command-shift-P) type `pick device` and
162+
you will be presented with a set of choices for your target device (Android, iOS, etc). Select one.
163+
There is a sample project in `src/Controls/samples/Controls.Sample.Sandbox`. This is an empty project
164+
into which you can add your code to reproduce an issue and also set breakpoints in .NET MAUI source code.
165+
Let VSCode know this is the project you want to select by going to the command palette (ctrl-shift-P/command-shift-P)
166+
and typing `pick startup` and select ".NET MAUI: Pick Startup Project" and select the Sandbox project.
167+
168+
Before using the command palette for the first time, you may have to wait a minute
169+
for intellisense and other tasks to complete before using the command palette. If the project hasn't
170+
'settled' yet, you will see an error "Pick Startup Project has resulted in an error."
171+
172+
*Note:* When you are committing your PR, do not include your changes to the Sandbox project.
173+
145174
### Integration Tests
146175
147176
The Integration test project under `src/TestUtils/src/Microsoft.Maui.IntegrationTests` contains tests which build and/or run MAUI templates or other projects.

Microsoft.Maui-dev.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Appium", "src\TestUt
241241
EndProject
242242
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.NUnit", "src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj", "{A307B624-48D4-494E-A70D-5B3CDF6620CF}"
243243
EndProject
244-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controls.SourceGen.UnitTests", "src\Controls\tests\SourceGen.UnitTests\Conrtrols.SourceGen.UnitTests\Controls.SourceGen.UnitTests.csproj", "{06747B55-91DB-47F5-B7A2-56526C28A0D3}"
244+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controls.SourceGen.UnitTests", "src\Controls\tests\SourceGen.UnitTests\Controls.SourceGen.UnitTests\Controls.SourceGen.UnitTests.csproj", "{06747B55-91DB-47F5-B7A2-56526C28A0D3}"
245245
EndProject
246246
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGen.UnitTests", "src\Controls\tests\SourceGen.UnitTests\SourceGen.UnitTests.csproj", "{BC7F7C82-694F-4B97-86FC-273FB3FACA25}"
247247
EndProject

eng/Version.Details.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<Dependencies>
22
<ProductDependencies>
3-
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.24160.7">
3+
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.24168.2">
44
<Uri>https://github.com/dotnet/xharness</Uri>
5-
<Sha>36310c81aed0452963ebf26866fc9f1b95d72dbb</Sha>
5+
<Sha>006ea312a94e8b7f5b7ae47a6470f733ddd1738a</Sha>
66
</Dependency>
7-
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24160.7">
7+
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24168.2">
88
<Uri>https://github.com/dotnet/xharness</Uri>
9-
<Sha>36310c81aed0452963ebf26866fc9f1b95d72dbb</Sha>
9+
<Sha>006ea312a94e8b7f5b7ae47a6470f733ddd1738a</Sha>
1010
</Dependency>
11-
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.24160.7">
11+
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.24168.2">
1212
<Uri>https://github.com/dotnet/xharness</Uri>
13-
<Sha>36310c81aed0452963ebf26866fc9f1b95d72dbb</Sha>
13+
<Sha>006ea312a94e8b7f5b7ae47a6470f733ddd1738a</Sha>
1414
</Dependency>
1515
</ProductDependencies>
1616
<ToolsetDependencies>

eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
<_HarfBuzzSharpVersion>7.3.0</_HarfBuzzSharpVersion>
7979
<_SkiaSharpNativeAssetsVersion>0.0.0-commit.e2c5c86249621857107c779af0f79b4d06613766.655</_SkiaSharpNativeAssetsVersion>
8080
<MicrosoftTemplateEngineTasksVersion>7.0.114</MicrosoftTemplateEngineTasksVersion>
81-
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.24160.7</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
82-
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.24160.7</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
83-
<MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.24160.7</MicrosoftDotNetXHarnessCLIVersion>
81+
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.24168.2</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
82+
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.24168.2</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
83+
<MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.24168.2</MicrosoftDotNetXHarnessCLIVersion>
8484
<TizenUIExtensionsVersion>0.9.2</TizenUIExtensionsVersion>
8585
<SvgSkiaPackageVersion>0.5.13</SvgSkiaPackageVersion>
8686
<FizzlerPackageVersion>1.2.0</FizzlerPackageVersion>

eng/pipelines/common/apiscan.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ stages:
2121
tsaConfigFile: '$(System.DefaultWorkingDirectory)\eng\automation\guardian\tsaoptions-v2.json'
2222
apiScanSoftwareName: ${{ parameters.softwareName }}
2323
apiScanSoftwareVersionNum: ${{ parameters.softwareVersion }}
24+
apiScanAuthConnectionString: 'runAs=App;AppId=$(ApiScanClientId)'
25+

eng/pipelines/maui-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ parameters:
3737
- name: VM_IMAGE_HOST
3838
type: object
3939
default:
40-
name: AzurePipelines-EO
40+
name: MAUI-1ESPT
4141
image: 1ESPT-Windows2022
4242
os: windows
4343

@@ -158,7 +158,9 @@ extends:
158158
- template: /eng/pipelines/common/apiscan.yml@self # ApiScan
159159
parameters:
160160
dependsOn: ['pack_net']
161-
os: windows
161+
poolName: ${{ parameters.VM_IMAGE_HOST.name }}
162+
vmImage: ${{ parameters.VM_IMAGE_HOST.image }}
163+
os: ${{ parameters.VM_IMAGE_HOST.os }}
162164
scanArtifacts: ['${{ parameters.PackPlatform.binariesArtifact }}']
163165

164166

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using Microsoft.Maui.Controls;
2+
using Microsoft.Maui.DeviceTests.Stubs;
3+
using Microsoft.Maui.Handlers;
4+
using Microsoft.Maui.Hosting;
5+
using Microsoft.Maui.LifecycleEvents;
6+
7+
namespace Microsoft.Maui.DeviceTests
8+
{
9+
public static class ControlsDeviceTestExtensions
10+
{
11+
public static MauiAppBuilder ConfigureTestBuilder(this MauiAppBuilder mauiAppBuilder)
12+
{
13+
return
14+
mauiAppBuilder
15+
.ConfigureLifecycleEvents(lifecycle =>
16+
{
17+
#if IOS || MACCATALYST
18+
lifecycle
19+
.AddiOS(iOS => iOS
20+
.OpenUrl((app, url, options) =>
21+
ApplicationModel.Platform.OpenUrl(app, url, options))
22+
.ContinueUserActivity((application, userActivity, completionHandler) =>
23+
ApplicationModel.Platform.ContinueUserActivity(application, userActivity, completionHandler))
24+
.PerformActionForShortcutItem((application, shortcutItem, completionHandler) =>
25+
ApplicationModel.Platform.PerformActionForShortcutItem(application, shortcutItem, completionHandler)));
26+
#elif WINDOWS
27+
lifecycle
28+
.AddWindows(windows =>
29+
{
30+
windows
31+
.OnLaunched((app, e) =>
32+
ApplicationModel.Platform.OnLaunched(e));
33+
windows
34+
.OnActivated((window, e) =>
35+
ApplicationModel.Platform.OnActivated(window, e));
36+
});
37+
#endif
38+
})
39+
.ConfigureMauiHandlers(handlers =>
40+
{
41+
handlers.AddHandler(typeof(Editor), typeof(EditorHandler));
42+
handlers.AddHandler(typeof(VerticalStackLayout), typeof(LayoutHandler));
43+
handlers.AddHandler(typeof(Controls.ContentPage), typeof(PageHandler));
44+
#if WINDOWS
45+
handlers.AddHandler(typeof(MauiAppNewWindowStub), typeof(ApplicationHandler));
46+
#endif
47+
});
48+
}
49+
}
50+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
using Microsoft.Maui.Controls;
3+
using Microsoft.Maui.Hosting;
4+
5+
namespace Microsoft.Maui.DeviceTests
6+
{
7+
public partial class ControlsHandlerTestBase : HandlerTestBase
8+
{
9+
protected override MauiAppBuilder ConfigureBuilder(MauiAppBuilder mauiAppBuilder)
10+
{
11+
mauiAppBuilder.Services.AddSingleton<IApplication>((_) => new Application());
12+
return mauiAppBuilder.ConfigureTestBuilder();
13+
}
14+
15+
protected THandler CreateHandler<THandler>(IElement view)
16+
where THandler : IElementHandler, new()
17+
{
18+
return CreateHandler<THandler>(view, MauiContext);
19+
}
20+
}
21+
}

src/BlazorWebView/tests/MauiDeviceTests/Elements/BlazorWebViewTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Microsoft.Maui.MauiBlazorWebView.DeviceTests.Elements
1313
{
1414
[Category(TestCategory.BlazorWebView)]
15-
public class BlazorWebViewTests : HandlerTestBase
15+
public class BlazorWebViewTests : Microsoft.Maui.DeviceTests.ControlsHandlerTestBase
1616
{
1717
[Fact]
1818
public async Task BasicRazorComponentClick()

0 commit comments

Comments
 (0)