Skip to content

Commit 3099262

Browse files
committed
Update build
1 parent 94de407 commit 3099262

7 files changed

+38
-290
lines changed

build.cmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@echo off
2-
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0scripts\build_demo.ps1""""
2+
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""""
33
@REM powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0scripts\build_extension.ps1""""
4-
exit /b %ErrorLevel%
4+
exit /b %ErrorLevel%

build.ps1

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
$wingetVersion = & winget --version 2>$null
2+
3+
if ($wingetVersion -eq $null) {
4+
Write-Output "winget is not installed. Starting installation..."
5+
6+
Invoke-WebRequest -Uri "https://github.com/microsoft/winget-cli/releases/download/v1.6.3482/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" -OutFile "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
7+
8+
Add-AppxPackage -Path "$env:TEMP\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
9+
10+
Write-Output "winget has been installed."
11+
}
12+
13+
$dotnetVersion = & dotnet --version 2>$null
14+
15+
if ($dotnetVersion -eq $null) {
16+
Write-Output ".NET SDK is not installed."
17+
18+
winget install Microsoft.DotNet.SDK.8
19+
} else {
20+
$majorVersion = $dotnetVersion.Split('.')[0]
21+
22+
if ($majorVersion -ge 8) {
23+
Write-Output ".NET SDK version is $dotnetVersion, which is 8.0.0 or newer."
24+
} else {
25+
Write-Output ".NET SDK version is $dotnetVersion, which is older than 8.0.0."
26+
27+
winget install Microsoft.DotNet.SDK.8
28+
}
29+
}
30+
31+
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
32+
dotnet restore Wpf.Ui.sln /tl
33+
dotnet build src\Wpf.Ui.Gallery\Wpf.Ui.Gallery.csproj --configuration Release --no-restore --verbosity quiet /tl
34+
} else {
35+
Write-Host "Not in the x64 desktop environment."
36+
}

etc/build_demo.ps1

-1
This file was deleted.

etc/build_extension.ps1

-1
This file was deleted.

etc/build_library.ps1

-1
This file was deleted.

etc/dotnet_build.ps1

-127
This file was deleted.

etc/msbuild_build.ps1

-158
This file was deleted.

0 commit comments

Comments
 (0)