Skip to content

Commit

Permalink
Add extra verboisty parameter to slngen script and add to run in CI a…
Browse files Browse the repository at this point in the history
…s artifacts
  • Loading branch information
michael-hawker committed Feb 2, 2023
1 parent d4899ca commit 76110fa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

- 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
run: powershell -version 5.1 -command "./common/GenerateAllSolution.ps1 -IncludeHeads ${{ env.TEST_PLATFORM }} -UseDiagnostics" -ErrorAction Stop

- name: Enable Uno.WinUI (in WinUI3 matrix only)
working-directory: ./common/Scripts/
Expand Down Expand Up @@ -129,6 +129,13 @@ jobs:
testspace '[${{ matrix.platform }}]./TestResults/*.trx'
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:
needs: [Xaml-Style-Check]
Expand Down Expand Up @@ -208,7 +215,7 @@ jobs:
- name: Generate solution
shell: pwsh
working-directory: ./
run: ./common/GenerateAllSolution.ps1
run: ./common/GenerateAllSolution.ps1 -UseDiagnostics

- name: Install ninja for WASM native dependencies
run: sudo apt-get install ninja-build
Expand All @@ -220,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
18 changes: 16 additions & 2 deletions common/GenerateAllSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
List of TFM based projects to include. This can be 'all', 'uwp', or 'winappsdk'.
Defaults to 'all' for local-use.
.PARAMETER UseDiagnostics
Add extra diagnostic output to running slngen, such as a binlog, etc...
.EXAMPLE
C:\PS> .\GenerateAllSolution -IncludeHeads winappsdk
Build a solution that doesn't contain UWP projects.
Expand All @@ -20,7 +22,10 @@
Param (
[Parameter(HelpMessage = "The heads to include for building platform samples and tests.", ParameterSetName = "IncludeHeads")]
[ValidateSet('all', 'uwp', 'winappsdk')]
[string]$IncludeHeads = 'all'
[string]$IncludeHeads = 'all',

[Parameter(HelpMessage = "Add extra diagnostic output to slngen generator.")]
[switch]$UseDiagnostics = $false
)

# Generate required props for "All" solution.
Expand Down Expand Up @@ -77,7 +82,16 @@ if ($IncludeHeads -ne 'uwp')
[void]$projects.Add(".\labs\**\samples\*.Samples\*.Samples.csproj")
[void]$projects.Add(".\labs\**\tests\*.Tests\*.shproj")

$cmd = "dotnet slngen -o $generatedSolutionFilePath $slngenConfig --platform $platforms $($projects -Join ' ')"
if ($UseDiagnostics.IsPresent)
{
$diagnostics = "-bl:slngen.binlog --consoleloggerparameters:ShowEventId;Summary;Verbosity=Detailed -fileLoggerParameters:LogFile=slngen.log;Append;Verbosity=Diagnostic;Encoding=UTF-8 "
}
else
{
$diagnostics = ""
}

$cmd = "dotnet slngen -o $generatedSolutionFilePath $slngenConfig $diagnostics--platform $platforms $($projects -Join ' ')"

Write-Output "Running Command: $cmd"

Expand Down

0 comments on commit 76110fa

Please sign in to comment.