Skip to content

Commit

Permalink
Merge branch 'main' into dev/macos-actionsheet
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Controls/samples/Controls.Sample.UITests/Test.cs
#	src/Controls/src/Core/Platform/AlertManager/AlertManager.iOS.cs
#	src/Controls/tests/TestCases.Shared.Tests/Tests/Concepts/AlertsGalleryTests.cs
#	src/Controls/tests/TestCases/Concepts/AlertsGalleryPage.cs
#	src/TestUtils/src/UITest.Appium/AppiumCatalystApp.cs
#	src/TestUtils/src/UITest.Appium/HelperExtensions.cs
  • Loading branch information
mattleibow committed Jun 6, 2024
2 parents 3f9596b + 9d71d32 commit 9fa77cd
Show file tree
Hide file tree
Showing 1,843 changed files with 51,935 additions and 14,421 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.24112.1",
"version": "9.0.0-prerelease.24277.1",
"commands": [
"xharness"
]
Expand Down
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
dotnet_sort_system_directives_first = true
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
csharp_prefer_braces = true:error
csharp_prefer_braces = true:suggestion

# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
Expand Down
113 changes: 108 additions & 5 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@ This page contains steps to build and run the .NET MAUI repository from source.
### Mac
- Install VS Code and dependencies
- 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 @@ -59,9 +73,13 @@ Before opening the solution in Visual Studio / VS Code you **MUST** build the bu
*NOTE*: IntelliSense takes a decent amount of time to fully process your solution. It will eventually work through all the necessary tasks. If you are having IntelliSense issues, usually unloading/reloading the `maui.core` and `maui.controls` projects will resolve.
## What branch should I use?
- main
Always use main no matter what you are working on or where you are hoping your change will get applied. We make sure that main always works against the current stable releases of Visual Studio and the .NET MAUI SDK. Even if you are working on features that will only be released with a future version of .NET. `main` is the only relevant branch for current development.
As a general rule:
- [main](https://github.com/dotnet/maui/tree/main)
Use ‘main’ for bug fixes that don’t require API changes. For new features and changes to public APIs, you must use the branch of the next .NET version.
- [net9.0](https://github.com/dotnet/maui/tree/net9.0)
## Repository projects
Expand All @@ -71,7 +89,6 @@ Always use main no matter what you are working on or where you are hoping your c
│ ├── samples
│ │ ├── Maui.Controls.Sample
│ │ ├── Maui.Controls.Sample.Sandbox
│ │ ├── Controls.Sample.UITests
├── Essentials
│ ├── samples
│ │ ├── Essentials.Sample
Expand All @@ -83,11 +100,12 @@ Always use main no matter what you are working on or where you are hoping your c
- *Maui.Controls.Sample*: Full gallery sample with all of the controls and features of .NET MAUI
- *Maui.Controls.Sample.Sandbox*: Empty project useful for testing reproductions or use cases
- *Contols.Sample.UITests*: Sample used for the automated UI tests
- *Essentials.Sample*: Full gallery demonstrating the library previously known as essentials. These are all the non UI related MAUI APIs.
### 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 @@ -112,12 +130,29 @@ 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

```
├── Controls
│ ├── tests
│ │ ├── UITests
│ ├── ├── Controls.TestCases.App
│ │ ├── Controls.TestCases.Shared.Tests
```

- *Controls.TestCases.App*: .NET MAUI Sample used for the automated UI tests
- *Controls.TestCases.Shared.Tests*: .NET MAUI library used to define the UI tests

Each platform has a specific UI tests library project where it is possible to add specific tests per platform.

```
├── Controls
│ ├── tests
│ │ ├── Controls.TestCases.Android.Tests
│ │ ├── Controls.TestCases.iOS.Tests
│ │ ├── Controls.TestCases.Mac.Tests
│ │ ├── Controls.TestCases.WinUI.Tests
```

### Unit Test Projects
Expand All @@ -136,6 +171,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 All @@ -146,6 +196,8 @@ These tests can be ran using the test explorer in VS, or from command line with
dotnet test src/TestUtils/src/Microsoft.Maui.IntegrationTests --logger "console;verbosity=diagnostic" --filter "Name=Build\(%22maui%22,%22net7.0%22,%22Debug%22,False\)"
```
You can find detailed information about testing in the [Wiki](https://github.com/dotnet/maui/wiki/Testing).
### Additional Cake Commands
#### Clean
Expand Down Expand Up @@ -264,6 +316,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
34 changes: 21 additions & 13 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,19 @@ body:
label: Version with bug
description: In what version do you see this issue? Run `dotnet workload list` to find your version.
options:
-
-
- 9.0.0-preview.4.10690
- 9.0.0-preview.3.10457
- 9.0.0-preview.2.10293
- 9.0.0-preview.1.9973
- 8.0.40 SR5
- 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
- 8.0.3 GA
- 7.0.101
- 7.0.100
- 7.0.96
- 7.0.92
- 7.0.86
- 7.0.81
- 7.0.59
- 7.0.58
- 7.0.52
- 7.0.49
- Nightly / CI build (Please specify exact version)
- Unknown/Other
validations:
Expand All @@ -79,7 +78,7 @@ body:
id: version-that-worked
attributes:
label: Last version that worked well
description: If you answered yes, there a version on which this _did_ work, which one? If no or unknown, please select `Unknown/Other`. Run `dotnet workload list` to find your version.
description: If you answered yes, is there a version on which this _did_ work, which one? If no or unknown, please select `Unknown/Other`. Run `dotnet workload list` to find your version.
options:
-
- Unknown/Other
Expand All @@ -106,7 +105,16 @@ body:
- 8.0.0-rc.2.9511
- 8.0.3 GA
- 8.0.6 SR1
- 8.0.7 SR2
- 8.0.7 SR2
- 8.0.10 SR3
- 8.0.14 SR3.1
- 8.0.20 SR4
- 8.0.21 SR4.1
- 8.0.40 SR5
- 9.0.0-preview.1.9973
- 9.0.0-preview.2.10293
- 9.0.0-preview.3.10457
- 9.0.0-preview.4.10690
validations:
required: true
- type: dropdown
Expand Down
3 changes: 2 additions & 1 deletion .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 All @@ -60,4 +61,4 @@ updates:
labels:
- "nuget"
- "dependencies"
- "area/upstream"
- "area-infrastructure"
Loading

0 comments on commit 9fa77cd

Please sign in to comment.