Merge branch 'main' into TestPropsFiles

This commit is contained in:
Matt Lacey 2022-04-12 23:02:15 +01:00
Родитель 995b8622b7 d6cd9f8377
Коммит e4bc30cc43
7 изменённых файлов: 136 добавлений и 149 удалений

26
.github/workflows/build.yml поставляемый
Просмотреть файл

@ -52,6 +52,10 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.3
- name: Enable all TargetFrameworks
working-directory: ./common/Scripts/
run: ./UseTargetFrameworks.ps1 all
- name: MSBuild
# working-directory: ./
run: msbuild.exe Toolkit.Labs.All.sln /restore -p:Configuration=Release
@ -69,6 +73,28 @@ jobs:
if: ${{github.ref == 'refs/heads/main'}}
run: dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
# Run tests
- name: Setup VSTest Path
uses: darenm/Setup-VSTest@v1
- name: Run SourceGenerators tests
run: vstest.console.exe ./Common/CommunityToolkit.Labs.Core.SourceGenerators.Tests/CommunityToolkit.Labs.Core.SourceGenerators.Tests/bin/Release/net6.0/CommunityToolkit.Labs.Core.SourceGenerators.Tests.dll /logger:"trx;LogFileName=SourceGenerators.trx"
- name: Run experiment tests against UWP
run: vstest.console.exe ./Tests/**/CommunityToolkit.Labs.UnitTests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
- name: Run experiment tests against WinAppSDK
run: vstest.console.exe ./Tests/**/CommunityToolkit.Labs.UnitTests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
- name: Create test reports
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Test results
path: './TestResults/*.trx'
reporter: dotnet-trx
# Test/temp job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
experiment:
runs-on: windows-latest

2
.gitignore поставляемый
Просмотреть файл

@ -349,4 +349,4 @@ healthchecksdb
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
.ionide/

Просмотреть файл

