Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use slngen and remove UWP target from WinUI packages #350

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
22348f7
Potential Fix for #262 - Remove UWP target from WinUI packages
michael-hawker Jan 9, 2023
53dce7e
Setup way to control which test projects are added to the generated s…
michael-hawker Jan 10, 2023
c57b66c
Remove nested project link in sln file
michael-hawker Jan 10, 2023
920c5fe
Initial setup and test of using slngen tool for GenerateAllSolution.p…
michael-hawker Jan 17, 2023
b1ced95
Move Solution PowerShell script to common folder
michael-hawker Jan 17, 2023
9a9131e
Add more configuration options to slngen to clean-up display in VS
michael-hawker Jan 17, 2023
8d996a2
Restore tools required for slngen for linux build
michael-hawker Jan 18, 2023
49406e5
Add helper to bat file for GenerateAllSolution to pass parameter to P…
michael-hawker Jan 18, 2023
31e0c21
Add parameters for slngen for Shared Project Type and General Solutio…
michael-hawker Jan 18, 2023
2cea6b8
Add support for solution generation to filter out UWP/WinAppSDK for a…
michael-hawker Jan 18, 2023
dc9b21b
Push update to slngen for Shared Project support
michael-hawker Jan 26, 2023
013e5e5
Update global.json to see if that resolves issue on Linux build
michael-hawker Jan 27, 2023
42f3354
Remove old comment from previous GenerateAllSolution script
michael-hawker Jan 27, 2023
4601457
Update slngen for ARM64 build support
michael-hawker Jan 30, 2023
d4899ca
Remove now unused solution template from previous solution
michael-hawker Feb 1, 2023
a47d170
Add extra verboisty parameter to slngen script and add to run in CI a…
michael-hawker Feb 2, 2023
506e815
Add `dotnet` command diagnostic flag
michael-hawker Feb 2, 2023
1c581de
Turn off diagnostics for Solution Generation, leave hint at uploading…
michael-hawker Feb 3, 2023
1aa2235
Add workaround/fix for running slngen with dotnet command using tool run
michael-hawker Feb 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
"commands": [
"xstyler"
]
},
"microsoft.visualstudio.slngen.tool": {
"version": "9.5.1",
"commands": [
"slngen"
]
}
}
}
51 changes: 36 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
matrix:
platform: [WinUI2, WinUI3]

env:
# faux-ternary expression to select which platforms to build for each platform vs. duplicating step below.
TARGET_PLATFORMS: ${{ matrix.platform != 'WinUI3' && 'all' || 'all-uwp' }}
TEST_PLATFORM: ${{ matrix.platform != 'WinUI3' && 'UWP' || 'WinAppSdk' }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install .NET 6 SDK
Expand All @@ -72,12 +77,13 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/[email protected]

- name: Enable all TargetFrameworks
- name: Enable ${{ env.TARGET_PLATFORMS }} TargetFrameworks
working-directory: ./common/Scripts/
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 all" -ErrorAction Stop
run: powershell -version 5.1 -command "./UseTargetFrameworks.ps1 ${{ env.TARGET_PLATFORMS }}" -ErrorAction Stop

- name: Generate solution
run: powershell -version 5.1 -command "./GenerateAllSolution.ps1" -ErrorAction Stop
- name: Generate solution w/ ${{ env.TEST_PLATFORM }} Tests
working-directory: ./
run: powershell -version 5.1 -command "./common/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }}" -ErrorAction Stop

- name: Enable Uno.WinUI (in WinUI3 matrix only)
working-directory: ./common/Scripts/
Expand All @@ -94,11 +100,11 @@ jobs:

# Push Packages to our DevOps Artifacts Feed
- name: Add source
if: ${{github.ref == 'refs/heads/main'}}
if: ${{ github.ref == 'refs/heads/main' }}
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 }}

- name: Push packages
if: ${{github.ref == 'refs/heads/main'}}
if: ${{ github.ref == 'refs/heads/main' }}
run: dotnet nuget push "**/*.nupkg" --api-key dummy --source LabsFeed --skip-duplicate

# Run tests
Expand All @@ -114,18 +120,21 @@ jobs:
id: test-generator
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
id: test-uwp
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.UWP.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=UWP.trx"

- name: Run experiment tests against WinAppSDK
id: test-winappsdk
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.WinAppSdk.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=WinAppSdk.trx"
- name: Run experiment tests against ${{ env.TEST_PLATFORM }}
id: test-platform
run: vstest.console.exe ./tests/**/CommunityToolkit.Labs.Tests.${{ env.TEST_PLATFORM }}.build.appxrecipe /Framework:FrameworkUap10 /logger:"trx;LogFileName=${{ env.TEST_PLATFORM }}.trx"

- name: Create test reports
run: |
testspace '[${{ matrix.platform }}]./TestResults/*.trx'
if: ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-uwp.conclusion == 'success' || steps.test-winappsdk.conclusion == 'success') }}
if: ${{ always() && (steps.test-generator.conclusion == 'success' || steps.test-platform.conclusion == 'success') }}

#- name: Artifact - Slngen Logs
# uses: actions/upload-artifact@v3
# if: success() || failure()
# with:
# name: slngen-logs
# path: ./**/slngen.*log

# Test job to build a single experiment to ensure our changes work for both our main types of solutions at the moment
new-experiment:
Expand Down Expand Up @@ -199,9 +208,14 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3

# Restore Tools from Manifest list in the Repository
- name: Restore dotnet tools
run: dotnet tool restore

- name: Generate solution
shell: pwsh
run: ./GenerateAllSolution.ps1
working-directory: ./
run: ./common/GenerateAllSolution.ps1

- name: Install ninja for WASM native dependencies
run: sudo apt-get install ninja-build
Expand All @@ -213,3 +227,10 @@ jobs:
run: dotnet build /r /bl /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false

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

#- name: Artifact - Slngen Logs
# uses: actions/upload-artifact@v3
# if: success() || failure()
# with:
# name: slngen-logs
# path: ./**/slngen.*log
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"label": "generateAllSolution",
"type": "shell",
"command": "pwsh ./GenerateAllSolution.ps1",
"command": "pwsh ./common/GenerateAllSolution.ps1",
"group": "build"
}
]
Expand Down
7 changes: 7 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@
<None Include="$(RepositoryDirectory)ThirdPartyNotices.txt" Pack="true" PackagePath="\" />
</ItemGroup>-->

<ItemGroup>
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory).editorconfig" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)settings.xamlstyler" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)*.md" />
<SlnGenSolutionItem Include="$(MSBuildThisFileDirectory)common\GlobalUsings*.cs" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions GenerateAllSolution.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@ECHO OFF
SET "IncludeHeads=%1"
IF "%IncludeHeads%"=="" SET "IncludeHeads=all"

powershell .\common\GenerateAllSolution.ps1 -IncludeHeads %IncludeHeads%
249 changes: 0 additions & 249 deletions GenerateAllSolution.ps1

This file was deleted.

Loading