Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/net6.0' into fix-4755
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jul 19, 2022
2 parents 0473d16 + 08272e5 commit 1082ac5
Show file tree
Hide file tree
Showing 1,731 changed files with 105,700 additions and 6,136 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.22270.1",
"version": "1.0.0-prerelease.22358.1",
"commands": [
"xharness"
]
Expand Down
79 changes: 78 additions & 1 deletion .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ dotnet tool restore
dotnet cake --target=VS-NET6
```

You can also run:

```dotnetcli
dotnet tool restore
dotnet cake --target=VS
```

_NOTES:_
- _If the IDE doesn't show any Android devices try unloading and reloading the `Sample.Droid-net6` project._

Expand All @@ -135,7 +142,7 @@ dotnet build src\DotNet\DotNet.csproj
# Builds the rest of Maui
.\bin\dotnet\dotnet build Microsoft.Maui.sln
# (Windows-only) to launch Visual Studio
dotnet cake --target=VS-DOGFOOD
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
Expand Down Expand Up @@ -208,6 +215,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" />
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ body:
label: Version with bug
description: In what version do you see this issue?
options:
- Preview 13
- Preview 14
- Release Candidate 1
- Release Candidate 2
- Release Candidate 3 (current)
- 6.0 Release Candidate 1 or older
- 6.0 Release Candidate 2
- 6.0 Release Candidate 3
- 6.0 (current)
- Unknown/Other (please specify)
validations:
required: true
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/dotnet-format-daily.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Daily code format check
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * * # Every day at midnight (UTC)

Expand All @@ -11,22 +12,13 @@ jobs:
dotnet-format:
runs-on: windows-latest
steps:
- name: Install dotnet-format
run: dotnet tool install -g dotnet-format

- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Run dotnet format
id: format
uses: jfversluis/dotnet-format@v1.0.5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
action: "fix"
#only-changed-files: true # only works for PRs
workspace: "Microsoft.Maui.sln"
run: dotnet format whitespace ./src --folder

- name: Commit files
if: steps.format.outputs.has-changes == 'true'
Expand Down
26 changes: 5 additions & 21 deletions .nuspec/Microsoft.Maui.Controls.MultiTargeting.targets
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<Compile Remove="bin\**;obj\**" />
<None Remove="bin\**;obj\**" />
</ItemGroup>

<PropertyGroup>
<!-- Windows -->
<WindowsProjectFolder>Platform\Windows\</WindowsProjectFolder>
Expand All @@ -96,38 +96,22 @@
<DefineConstants>$(DefineConstants);IOS</DefineConstants>
</PropertyGroup>

<!-- Mac Catalyst -->
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsMacCatalyst)' == 'True' ">
<DefineConstants>$(DefineConstants);MACCATALYST;IOS</DefineConstants>
</PropertyGroup>

<!-- Tizen -->
<!-- Tizen -->
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsTizen)' == 'True' ">
<DefineConstants>$(DefineConstants);TIZEN</DefineConstants>
</PropertyGroup>

<!-- If this becomes part of the product we will remove these but for now it's useful having them all in one place -->
<ItemGroup Condition=" '$(_MauiTargetPlatformIsAndroid)' == 'True' ">
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" />
<PackageReference Include="Xamarin.Google.Android.Material" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" />
<PackageReference Include="Xamarin.AndroidX.Navigation.UI" />
<PackageReference Include="Xamarin.AndroidX.Navigation.Fragment" />
<PackageReference Include="Xamarin.AndroidX.Navigation.Runtime" />
<PackageReference Include="Xamarin.AndroidX.Navigation.Common" />
</ItemGroup>
<!-- Windows -->
<PropertyGroup Condition=" '$(_MauiTargetPlatformIsWindows)' == 'True' ">
<DefineConstants>WINDOWS;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<DefineConstants>WINDOWS_UWP;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(_MauiTargetPlatformIsWindows)' == 'True' ">
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Graphics.Win2D" />
<PackageReference Include="Microsoft.Maui.Graphics.Win2D.WinUI.Desktop" />
</ItemGroup>
<ItemGroup Condition=" '$(_MauiTargetPlatformIsTizen)' == 'True' ">
<PackageReference Include="Tizen.UIExtensions.ElmSharp" />
<PackageReference Include="Microsoft.Maui.Graphics.Skia" />
</ItemGroup>

</Project>
7 changes: 4 additions & 3 deletions .nuspec/Microsoft.Maui.Controls.SingleProject.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

<PropertyGroup Condition=" '$(SingleProject)' == 'true' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' ">
<OutputType Condition="'$(OutputType)' == 'Exe'">WinExe</OutputType>
<WindowsPackageType Condition=" '$(WindowsPackageType)' == '' and '$(EnableMsixTooling)' == 'true' and ('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe') ">MSIX</WindowsPackageType>
<WindowsAppSdkBootstrapInitialize Condition=" '$(WindowsAppSdkBootstrapInitialize)' == '' and '$(EnableMsixTooling)' == 'true' and '$(OutputType)' != 'Exe' and '$(OutputType)' != 'WinExe' ">false</WindowsAppSdkBootstrapInitialize>
<WindowsPackageType Condition=" '$(WindowsPackageType)' == '' and '$(EnableMsixTooling)' == 'true' and '$(OutputType)' == 'WinExe' ">MSIX</WindowsPackageType>
<WindowsAppSDKSelfContained Condition=" '$(WindowsAppSDKSelfContained)' == '' and '$(WindowsPackageType)' == 'None' and '$(OutputType)' == 'WinExe' ">true</WindowsAppSDKSelfContained>
<WindowsAppSdkBootstrapInitialize Condition=" '$(WindowsAppSdkBootstrapInitialize)' == '' and '$(EnableMsixTooling)' == 'true' and '$(OutputType)' != 'WinExe' ">false</WindowsAppSdkBootstrapInitialize>
<PublishAppXPackage Condition=" '$(PublishAppXPackage)' == '' and '$(EnableMsixTooling)' == 'true' and '$(WindowsPackageType)' == 'MSIX' ">true</PublishAppXPackage>
<_SingleProjectRIDRequired Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true</_SingleProjectRIDRequired>
<_SingleProjectRIDRequired Condition="'$(OutputType)' == 'WinExe'">true</_SingleProjectRIDRequired>
<_SingleProjectRIDSpecified Condition="'$(RuntimeIdentifier)' != '' or '$(RuntimeIdentifiers)' != ''">true</_SingleProjectRIDSpecified>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions .nuspec/Microsoft.Maui.Controls.SingleProject.targets
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
Condition="'$(WindowsPackageType)' == 'None' and '@(AppxManifest)' != ''">

<ItemGroup>
<_MauiAppxManifest Include="@(AppxManifest)" />
<AppxManifest Remove="@(AppxManifest)" />
</ItemGroup>

Expand Down
81 changes: 72 additions & 9 deletions .nuspec/Microsoft.Maui.Resizetizer.targets
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@

<ResizetizerIncludeSelfProject Condition="'$(ResizetizerIncludeSelfProject)' == ''">False</ResizetizerIncludeSelfProject>

<_ResizetizerDefaultInvalidFilenamesErrorMessage>
One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores: &#13;&#10;
</_ResizetizerDefaultInvalidFilenamesErrorMessage>
<_ResizetizerDefaultInvalidFilenamesErrorMessage>One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores: </_ResizetizerDefaultInvalidFilenamesErrorMessage>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
Expand Down Expand Up @@ -306,7 +304,7 @@

<WriteLinesToFile
File="$(_MauiSplashInputsFile)"
Lines="@(MauiSplashScreen->'File=%(Identity);Color=%(Color)')"
Lines="@(MauiSplashScreen->'File=%(Identity);Link=%(Link);BaseSize=%(BaseSize);Resize=%(Resize);TintColor=%(TintColor);Color=%(Color);ForegroundScale=%(ForegroundScale)')"
Overwrite="true"
WriteOnlyWhenDifferent="true" />

Expand Down Expand Up @@ -636,12 +634,13 @@
on "_ValidatePresenceOfAppxManifestItems" and we need to get in before then. -->
<Target Name="_ValidatePresenceOfAppxManifestItemsBeforeTarget"
BeforeTargets="_ValidatePresenceOfAppxManifestItems"
DependsOnTargets="MauiGeneratePackageAppxManifest" />
DependsOnTargets="MauiGeneratePackageAppxManifest"
Condition="'$(_ResizetizerIsUWPApp)' == 'True' Or '$(_ResizetizerIsWindowsAppSdk)' == 'True'" />

<Target Name="MauiGeneratePackageAppxManifest"
Condition="'$(WindowsPackageType)' != 'None'"
Condition="('$(_ResizetizerIsUWPApp)' == 'True' Or '$(_ResizetizerIsWindowsAppSdk)' == 'True') And ('@(AppxManifest)@(_MauiAppxManifest)' !='')"
DependsOnTargets="$(MauiGeneratePackageAppxManifestDependsOnTargets)"
Inputs="$(MSBuildThisFileFullPath);$(_ResizetizerTaskAssemblyName);$(_ResizetizerInputsFile);$(_MauiSplashInputsFile);@(AppxManifest)"
Inputs="$(MSBuildThisFileFullPath);$(_ResizetizerTaskAssemblyName);$(_ResizetizerInputsFile);$(_MauiSplashInputsFile);@(AppxManifest);@(_MauiAppxManifest)"
Outputs="$(_MauiManifestStampFile);$(_MauiIntermediateManifest)Package.appxmanifest">

<PropertyGroup>
Expand All @@ -651,7 +650,7 @@

<GeneratePackageAppxManifest
IntermediateOutputPath="$(_MauiIntermediateManifest)"
AppxManifest="@(AppxManifest)"
AppxManifest="@(AppxManifest);@(_MauiAppxManifest)"
GeneratedFilename="Package.appxmanifest"
ApplicationId="$(_MauiWindowsApplicationId)"
ApplicationDisplayVersion="$(ApplicationDisplayVersion)"
Expand All @@ -661,16 +660,80 @@
SplashScreen="@(MauiSplashScreen)" />

<!-- replace user manifest -->
<ItemGroup>
<ItemGroup Condition="'@(AppxManifest)' != ''">
<AppxManifest Remove="@(AppxManifest)" />
<AppxManifest Include="$(_MauiIntermediateManifest)Package.appxmanifest" />
</ItemGroup>
<ItemGroup Condition="'@(_MauiAppxManifest)' != ''">
<_MauiAppxManifest Remove="@(_MauiAppxManifest)" />
<_MauiAppxManifest Include="$(_MauiIntermediateManifest)Package.appxmanifest" />
</ItemGroup>

<!-- Stamp file for Outputs -->
<Touch Files="$(_MauiManifestStampFile)" AlwaysCreate="True" />
<ItemGroup>
<FileWrites Include="$(_MauiManifestStampFile)" />
</ItemGroup>

</Target>

<!-- This is required because the "GetAssemblyAttributes" target does not have an open DependsOnTargets. -->
<Target Name="_GetAssemblyAttributesBeforeTarget"
BeforeTargets="GetAssemblyAttributes"
DependsOnTargets="MauiGeneratePackageAppxManifest;_MauiGetAssemblyAttributesFromAppxManifest"
Condition="'$(_ResizetizerIsUWPApp)' == 'True' Or '$(_ResizetizerIsWindowsAppSdk)' == 'True'" />

<Target Name="_MauiGetAssemblyAttributesFromAppxManifest"
Condition="('@(AppxManifest)@(_MauiAppxManifest)' !='')">

<PropertyGroup>
<_MauiAppxManifestContents>$([System.IO.File]::ReadAllText('$(_MauiIntermediateManifest)Package.appxmanifest'))</_MauiAppxManifestContents>
</PropertyGroup>

<XmlPeek
Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/appx/manifest/foundation/windows10'/&gt;"
XmlContent="$(_MauiAppxManifestContents)"
Query="/ns:Package/ns:Identity/@Name">
<Output TaskParameter="Result" ItemName="_MauiAppxManifestIdentity" />
</XmlPeek>
<XmlPeek
Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/appx/manifest/foundation/windows10'/&gt;"
XmlContent="$(_MauiAppxManifestContents)"
Query="/ns:Package/ns:Identity/@Version">
<Output TaskParameter="Result" ItemName="_MauiAppxManifestVersion" />
</XmlPeek>
<XmlPeek
Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/appx/manifest/foundation/windows10'/&gt;"
XmlContent="$(_MauiAppxManifestContents)"
Query="/ns:Package/ns:Properties/ns:PublisherDisplayName/text()">
<Output TaskParameter="Result" ItemName="_MauiAppxManifestPublisher" />
</XmlPeek>
<XmlPeek
Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/appx/manifest/foundation/windows10'/&gt;"
XmlContent="$(_MauiAppxManifestContents)"
Query="/ns:Package/ns:Properties/ns:DisplayName/text()">
<Output TaskParameter="Result" ItemName="_MauiAppxManifestDisplayName" />
</XmlPeek>

<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.PackageName</_Parameter1>
<_Parameter2>@(_MauiAppxManifestIdentity)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.PublisherName</_Parameter1>
<_Parameter2>@(_MauiAppxManifestPublisher)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.Name</_Parameter1>
<_Parameter2>@(_MauiAppxManifestDisplayName)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Microsoft.Maui.ApplicationModel.AppInfo.Version</_Parameter1>
<_Parameter2>@(_MauiAppxManifestVersion)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>

</Target>

<Target Name="_CleanResizetizer">
Expand Down
7 changes: 5 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<Import Project="eng\Versions.props" />

<PropertyGroup>
<_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">6.0</_MauiDotNetVersion>
<_MauiDotNetVersionMajor Condition="'$(_MauiDotNetVersionMajor)' == ''">6</_MauiDotNetVersionMajor>
<_MauiDotNetVersionMinor Condition="'$(_MauiDotNetVersionMinor)' == ''">0</_MauiDotNetVersionMinor>
<_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">$(_MauiDotNetVersionMajor).$(_MauiDotNetVersionMinor)</_MauiDotNetVersion>
<_MauiDotNetTfm Condition="'$(_MauiDotNetTfm)' == ''">net$(_MauiDotNetVersion)</_MauiDotNetTfm>
<_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</_MauiTargetPlatformIdentifier>
<_MauiNoTargetPlatform Condition="'$(_MauiTargetPlatformIdentifier)' == ''">True</_MauiNoTargetPlatform>
Expand All @@ -14,7 +16,7 @@
<_MauiTargetPlatformIsWindows Condition="$(_MauiTargetPlatformIdentifier.Contains('windows')) == 'True'">True</_MauiTargetPlatformIsWindows>
<_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True</_MauiTargetPlatformIsTizen>

<IncludeWindowsTargetFrameworks Condition="($([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full') or ('$(Packing)' == 'true')">true</IncludeWindowsTargetFrameworks>
<IncludeWindowsTargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) or '$(Packing)' == 'true'">true</IncludeWindowsTargetFrameworks>
<IncludeTizenTargetFrameworks Condition="'$(CI)' == 'true' or '$(TF_BUILD)' == 'true' or
Exists('$(DOTNET_ROOT)\sdk-manifests\$(DotNetVersionBand)\samsung.net.sdk.tizen\WorkloadManifest.json') or
Exists('$(ProgramFiles)\dotnet\sdk-manifests\$(DotNetVersionBand)\samsung.net.sdk.tizen\WorkloadManifest.json')">true</IncludeTizenTargetFrameworks>
Expand All @@ -27,6 +29,7 @@
<!-- HACK: WinUI seems to have issues without this -->
<GenerateLibraryLayout>true</GenerateLibraryLayout>
<DisableEmbeddedXbf>false</DisableEmbeddedXbf>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
</PropertyGroup>

<!-- version number information -->
Expand Down
Loading

0 comments on commit 1082ac5

Please sign in to comment.