-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8aede13
commit c7d7070
Showing
3 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Set-PSDebug -Trace 1 | ||
|
||
$ErrorActionPreference = 'Stop' | ||
|
||
function Assert-ExitCodeIsZero() | ||
{ | ||
if ($LASTEXITCODE -ne 0) | ||
{ | ||
throw "Exit code must be zero." | ||
} | ||
} | ||
|
||
function Get-TemplateConfiguration( | ||
[bool]$android = $false, | ||
[bool]$iOS = $false, | ||
[bool]$macOS = $false, | ||
[bool]$wasm = $false, | ||
[bool]$skiaGtk = $false, | ||
[bool]$skiaWpf = $false, | ||
[bool]$skiaLinuxFB = $false, | ||
[bool]$wasmVsCode = $false) | ||
{ | ||
$androidFlag = '-android' | ||
$iOSFlag = '-ios' | ||
$macOSFlag = '-macos' | ||
$wasmFlag = '-wasm' | ||
$wasmVsCodeFlag = '--vscode' | ||
$skiaWpfFlag = '--skia-wpf' | ||
$skiaGtkFlag = '--skia-gtk' | ||
$skiaLinuxFBFlag = '--skia-linux-fb' | ||
|
||
$a = If ($android) { $androidFlag } Else { $androidFlag + '=false' } | ||
$b = If ($iOS) { $iOSFlag } Else { $iOSFlag + '=false' } | ||
$c = If ($macOS) { $macOSFlag } Else { $macOSFlag + '=false' } | ||
$d = If ($wasm) { $wasmFlag } Else { $wasmFlag + '=false' } | ||
$e = If ($wasmVsCode) { $wasmVsCodeFlag } Else { $wasmVsCodeFlag + '=false' } | ||
$f = If ($skiaWpf) { $skiaWpfFlag } Else { $skiaWpfFlag + '=false' } | ||
$g = If ($skiaGtk) { $skiaGtkFlag } Else { $skiaGtkFlag + '=false' } | ||
$h = If ($skiaLinuxFB) { $skiaLinuxFB } Else { $skiaLinuxFBFlag + '=false' } | ||
|
||
@($a, $b, $c, $d, $e, $f, $g, $h) | ||
} | ||
|
||
$default = @('-v', 'detailed', "-p:RestoreConfigFile=$env:NUGET_CI_CONFIG") | ||
|
||
$debug = $default + '-c' + 'Debug' | ||
$release = $default + '-c' + 'Release' | ||
|
||
# WinUI | ||
dotnet new unoapp -n UnoAppWinUI -Framework net7.0 (Get-TemplateConfiguration -wasm 1 -wasmVsCode 1 -skiaGtk 1 -skiaLinuxFB 1) | ||
|
||
dotnet build $debug UnoAppWinUI/UnoAppWinUI.Wasm/UnoAppWinUI.Wasm.csproj | ||
Assert-ExitCodeIsZero | ||
|
||
dotnet build $release UnoAppWinUI/UnoAppWinUI.Wasm/UnoAppWinUI.Wasm.csproj | ||
Assert-ExitCodeIsZero | ||
|
||
dotnet build $debug UnoAppWinUI/UnoAppWinUI.Skia.Gtk/UnoAppWinUI.Skia.Gtk.csproj | ||
Assert-ExitCodeIsZero | ||
|
||
dotnet build $release UnoAppWinUI/UnoAppWinUI.Skia.Gtk/UnoAppWinUI.Skia.Gtk.csproj | ||
Assert-ExitCodeIsZero | ||
|
||
dotnet build $debug UnoAppWinUI/UnoAppWinUI.Skia.Linux.FrameBuffer/UnoAppWinUI.Skia.Linux.FrameBuffer.csproj | ||
Assert-ExitCodeIsZero | ||
|
||
dotnet build $release UnoAppWinUI/UnoAppWinUI.Skia.Linux.FrameBuffer/UnoAppWinUI.Skia.Linux.FrameBuffer.csproj | ||
Assert-ExitCodeIsZero |