Skip to content

Commit

Permalink
Merge branch 'main' into fix-7957
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuarezruiz authored Jul 22, 2022
2 parents e2d6013 + 1c4ed6c commit ebb3485
Show file tree
Hide file tree
Showing 1,368 changed files with 21,318 additions and 6,094 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "1.0.0-prerelease.22305.1",
"version": "1.0.0-prerelease.22369.1",
"commands": [
"xharness"
]
Expand Down
261 changes: 144 additions & 117 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,85 +11,10 @@ In most cases, when you have Visual Studio installed with the .NET workloads che
1. Install the latest .NET 6:
<!--- [Win (x64)](https://aka.ms/dotnet/6.0.2xx/daily/dotnet-sdk-win-x64.exe) -->
- [Install the latest Public Preview of Visual Studio](https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation/)
- [macOS (x64)](https://aka.ms/dotnet/6.0.3xx/daily/dotnet-sdk-osx-x64.pkg)
- [macOS (arm64)](https://aka.ms/dotnet/6.0.3xx/daily/dotnet-sdk-osx-arm64.pkg)
2. Clear your nuget cache:
```
dotnet nuget locals all --clear
```
> NOTE: this is going to contain the "stable" versions of the packages, so you will have to clear the NuGet cache when this feed changes and when .NET ships. The various `darc-pub-dotnet-*` feeds are temporary and are generated on various builds. These feeds my disappear and be replaced with new ones as new builds come out. Make sure to verify that you are on the latest here and clear the nuget cache if it changes.
4. If you're on a Windows development machine, install [SDK 20348](https://go.microsoft.com/fwlink/?linkid=2164145)
5. If you're on a MacOS development machine, install [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-macos)
- [macOS](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
2. If you're on a Windows development machine, install [SDK 20348](https://go.microsoft.com/fwlink/?linkid=2164145)
3. If you're on a MacOS development machine, install [PowerShell](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-on-macos)


### .NET MAUI Workload

> You'll probably need to run these commands with elevated privileges:
Install the .NET MAUI workload using the versions from a particular branch:

#### RC 2 branch

1. First, install .NET SDK 6.0.300

2. Next run the following workload command:

```
dotnet workload install maui `
--from-rollback-file https://aka.ms/dotnet/maui/6.0.300/rc.2.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-572aeedc/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json `
--source https://api.nuget.org/v3/index.json
```

#### main branch

1. First, install .NET SDK 6.0.300

2. Next run the following workload command:

Windows:

```bat
dotnet workload install maui `
--from-rollback-file https://aka.ms/dotnet/maui/main.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json `
--source https://api.nuget.org/v3/index.json
```

MacOS:

```bash
dotnet workload install maui \
--from-rollback-file https://aka.ms/dotnet/maui/main.json \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json \
--source https://api.nuget.org/v3/index.json
```


#### Preview 14 branch

Windows:

```bat
iwr https://aka.ms/dotnet/maui/maui-install.ps1 -OutFile maui-install.ps1;
.\maui-install.ps1 -b 'release/6.0.2xx-preview14' -v '6.0.200-preview'
```

MacOS:

```bash
curl -O -L https://aka.ms/dotnet/maui/maui-install.ps1
sudo pwsh -File ./maui-install.ps1 -b 'release/6.0.2xx-preview14' -v '6.0.200-preview'
```

> NOTE: the branch (`-b 'release/6.0.2xx-preview14'`) and version (`-v 6.0.200-preview`) parameters. The "preview 14" branch currently requires the 6.0.200 SDK band since the manifests are all in that SDK band - this will change in the future
### iOS / MacCatalyst

iOS and MacCatalyst will require Xcode 13.3 Stable. You can get this [here](https://developer.apple.com/download/more/?name=Xcode).
Expand All @@ -98,38 +23,48 @@ iOS and MacCatalyst will require Xcode 13.3 Stable. You can get this [here](http

Android API-31 (Android 12) is now the default in .NET 6.


## Running

### Compile with globally installed `dotnet`
### Compile using a local `bin\dotnet`

This will build and launch Visual Studio using global workloads
This method ensures that the workloads installed by Visual Studio won't get changed. This is usually the best method to use if you want to preserve the global state of your machine. This method will also use the versions that are specific to the branch you are on which is a good way to ensure compatibility.

#### Cake

You can run a `Cake` target to bootstrap .NET 6 in `bin\dotnet` and launch Visual Studio:

```dotnetcli
dotnet tool restore
dotnet cake --target=VS-NET6 --workloads=global
dotnet cake --target=VS
```

### Compile using a local `bin\dotnet`

#### Windows

You can run a `Cake` target to bootstrap .NET 6 in `bin\dotnet` and launch Visual Studio:
#### Testing branch against your project
`--sln=<Path to SLN>`
- This will pack .NET and then open a VS instance using the local pack. This is useful if you want to check to see if the changes in a branch will address your particular issues. Pack only runs the first time so you will need to explicitly add the `--pack` flag if you make changes and need to repack.

```dotnetcli
dotnet tool restore
dotnet cake --target=VS-NET6
dotnet cake --sln="<download_directory>\MauiApp2\MauiApp2.sln" --target=VS
```

You can also run:
#### Pack
`--pack`
- This creates .NET MAUI packs inside the local dotnet install. This lets you use the CLI commands with the local dotnet to create/deploy with any changes that have been made on that branch (including template changes).

```dotnetcli
dotnet tool restore
dotnet cake --target=VS
dotnet cake --target=VS --pack --sln="<download_directory>\MauiApp2\MauiApp2.sln"
```

_NOTES:_
- _If the IDE doesn't show any Android devices try unloading and reloading the `Sample.Droid-net6` project._
Create new .NET MAUI app using your new packs
```dotnetcli
dotnet tool restore
dotnet cake --pack
mkdir MyMauiApp
cd MyMauiApp
..\bin\dotnet\dotnet new maui
..\bin\dotnet\dotnet build -t:Run -f net6.0-android
```

You can also run commands individually:
```dotnetcli
Expand All @@ -138,53 +73,75 @@ dotnet tool restore
# Provision .NET 6 in bin\dotnet
dotnet build src\DotNet\DotNet.csproj
# Builds Maui MSBuild tasks
.\bin\dotnet\dotnet build Microsoft.Maui.BuildTasks.sln
.\bin\dotnet\dotnet build Microsoft.Maui.BuildTasks.slnf
# Builds the rest of Maui
.\bin\dotnet\dotnet build Microsoft.Maui.sln
# (Windows-only) to launch Visual Studio
# Launch Visual Studio
dotnet cake --target=VS
```

To build & run .NET 6 sample apps, you will also need to use `.\bin\dotnet\dotnet` or just `dotnet` if you've
installed the workloads globally: as well as need the `-f` switch to choose the platform:
### Compile with globally installed `dotnet`

- Try this first. This will build using the workloads installed by VS. If you receive a build failure related to workloads we recommend using a [local dotnet build](https://github.com/dotnet/maui/blob/main/.github/DEVELOPMENT.md#compile-using-a-local-bindotnet). If you want to keep on this path, proceed to the next step and then try to run these commands again.

```dotnetcli
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj -t:Run -f net6.0-android
.\bin\dotnet\dotnet build src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj -t:Run -f net6.0-ios
dotnet tool restore
dotnet cake --target=VS --workloads=global
```

#### MacOS
- If you need/want to update your global workloads to the latest workloads.

> 💡 _VS Mac is not yet supported._
> **Warning**
> This will replace what Visual Studio has installed for your workloads so now your entire machine will be using the workloads you have installed here.
```bash
# install local tools required to build (cake, pwsh, etc..)
dotnet tool restore
#### main branch

> You'll probably need to run these commands with elevated privileges.
# build MAUI
dotnet build Microsoft.Maui-mac.slnf
> **Warning**
> This is going to contain the "stable" versions of the packages, so you will have to clear the NuGet cache when this feed changes and when .NET ships. The various `darc-pub-dotnet-*` feeds are temporary and are generated on various builds. These feeds may disappear and be replaced with new ones as new builds come out. Make sure to verify that you are on the latest here and clear the nuget cache if it changes.
> ```
> dotnet nuget locals all --clear
> ```
Windows:
```bat
dotnet workload install maui `
--from-rollback-file https://aka.ms/dotnet/maui/net6.0.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json `
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json `
--source https://api.nuget.org/v3/index.json
```
Try out a "single project", you will need the `-f` switch to choose the platform:
MacOS:

```bash
dotnet build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj -t:Run -f net6.0-ios
dotnet build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj -t:Run -f net6.0-maccatalyst
dotnet build src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj -t:Run -f net6.0-android
dotnet workload install maui \
--from-rollback-file https://aka.ms/dotnet/maui/net6.0.json \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-a21b9a2d/nuget/v3/index.json \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-52e9452f-3/nuget/v3/index.json \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json \
--source https://api.nuget.org/v3/index.json
```

### Blazor Desktop

To build and run Blazor Desktop samples, check out the [Blazor Desktop](https://github.com/dotnet/maui/wiki/Blazor-Desktop) wiki topic.
#### MacOS

### Win UI 3
All of the above cake commands should work fine on `MacOS`.

To build and run WinUI 3 support, please install the additional components mentioned on the [Getting Started](https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation) page and run:
If you aren't using the cake scripts and the `Microsoft.Maui-mac.slnf` isn't working for you try `_omnisharp.sln`

```dotnetcli
dotnet tool restore
dotnet cake --target=VS-WINUI
```
### Additional Cake Commands

#### Clean
`--clean`
- This will do a recursive delete of all your obj/bin folders. This is helpful if for some reason your repository is in a bad state and you don't want to go as scorched earth as `git clean -xdf`

### Blazor Desktop

To build and run Blazor Desktop samples, check out the [Blazor Desktop](https://github.com/dotnet/maui/wiki/Blazor-Desktop) wiki topic.

### Android

Expand Down Expand Up @@ -215,6 +172,76 @@ public static int foo = 2130771968;

5. Restore the commented code in `Directory.Build.targets`.

## What branch should I use?

- net7.0
- I want to use the net7.0 sdk and make changes that will be released with the .NET 7 release of MAUI
- net6.0
- This PR seems like it should go out with a net6.0 service release
- main (start here if you don't know what to use)
- I want to use the net6.0 sdk and make changes that will be released with the .NET 7 release of MAUI

## Repository projects

### Samples
```
├── Controls
│ ├── samples
│ │ ├── Maui.Controls.Sample
│ │ ├── Maui.Controls.Sample.Sandbox
├── Essentials
│ ├── samples
│ │ ├── Essentials.Sample
├── BlazorWebView
│ ├── samples
│ │ ├── BlazorWinFormsApp
│ │ ├── BlazorWpfApp
```

- *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
- *Essentials.Sample*: Full gallery demonstrating the library previously known as essentials. These are all the non UI related MAUI APIs.

### Device Test Projects

These are tests that will run on an actual device

```
├── Controls
│ ├── test
│ │ ├── Controls.DeviceTests
├── Core
│ ├── test
│ │ ├── Core.DeviceTests
├── Essentials
│ ├── test
│ │ ├── Essentials.DeviceTests
├── BlazorWebView
│ ├── test
│ │ ├── MauiBlazorWebView.DeviceTests
```

- *Controls.DeviceTests*: .NET MAUI Controls Visual Runner for running device based xunit tests. This is useful for tests that require XAML features
- *Core.DeviceTests*: .NET MAUI Core Visual Runner for running device based xunit tests. This is for tests that don't require any MAUI Controls based features
- *Essentials.DeviceTests*: Visual Runner running all the .NET MAUI essentials xunit tests.
- *MauiBlazorWebView.DeviceTests*: Visual Runner for BlazorWebView tests.

### Unit Test Projects

These are tests that will not run on a device. This is useful for testing device independent logic.

```
├── Controls
│ ├── test
│ │ ├── Controls.Core.UnitTests
├── Core
│ ├── test
│ │ ├── Core.UnitTests
├── Essentials
│ ├── test
│ │ ├── Essentials.UnitTests
```

## Stats

<img src="https://repobeats.axiom.co/api/embed/f917a77cbbdeee19b87fa1f2f932895d1df18b71.svg" />
25 changes: 14 additions & 11 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,40 @@ body:
id: repro-steps
attributes:
label: Steps to Reproduce
description: Describe all the steps we need to take to show the behavior that you have observed.
description: Describe all the steps we need to take to show the behavior that you have observed. Also, include what you expected to happen and what did actually happen.
placeholder: |
1. Create a File > New .NET MAUI App
2. Add a `Button` like so: `<Button Text="this is a bug" />`
3. Click the added button and observe the bug 🐞
Expected outcome: a bug was added
Actual outcome: a ladybug appeared
validations:
required: true
- type: dropdown
id: version-with-bug
attributes:
label: Version with bug
description: In what version do you see this issue?
description: In what version do you see this issue? Run `dotnet --version` to find your version.
options:
- 6.0 Release Candidate 1 or older
- 6.0 Release Candidate 2
- 6.0 Release Candidate 2 or older
- 6.0 Release Candidate 3
- 6.0 (current)
- 6.0.312
- 6.0.400
- 6.0.408 (current)
- Unknown/Other (please specify)
validations:
required: true
- type: dropdown
id: version-that-worked
attributes:
label: Last version that worked well
description: Is there a version on which this _did_ work? If yes, which one? If no or unknown, please select `Unknown/Other`.
description: Is there a version on which this _did_ work? If yes, which one? If no or unknown, please select `Unknown/Other`. Run `dotnet --version` to find your version.
options:
- Preview 13
- Preview 14
- Release Candidate 1
- Release Candidate 2
- Release Candidate 3 (current)
- 6.0 Release Candidate 2 or older
- 6.0 Release Candidate 3
- 6.0.312
- 6.0.400
- Unknown/Other
validations:
required: true
Expand Down
Loading

0 comments on commit ebb3485

Please sign in to comment.