Skip to content

Commit

Permalink
Merge branch 'dotnet:main' into fix-18867
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaflo authored Apr 26, 2024
2 parents 2a2ab15 + 0117681 commit 8f77a66
Show file tree
Hide file tree
Showing 479 changed files with 10,789 additions and 2,304 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "9.0.0-prerelease.24168.2",
"version": "9.0.0-prerelease.24208.1",
"commands": [
"xharness"
]
Expand Down
83 changes: 83 additions & 0 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ This page contains steps to build and run the .NET MAUI repository from source.
- 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
- Install Mono from [Mono Project](https://www.mono-project.com)
- 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)
- As of 26 March 2024, Xcode 15.3 is not yet supported. Check [this issue](https://github.com/dotnet/maui/issues/21057) for updates
- Edit your `.zprofile` file to ensure that the following environment variables are set/modified (you may need to adjust the version of OpenJDK):
```shell
export JAVA_HOME=/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=~/Library/Android/sdk
export PATH="$PATH:~/.dotnet/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/tools/bin"
export PATH="$PATH:$ANDROID_HOME/tools/emulator"
```
- In VSCode do `command--shift-P` then type `code path` and select the option `Shell Command: Install 'code' in PATH`

## Building the Build Tasks
Before opening the solution in Visual Studio / VS Code you **MUST** build the build tasks.
Expand Down Expand Up @@ -93,6 +106,8 @@ Use ‘main’ for bug fixes that don’t require API changes. For new features
### Device Test Projects
[Writing Device Tests](https://github.com/dotnet/maui/wiki/DeviceTests)
These are tests that will run on an actual device
```
Expand All @@ -117,6 +132,8 @@ These are tests that will run on an actual device

### UI Test Projects

[Writing UI Tests](https://github.com/dotnet/maui/wiki/UITests)

These are tests used for exercising the UI through accessibility layers to simulate user interactions

```
Expand All @@ -143,6 +160,21 @@ These are tests that will not run on a device. This is useful for testing device
│ │ ├── Essentials.UnitTests
```

### Reproducing an Issue/Debugging .NET MAUI Code
Open the .NET MAUI workspace in VSCode.
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
you will be presented with a set of choices for your target device (Android, iOS, etc). Select one.
There is a sample project in `src/Controls/samples/Controls.Sample.Sandbox`. This is an empty project
into which you can add your code to reproduce an issue and also set breakpoints in .NET MAUI source code.
Let VSCode know this is the project you want to select by going to the command palette (ctrl-shift-P/command-shift-P)
and typing `pick startup` and select ".NET MAUI: Pick Startup Project" and select the Sandbox project.
Before using the command palette for the first time, you may have to wait a minute
for intellisense and other tasks to complete before using the command palette. If the project hasn't
'settled' yet, you will see an error "Pick Startup Project has resulted in an error."
*Note:* When you are committing your PR, do not include your changes to the Sandbox project.
### Integration Tests
The Integration test project under `src/TestUtils/src/Microsoft.Maui.IntegrationTests` contains tests which build and/or run MAUI templates or other projects.
Expand Down Expand Up @@ -273,6 +305,57 @@ dotnet build src\DotNet\DotNet.csproj
dotnet cake --target=VS
```
## Debugging MSBuild Tasks using VS/VSCode
One thing that is very useful is the ability to debug your Tasks while
they are being run on a build process. This is possible thanks to the
`MSBUILDDEBUGONSTART` environment variable. When set to `2` this will
force MSBuild to wait for a debugger connection before continuing.
You will see the following prompt.
```dotnetcli
Waiting for debugger to attach (dotnet PID 13001). Press enter to continue...
```
You can then use VS or VSCode to attach to this process and debug you tasks.
You can start your test app with the `dotnet-local` script (so it uses your maui build)
### [MacOS](#tab/macos)
```dotnetcli
MSBUILDDEBUGONSTART=2 ~/<some maui checkout>/dotnet-local.sh build -m:1
```
### [Linux](#tab/linux)
```dotnetcli
MSBUILDDEBUGONSTART=2 ~/<some maui checkout>/dotnet-local.sh build -m:1
```
### [Windows](#tab/windows)
```dotnetcli
set MSBUILDDEBUGONSTART=2
~/<some maui checkout>/dotnet-local.cmd build -m:1
```
---
Note: the `-m:1` is important as it restricts MSBuild to 1 node.
Once MSBuild starts it will print the following
```dotnetcli
Waiting for debugger to attach (dotnet PID xxxx). Press enter to continue...
```
You need to copy the PID value so we can use this in the IDE. For Visual Studio you can use the `Attach to Process` menu option, while you have the Microsoft.Maui.sln solution open. For VSCode open the workspace then use the `Attach to Process` Run and Debug option. You will be prompted for the PID and it will then connect.
Once connected go back to your command prompt and press ENTER so that the MSBuild process can continue.
You will be able to set breakpoints in Tasks (but not Targets) and step through code from this point on.
If you want to test in-tree in VSCode the `Build Platform Sample` command will ask you if you want to debug MSBuild tasks and fill in the `MSBUILDDEBUGONSTART` for you. The PID text will appear in the `Terminal` window in VSCode. You can then use the `Attach to Process` Run and Debug option to attach to the process.
## Stats
Expand Down
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ body:
description: In what version do you see this issue? Run `dotnet workload list` to find your version.
options:
-
- 9.0.0-preview.3.10457
- 9.0.0-preview.2.10293
- 9.0.0-preview.1.9973
- 8.0.21 SR4.1
- 8.0.20 SR4
- 8.0.14 SR3.1
- 8.0.10 SR3
- 8.0.7 SR2
- 8.0.6 SR1
Expand Down Expand Up @@ -110,7 +115,12 @@ body:
- 8.0.6 SR1
- 8.0.7 SR2
- 8.0.10 SR3
- 8.0.14 SR3.1
- 8.0.20 SR4
- 8.0.21 SR4.1
- 9.0.0-preview.1.9973
- 9.0.0-preview.2.10293
- 9.0.0-preview.3.10457
validations:
required: true
- type: dropdown
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ updates:
- dependency-name: "Microsoft.DotNet.XHarness*" # maestro
- dependency-name: "Svg.*" # needs to be done manually because it relies on a specific verion of Fizzler
- dependency-name: "Fizzler" # needs to be done manually because it is specific to the Svg.* version
- dependency-name: "ExCSS" # needs to be done manually because it is specific to the Svg.* version
- dependency-name: "SkiaSharp*" # needs to be done manually with maui graphics
- dependency-name: "HarfBuzzSharp*" # needs to be done manually with maui graphics
- dependency-name: "Newtonsoft.Json" # needs to be done manually to match VS
Expand Down
45 changes: 45 additions & 0 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -579,5 +579,50 @@ configuration:
- removeLabel:
label: s/try-latest-version
description: Remove 's/try-latest-version' when new reply from author comes in
- if:
- payloadType: Issues
- isAction:
action: Opened
- or:
- isActivitySender:
user: PureWeen
issueAuthor: False
- isActivitySender:
user: mattleibow
issueAuthor: False
- isActivitySender:
user: rmarinho
issueAuthor: False
- isActivitySender:
user: jsuarezruiz
issueAuthor: False
- isActivitySender:
user: Redth
issueAuthor: False
- isActivitySender:
user: StephaneDelcroix
issueAuthor: False
- isActivitySender:
user: samhouts
issueAuthor: False
- isActivitySender:
user: jamesmontemagno
issueAuthor: False
- isActivitySender:
user: jonathanpeppers
issueAuthor: False
- isActivitySender:
user: rachelkang
issueAuthor: False
- isActivitySender:
user: Eilon
issueAuthor: False
- isActivitySender:
user: jfversluis
issueAuthor: False
then:
- addLabel:
label: s/triaged
description: Add 's/triaged' label to issues opened by the (core) team, we assume these issues do not need triaging
onFailure:
onSuccess:
3 changes: 2 additions & 1 deletion .github/workflows/locker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ permissions:
jobs:
main:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'dotnet' }}
steps:
- name: Checkout Actions
uses: actions/checkout@v4
with:
repository: "microsoft/vscode-github-triage-actions"
path: ./actions
ref: cd16cd2aad6ba2da74bb6c6f7293adddd579a90e # locker action commit sha
ref: 066bee9cefa6f0b4bf306040ff36fc7d96a6d56d # locker action commit sha
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run Locker
Expand Down
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET MAUI",
"type": "maui",
"request": "launch",
"preLaunchTask": "maui: Build"
},
{
"name": "Attach to Process",
"type": "coreclr",
"request": "attach",
"processId": "${input:processid}"
}
],
"inputs": [
{
"id": "processid",
"type": "promptString",
"default": "0",
"description": "Enter dotnet build process id reported when setting the env var MSBUILDDEBUGONSTART=2",
}
]
}
12 changes: 11 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"label": "Build Platform Sample",
"type": "shell",
"command": "./bin/dotnet/dotnet build ${input:project} -c ${input:configuration}",
"command": "${input:debugbuildtasks} ./bin/dotnet/dotnet build ${input:project} -c ${input:configuration}",
"group": {
"kind": "build",
"isDefault": true
Expand Down Expand Up @@ -60,6 +60,16 @@
"net7.0-ios",
]
},
{
"id": "debugbuildtasks",
"type": "pickString",
"default": "",
"description": "Debug Build Tasks?",
"options": [
"",
"MSBUILDDEBUGONSTART=2"
]
},
{
"id": "attach",
"type": "pickString",
Expand Down
2 changes: 1 addition & 1 deletion GitInfo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.20-ci.net8
8.0.40-ci.net8
27 changes: 24 additions & 3 deletions Microsoft.Maui.sln
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Xaml.UnitTests.Int
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Controls.Sample.UITests", "src\Controls\samples\Controls.Sample.UITests\Controls.Sample.UITests.csproj", "{F39F75DC-671B-4649-8005-1929797B3217}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UITest.Core", "src\TestUtils\src\UITest.Core\UITest.Core.csproj", "{352C2381-1DEC-4487-819D-340D1EA98FBE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Core", "src\TestUtils\src\UITest.Core\UITest.Core.csproj", "{352C2381-1DEC-4487-819D-340D1EA98FBE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UITest.Appium", "src\TestUtils\src\UITest.Appium\UITest.Appium.csproj", "{8C8CD467-11F9-4A14-8AF3-047B2CFD19A7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.Appium", "src\TestUtils\src\UITest.Appium\UITest.Appium.csproj", "{8C8CD467-11F9-4A14-8AF3-047B2CFD19A7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UITest.NUnit", "src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj", "{8050448A-E08F-4972-9B47-16042A5DFE82}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITest.NUnit", "src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj", "{8050448A-E08F-4972-9B47-16042A5DFE82}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlGallery.Android.Appium.UITests", "src\Compatibility\ControlGallery\test\Android.Appium.UITests\ControlGallery.Android.Appium.UITests.csproj", "{F748974F-A8E4-4659-801C-804B739D6326}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlGallery.iOS.Appium.UITests", "src\Compatibility\ControlGallery\test\iOS.Appium.UITests\ControlGallery.iOS.Appium.UITests.csproj", "{5923B35B-EA24-4B86-A384-9DAF9F2AFD56}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlGallery.Shared.Appium.UITests", "src\Compatibility\ControlGallery\test\Shared.Appium.UITests\ControlGallery.Shared.Appium.UITests.csproj", "{07D8D4B5-C89D-4BE3-A14A-17668358587C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -644,6 +650,18 @@ Global
{8050448A-E08F-4972-9B47-16042A5DFE82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8050448A-E08F-4972-9B47-16042A5DFE82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8050448A-E08F-4972-9B47-16042A5DFE82}.Release|Any CPU.Build.0 = Release|Any CPU
{F748974F-A8E4-4659-801C-804B739D6326}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F748974F-A8E4-4659-801C-804B739D6326}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F748974F-A8E4-4659-801C-804B739D6326}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F748974F-A8E4-4659-801C-804B739D6326}.Release|Any CPU.Build.0 = Release|Any CPU
{5923B35B-EA24-4B86-A384-9DAF9F2AFD56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5923B35B-EA24-4B86-A384-9DAF9F2AFD56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5923B35B-EA24-4B86-A384-9DAF9F2AFD56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5923B35B-EA24-4B86-A384-9DAF9F2AFD56}.Release|Any CPU.Build.0 = Release|Any CPU
{07D8D4B5-C89D-4BE3-A14A-17668358587C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07D8D4B5-C89D-4BE3-A14A-17668358587C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07D8D4B5-C89D-4BE3-A14A-17668358587C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07D8D4B5-C89D-4BE3-A14A-17668358587C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -762,6 +780,9 @@ Global
{352C2381-1DEC-4487-819D-340D1EA98FBE} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{8C8CD467-11F9-4A14-8AF3-047B2CFD19A7} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{8050448A-E08F-4972-9B47-16042A5DFE82} = {7AC28763-9C68-4BF9-A1BA-25CBFFD2D15C}
{F748974F-A8E4-4659-801C-804B739D6326} = {DDBA9144-36FC-429E-99E1-2A64825434C1}
{5923B35B-EA24-4B86-A384-9DAF9F2AFD56} = {DDBA9144-36FC-429E-99E1-2A64825434C1}
{07D8D4B5-C89D-4BE3-A14A-17668358587C} = {DDBA9144-36FC-429E-99E1-2A64825434C1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B8ABEAD-D2B5-4370-A187-62B5ABE4EE50}
Expand Down
11 changes: 1 addition & 10 deletions docs/design/UITesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ Then in the Controls.AppiumTests project add a new class that derives from `_Iss

You can use the example for the sample project [here](https://github.com/dotnet/maui/blob/main/src/Controls/samples/Controls.Sample.UITests/Issues/RefreshViewPage.cs) and the example for the corresponding test [here](https://github.com/dotnet/maui/tree/main/src/Controls/tests/UITests/Tests/Issues/RefreshViewTests.cs).




### Adding a GalleryPage

Gallery tests are to make it easier to run the same set of tests on controls, if you are creating a new control you would want to add a new gallery page.
Expand Down Expand Up @@ -81,13 +78,7 @@ Assert.IsTrue(text.StartsWith("Logging in", StringComparison.CurrentCulture));
```

## Running tests

Please see the [wiki](https://github.com/dotnet/maui/wiki/UITests) for setting up/running tests.


## Adding new functionality

We are implementing the IApp interface from Xamarin UITests, the implementation of which is [here](https://github.com/dotnet/maui/blob/main/src/TestUtils/src/TestUtils.Appium.UITests/AppiumUITestApp.cs).

## Known Issues
- iOS doesn't support nested accessibility elements which will make some elements unreachable
- iOS doesn't support nested accessibility elements which will make some elements unreachable
4 changes: 4 additions & 0 deletions eng/NuGetVersions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@
Update="Fizzler"
Version="$(FizzlerPackageVersion)"
/>
<PackageReference
Update="ExCSS"
Version="$(ExCSSPackageVersion)"
/>
<PackageReference
Update="MemoryAnalyzers"
Version="0.1.0-beta.5"
Expand Down
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.24168.2">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.24208.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>006ea312a94e8b7f5b7ae47a6470f733ddd1738a</Sha>
<Sha>50b43ece7daf9f8a88ac16a95a4f8647a4c71c4b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24168.2">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24208.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>006ea312a94e8b7f5b7ae47a6470f733ddd1738a</Sha>
<Sha>50b43ece7daf9f8a88ac16a95a4f8647a4c71c4b</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.24168.2">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.24208.1">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>006ea312a94e8b7f5b7ae47a6470f733ddd1738a</Sha>
<Sha>50b43ece7daf9f8a88ac16a95a4f8647a4c71c4b</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
Loading

0 comments on commit 8f77a66

Please sign in to comment.