Files
PCL-ISE/.vscode/build.ps1
T
Coldsmile_7 216b91f784
Build / Build (Debug) (push) Waiting to run
Build / Build (Release) (push) Waiting to run
chore: initialize PCL-ISE 0.1.0
2026-10-21 11:49:36 +08:00

35 lines
1.3 KiB
PowerShell

[CmdletBinding()]
param(
[ValidateSet('Debug', 'Release', 'Snapshot')]
[string]$Configuration = 'Debug'
)
$ErrorActionPreference = 'Stop'
$solution = Join-Path $PSScriptRoot '..\Plain Craft Launcher 2.sln'
$solution = [IO.Path]::GetFullPath($solution)
$msbuild = (Get-Command msbuild.exe -ErrorAction SilentlyContinue).Source
if (-not $msbuild) {
$vswhere = @(
(Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'),
(Join-Path $env:ProgramFiles 'Microsoft Visual Studio\Installer\vswhere.exe')
) | Where-Object { Test-Path $_ } | Select-Object -First 1
if ($vswhere) {
$installationPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
if ($installationPath) {
$candidate = Join-Path $installationPath 'MSBuild\Current\Bin\MSBuild.exe'
if (Test-Path $candidate) { $msbuild = $candidate }
}
}
}
if (-not $msbuild) {
throw 'MSBuild was not found. Install Visual Studio Build Tools with the .NET desktop build tools and .NET Framework 4.8 targeting pack.'
}
Write-Host "MSBuild: $msbuild"
Write-Host "Configuration: $Configuration"
& $msbuild $solution /t:Build "/p:Configuration=$Configuration" "/p:Platform=Any CPU" /m /v:minimal
exit $LASTEXITCODE