@ -1,139 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31919.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{24A1D6DC-FF32-4D9D-9FC2-8EB3E356A2C0}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
License.md = License.md
ReadMe.md = ReadMe.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{9898A5F2-6B58-4770-9757-302E93848428}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CommunityToolkit.Labs.Shared", "common\CommunityToolkit.Labs.Shared\CommunityToolkit.Labs.Shared.shproj", "{9503C27C-55A8-4B66-AA7B-14EFDB940B13}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.Wasm", "platforms\CommunityToolkit.Labs.Wasm\CommunityToolkit.Labs.Wasm.csproj", "{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.WinUI.CanvasLayout", "labs\CanvasLayout\src\CommunityToolkit.Labs.WinUI.CanvasLayout.csproj", "{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CanvasLayout.Sample", "labs\CanvasLayout\samples\CanvasLayout.Sample\CanvasLayout.Sample.csproj", "{A14189C0-39A8-4FBE-BF86-A78A94654C48}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{EDD2FCF0-74FE-4AB9-B40A-7B2A4E89D59C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{09003B35-7A35-4BD1-9A26-5CFD02AB88DD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Labs.Core", "common\CommunityToolkit.Labs.Core\CommunityToolkit.Labs.Core.csproj", "{210476D6-42CC-4D01-B027-478145BEA8FE}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
common\CommunityToolkit.Labs.Shared\CommunityToolkit.Labs.Shared.projitems*{9503c27c-55a8-4b66-aa7b-14efdb940b13}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|ARM.ActiveCfg = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|ARM.Build.0 = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|ARM64.Build.0 = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|x64.ActiveCfg = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|x64.Build.0 = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|x86.ActiveCfg = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Debug|x86.Build.0 = Debug|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|Any CPU.Build.0 = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|ARM.ActiveCfg = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|ARM.Build.0 = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|ARM64.ActiveCfg = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|ARM64.Build.0 = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|x64.ActiveCfg = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|x64.Build.0 = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|x86.ActiveCfg = Release|Any CPU
{3EBB8552-CE39-4EDC-9ACB-7B4871582FBB}.Release|x86.Build.0 = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|ARM.Build.0 = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|ARM64.Build.0 = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|x64.ActiveCfg = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|x64.Build.0 = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|x86.ActiveCfg = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Debug|x86.Build.0 = Debug|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|Any CPU.Build.0 = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|ARM.ActiveCfg = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|ARM.Build.0 = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|ARM64.ActiveCfg = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|ARM64.Build.0 = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|x64.ActiveCfg = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|x64.Build.0 = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|x86.ActiveCfg = Release|Any CPU
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5}.Release|x86.Build.0 = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|ARM.Build.0 = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|ARM64.Build.0 = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|x64.ActiveCfg = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|x64.Build.0 = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|x86.ActiveCfg = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Debug|x86.Build.0 = Debug|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|Any CPU.Build.0 = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|ARM.ActiveCfg = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|ARM.Build.0 = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|ARM64.ActiveCfg = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|ARM64.Build.0 = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|x64.ActiveCfg = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|x64.Build.0 = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|x86.ActiveCfg = Release|Any CPU
{A14189C0-39A8-4FBE-BF86-A78A94654C48}.Release|x86.Build.0 = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|ARM.ActiveCfg = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|ARM.Build.0 = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|ARM64.Build.0 = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|x64.ActiveCfg = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|x64.Build.0 = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|x86.ActiveCfg = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Debug|x86.Build.0 = Debug|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|Any CPU.Build.0 = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|ARM.ActiveCfg = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|ARM.Build.0 = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|ARM64.ActiveCfg = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|ARM64.Build.0 = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|x64.ActiveCfg = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|x64.Build.0 = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|x86.ActiveCfg = Release|Any CPU
{210476D6-42CC-4D01-B027-478145BEA8FE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9503C27C-55A8-4B66-AA7B-14EFDB940B13} = {09003B35-7A35-4BD1-9A26-5CFD02AB88DD}
{FE19FFF0-6AB6-4FC7-BFDF-B6499153DCD5} = {EDD2FCF0-74FE-4AB9-B40A-7B2A4E89D59C}
{A14189C0-39A8-4FBE-BF86-A78A94654C48} = {9898A5F2-6B58-4770-9757-302E93848428}
{210476D6-42CC-4D01-B027-478145BEA8FE} = {09003B35-7A35-4BD1-9A26-5CFD02AB88DD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1F0A4823-84EF-41AA-BBF9-A07B38DDC555}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -32,8 +32,7 @@
</PropertyGroup>
<Target Name="ValidateWinUITarget" Condition="'$(IsUno)' == 'true'">
<Error Condition="'$(WinUITarget)' != '2.x' AND '$(WinUITarget)' != '3.x'"
Text="Property 'WinUITarget' contained an invalid value '$(WinUITarget)'. A value of '2.x' or '3.x' is expected when building an Uno target."/>
<Error Condition="'$(WinUITarget)' != '2.x' AND '$(WinUITarget)' != '3.x'" Text="Property 'WinUITarget' contained an invalid value '$(WinUITarget)'. A value of '2.x' or '3.x' is expected when building an Uno target." />
</Target>
<ItemGroup>
@ -43,8 +42,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Condition="'$(IsUno)' == 'True' AND '$(WinUITarget)' == '2.x'" Include="Uno.UI" Version="4.0.11"/>
<PackageReference Condition="'$(IsUno)' == 'True' AND '$(WinUITarget)' == '3.x'" Include="Uno.WinUI" Version="4.0.11"/>
<PackageReference Condition="'$(IsUno)' == 'True' AND '$(WinUITarget)' == '2.x'" Include="Uno.UI" Version="4.0.11" />
<PackageReference Condition="'$(IsUno)' == 'True' AND '$(WinUITarget)' == '3.x'" Include="Uno.WinUI" Version="4.0.11" />
<PackageReference Condition="'$(TargetFramework)' == '$(UwpTargetFramework)'" Include="Microsoft.UI.Xaml" Version="2.7.0" />
<PackageReference Condition="'$(TargetFramework)' == '$(WinAppSdkTargetFramework)'" Include="Microsoft.WindowsAppSDK" Version="1.0.0" />

Просмотреть файл

@ -0,0 +1,17 @@
<Project>
<PropertyGroup>
<UwpTargetFramework>uap10.0.17763</UwpTargetFramework>
<WinAppSdkTargetFramework>net6.0-windows10.0.19041.0</WinAppSdkTargetFramework>
<WasmHeadTargetFramework>net5.0</WasmHeadTargetFramework>
<LinuxHeadTargetFramework>net5.0</LinuxHeadTargetFramework>
<WpfHeadTargetFramework>netcoreapp3.1</WpfHeadTargetFramework>
<WasmLibTargetFramework>netstandard2.0</WasmLibTargetFramework>
<LinuxLibTargetFramework>netstandard2.0</LinuxLibTargetFramework>
<AndroidLibTargetFramework>monoandroid11.0</AndroidLibTargetFramework>
<MacOSLibTargetFramework>xamarinmac20</MacOSLibTargetFramework>
<iOSLibTargetFramework>xamarinios10</iOSLibTargetFramework>
<WpfLibTargetFramework>netstandard2.0</WpfLibTargetFramework>
</PropertyGroup>
</Project>

Просмотреть файл

@ -8,10 +8,10 @@
<WpfHeadTargetFramework>netcoreapp3.1</WpfHeadTargetFramework>
<WasmLibTargetFramework>netstandard2.0</WasmLibTargetFramework>
<LinuxLibTargetFramework>netstandard2.0</LinuxLibTargetFramework>
<AndroidLibTargetFramework>monoandroid11.0</AndroidLibTargetFramework>
<MacOSLibTargetFramework>xamarinmac20</MacOSLibTargetFramework>
<iOSLibTargetFramework>xamarinios10</iOSLibTargetFramework>
<WpfLibTargetFramework>netstandard2.0</WpfLibTargetFramework>
</PropertyGroup>
</Project>
</Project>

Просмотреть файл

@ -0,0 +1,84 @@
Param (
[Parameter(HelpMessage = "The target frameworks to enable.")]
[ValidateSet('all', 'wasm', 'uwp', 'winappsdk', 'wpf', 'gtk', 'macos', 'ios', 'droid')]
[string[]]$targets,
[Parameter(HelpMessage = "Disables suppressing changes to the Labs.TargetFrameworks.props file in git, allowing changes to be committed.")]
[switch]$allowGitChanges = $false
)
if ($allowGitChanges.IsPresent) {
Write-Warning "Changes to the default TargetFrameworks in Labs can now be committed. Run this command again without the --allow-git-changes flag to disable committing further changes.";
git update-index --no-assume-unchanged ../Labs.TargetFrameworks.props
}
else {
git update-index --assume-unchanged ../Labs.TargetFrameworks.props
}
$WasmTfm = "WasmLibTargetFramework";
$UwpTfm = "UwpTargetFramework";
$WinAppSdkTfm = "WinAppSdkTargetFramework";
$WpfTfm = "WpfLibTargetFramework";
$GtkTfm = "LinuxLibTargetFramework";
$macOSTfm = "MacOSLibTargetFramework";
$iOSTfm = "iOSLibTargetFramework";
$DroidTfm = "AndroidLibTargetFramework";
$fileContents = Get-Content -Path ../Labs.TargetFrameworks.All.props
$allTargetFrameworks = @(
$WasmTfm,
$UwpTfm,
$WinAppSdkTfm,
$WpfTfm,
$GtkTfm,
$macOSTfm,
$iOSTfm,
$DroidTfm
);
$desiredTfmValues = @();
if ($targets.Contains("all")) {
$desiredTfmValues = $allTargetFrameworks;
}
if ($targets.Contains("wasm")) {
$desiredTfmValues += $WasmTfm;
}
if ($targets.Contains("uwp")) {
$desiredTfmValues += $UwpTfm;
}
if ($targets.Contains("winappsdk")) {
$desiredTfmValues += $WinAppSdkTfm;
}
if ($targets.Contains("wpf")) {
$desiredTfmValues += $WpfTfm;
}
if ($targets.Contains("gtk")) {
$desiredTfmValues += $GtkTfm;
}
if ($targets.Contains("macos")) {
$desiredTfmValues += $macOSTfm;
}
if ($targets.Contains("ios")) {
$desiredTfmValues += $iOSTfm;
}
if ($targets.Contains("droid")) {
$desiredTfmValues += $DroidTfm;
}
$targetFrameworksToRemove = $allTargetFrameworks.Where({ -not $desiredTfmValues.Contains($_) })
$targetFrameworksToRemoveRegexPartial = $targetFrameworksToRemove -join "|";
$newFileContents = $fileContents -replace "<(?:$targetFrameworksToRemoveRegexPartial)>.+?>", '';
Set-Content -Force -Path ../Labs.TargetFrameworks.props -Value $newFileContents;