Skip to content

Commit bd451f7

Browse files
committed
Merge branch 'main' into user/niels9001/more-options
2 parents 0812e69 + bfb745f commit bd451f7

File tree

59 files changed

+773
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+773
-523
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"isRoot": true,
44
"tools": {
55
"uno.check": {
6-
"version": "1.3.1",
6+
"version": "1.10.0",
77
"commands": [
88
"uno-check"
99
]
1010
},
1111
"xamlstyler.console": {
12-
"version": "3.2008.4",
12+
"version": "3.2206.4",
1313
"commands": [
1414
"xstyler"
1515
]
1616
}
1717
}
18-
}
18+
}

.github/workflows/build.yml

Lines changed: 33 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@ jobs:
2424

2525
# Steps represent a sequence of tasks that will be executed as part of the job
2626
steps:
27-
# Needed until XAML Styler updates to .NET 6
28-
- name: Install .NET Core 3.1 SDK
29-
uses: actions/setup-dotnet@v1
27+
- name: Install .NET 6 SDK
28+
uses: actions/setup-dotnet@v3
3029
with:
31-
dotnet-version: '3.1.x'
30+
dotnet-version: '6.0.x'
3231

3332
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3433
- name: Checkout Repository
35-
uses: actions/checkout@v2
34+
uses: actions/checkout@v3
3635

3736
# Restore Tools from Manifest list in the Repository
3837
- name: Restore dotnet tools
@@ -41,95 +40,27 @@ jobs:
4140
- name: Check XAML Styling
4241
run: powershell -version 5.1 -command "./ApplyXamlStyling.ps1 -Passive" -ErrorAction Stop
4342

44-
# This workflow contains a single job called "Build-WinUI-2"
45-
Build-WinUI-2:
43+
# Build both Uno.UI/WinUI2/UWP and Uno.WinUI/WinUI3/WindowsAppSDK versions of our packages using a matrix
44+
build:
4645
needs: [Xaml-Style-Check]
4746
runs-on: windows-latest
4847

49-
# Steps represent a sequence of tasks that will be executed as part of the job
50-
steps:
51-
- name: Install .NET 6 SDK
52-
uses: actions/setup-dotnet@v1
53-
with:
54-
dotnet-version: '6.0.202'
55-
56-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
57-
- name: Checkout Repository
58-
uses: actions/checkout@v2
59-
60-
# Restore Tools from Manifest list in the Repository
61-
- name: Restore dotnet tools
62-
run: dotnet tool restore
63-
64-
- name: Run Uno Check to Install Dependencies
65-
run: dotnet tool run uno-check --ci --fix --non-interactive --skip wsl --skip androidemulator --verbose
66-
67-
- name: Add msbuild to PATH
68-
uses: microsoft/[email protected]
69-
70-
- name: Enable all TargetFrameworks
71-
working-directory: ./common/Scripts/
72-
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 all" -ErrorAction Stop
73-
74-
- name: Generate solution
75-
run: powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
76-
77-
- name: MSBuild
78-
# working-directory: ./
79-
run: msbuild.exe Toolkit.Labs.All.sln /restore -p:Configuration=Release
80-
81-
# Build All Packages
82-
- name: pack experiments
83-
working-directory: ./common/Scripts/
84-
run: ./PackEachExperiment.ps1 all
85-
86-
# Push Packages to our DevOps Artifacts Feed
87-
- name: Add source
88-
if: ${{github.ref == 'refs/heads/main'}}
89-
run: dotnet nuget add source "https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-Labs/nuget/v3/index.json" --name LabsFeed --username dummy --password ${{ secrets.DEVOPS_PACKAGE_PUSH_TOKEN }}
90-
91-
- name: Push packages
92-
if: ${{github.ref == 'refs/heads/main'}}
93-
run: dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate
94-
95-
# Run tests
96-
- name: Setup VSTest Path
97-
uses: darenm/Setup-VSTest@v1
98-
99-
- name: Install Testspace Module
100-
uses: testspace-com/setup-testspace@v1
101-
with:
102-
domain: ${{ github.repository_owner }}
103-
104-
- name: Run SourceGenerators tests
105-
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"
106-
107-
- name: Run experiment tests against UWP
108-
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
109-
110-
- name: Run experiment tests against WinAppSDK
111-
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
112-
113-
- name: Create test reports
114-
run: |
115-
testspace '[WinUI2]./TestResults/*.trx'
116-
if: always()
117-
118-
# This workflow contains a single job called "Build-WinUI-3"
119-
Build-WinUI-3:
120-
needs: [Xaml-Style-Check]
121-
runs-on: windows-latest
48+
# See https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
49+
strategy:
50+
fail-fast: false # prevent one matrix pipeline from being cancelled if one fails, we want them both to run to completion.
51+
matrix:
52+
platform: [WinUI2, WinUI3]
12253

12354
# Steps represent a sequence of tasks that will be executed as part of the job
12455
steps:
12556
- name: Install .NET 6 SDK
126-
uses: actions/setup-dotnet@v1
57+
uses: actions/setup-dotnet@v3
12758
with:
128-
dotnet-version: '6.0.202'
59+
dotnet-version: '6.0.x'
12960

13061
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
13162
- name: Checkout Repository
132-
uses: actions/checkout@v2
63+
uses: actions/checkout@v3
13364

13465
# Restore Tools from Manifest list in the Repository
13566
- name: Restore dotnet tools
@@ -148,12 +79,12 @@ jobs:
14879
- name: Generate solution
14980
run: powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
15081

151-
- name: Enable WinUI 3
82+
- name: Enable Uno.WinUI (in WinUI3 matrix only)
15283
working-directory: ./common/Scripts/
15384
run: powershell -version 5.1 -command "./UseUnoWinUI.ps1 3" -ErrorAction Stop
85+
if: ${{ matrix.platform == 'WinUI3' }}
15486

15587
- name: MSBuild
156-
# working-directory: ./
15788
run: msbuild.exe Toolkit.Labs.All.sln /restore /nowarn:MSB4011 -p:Configuration=Release
15889

15990
# Build All Packages
@@ -180,33 +111,36 @@ jobs:
180111
domain: ${{ github.repository_owner }}
181112

182113
- name: Run SourceGenerators tests
114+
id: test-generator
183115
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"
184116

185117
- name: Run experiment tests against UWP
118+
id: test-uwp
186119
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"
187120

188121
- name: Run experiment tests against WinAppSDK
122+
id: test-winappsdk
189123
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
190124

191125
- name: Create test reports
192126
run: |
193-
testspace '[WinUI3]./TestResults/*.trx'
194-
if: always()
127+
testspace '[${{ matrix.platform }}]./TestResults/*.trx'
128+
if: ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-uwp.conclusion == 'success' || steps.test-winappsdk.conclusion == 'success') }}
195129

196-
# Test/temp job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
197-
experiment:
130+
# Test job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
131+
new-experiment:
198132
needs: [Xaml-Style-Check]
199133
runs-on: windows-latest
200134

201135
steps:
202136
- name: Install .NET 6 SDK
203-
uses: actions/setup-dotnet@v1
137+
uses: actions/setup-dotnet@v3
204138
with:
205-
dotnet-version: '6.0.202'
139+
dotnet-version: '6.0.x'
206140

207141
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
208142
- name: Checkout Repository
209-
uses: actions/checkout@v2
143+
uses: actions/checkout@v3
210144

211145
- name: Add msbuild to PATH
212146
uses: microsoft/[email protected]
@@ -239,29 +173,31 @@ jobs:
239173
domain: ${{ github.repository_owner }}
240174

241175
- name: Run tests in the generated experiment against UWP
176+
id: test-uwp
242177
run: vstest.console.exe ./labs/CiTestExp/**/CiTestExp.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=CiTestExpUWP.trx"
243178

244179
- name: Run tests in the generated experiment against WinAppSDK
180+
id: test-winappsdk
245181
run: vstest.console.exe ./labs/CiTestExp/**/CiTestExp.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=CiTestExpWinAppSdk.trx"
246182

247183
- name: Create test reports
248184
run: |
249185
testspace '[New Experiment]./TestResults/*.trx'
250-
if: always()
186+
if: ${{ always() && (steps.test-uwp.conclusion == 'success' || steps.test-winappsdk.conclusion == 'success') }}
251187

252188
wasm-linux:
253189
needs: [Xaml-Style-Check]
254190
runs-on: ubuntu-latest
255191

256192
steps:
257193
- name: Install .NET 6 SDK
258-
uses: actions/setup-dotnet@v1
194+
uses: actions/setup-dotnet@v3
259195
with:
260-
dotnet-version: '6.0.201'
196+
dotnet-version: '6.0.x'
261197

262198
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
263199
- name: Checkout Repository
264-
uses: actions/checkout@v2
200+
uses: actions/checkout@v3
265201

266202
- name: Generate solution
267203
shell: pwsh
@@ -274,6 +210,6 @@ jobs:
274210
# See launch.json configuration file for analogous command we're emulating here to build LINK: ../../.vscode/launch.json:CommunityToolkit.Labs.Wasm.csproj
275211
- name: dotnet build
276212
working-directory: ./platforms/CommunityToolkit.Labs.Wasm/
277-
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false -p:TargetFrameworks=netstandard2.0 -p:TargetFramework=net5.0
213+
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
278214

279215
# TODO: Do we want to run tests here? Can we do that on linux easily?

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,4 @@ MigrationBackup/
357357

358358
# Community Toolkit Labs generated files
359359
Toolkit.Labs.All.sln
360-
Labs.SampleRefs.props
360+
common/MultiTarget/Generated/**

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"type": "PowerShell",
2828
"request": "launch",
2929
"name": "Discover samples",
30-
"script": "${workspaceFolder}/DiscoverSamples.ps1",
30+
"script": "${workspaceFolder}/common/MultiTarget/GenerateAllProjectReferences.ps1; ${workspaceFolder}/common/GenerateVSCodeLaunchConfig.ps1; ",
3131
"presentation": {
3232
"group": "2",
3333
"order": 2

DiscoverSamples.ps1

Lines changed: 0 additions & 104 deletions
This file was deleted.

GenerateAllSolution.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Param (
44
[string]$UseUnoWinUI = 2
55
)
66

7+
# Generate required props for "All" solution.
8+
& ./common/MultiTarget/GenerateAllProjectReferences.ps1
9+
& ./common/GenerateVSCodeLaunchConfig.ps1
10+
711
# Set WinUI version for Uno projects
812
$originalWorkingDirectory = Get-Location;
913

@@ -243,6 +247,3 @@ $solutionTemplate = $solutionTemplate -replace "(?m)^\s*`r`n", "";
243247
# Save
244248
Set-Content -Path $generatedSolutionFilePath -Value $solutionTemplate;
245249
Write-Output "Solution generated at $generatedSolutionFilePath";
246-
247-
# Run sample discovery
248-
& ./DiscoverSamples.ps1

common/CommunityToolkit.Labs.Shared/Pages/Shell.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
1+
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
22
<Page x:Class="CommunityToolkit.Labs.Shared.Pages.Shell"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

0 commit comments

Comments
 (0)