A wrapper around `dotnet build` earns nothing, so build.ps1/build.sh are the full local gate instead — tool restore, package restore, format check, build, test — in the order that fails cheapest first, with a non-zero exit on failure. run.ps1/run.sh default to Debug and pass extra arguments through to the app. Both flavours ship because the Desktop head targets Windows, Linux and macOS. Writing them immediately paid for itself: the very first run failed restore on Avalonia.Diagnostics 12.1.1, which does not exist — the package stops at 11.3.x because Avalonia 12 moved the inspector into a separate tool with its own installation. The reference had survived because it sat behind Condition="'$(Configuration)' == 'Debug'", and `dotnet restore` evaluates with the default configuration while every build so far had passed -c Release. So `dotnet build -c Release` worked and a bare `dotnet restore` did not. Reference removed rather than replaced: AvaloniaUI.DiagnosticsSupport pulls in a separately installed tool, which is not a dependency to add to a skeleton without asking. README and CLAUDE.md no longer promise F12, and both traps are written down where the next person will hit them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
51 lines
1.3 KiB
PowerShell
51 lines
1.3 KiB
PowerShell
#!/usr/bin/env pwsh
|
|
<#
|
|
.SYNOPSIS
|
|
Запускает desktop-приложение.
|
|
|
|
.DESCRIPTION
|
|
По умолчанию Debug: быстрее собирается и даёт осмысленные стеки. Инспектора в Avalonia 12
|
|
из коробки нет — см. README.
|
|
|
|
.PARAMETER Configuration
|
|
Debug или Release. По умолчанию Debug.
|
|
|
|
.PARAMETER NoBuild
|
|
Не пересобирать — запустить то, что уже собрано.
|
|
|
|
.PARAMETER AppArgs
|
|
Всё остальное уходит в приложение как аргументы командной строки.
|
|
|
|
.EXAMPLE
|
|
./run.ps1
|
|
|
|
.EXAMPLE
|
|
./run.ps1 -Configuration Release -NoBuild
|
|
#>
|
|
[CmdletBinding()]
|
|
param(
|
|
[ValidateSet('Debug', 'Release')]
|
|
[string] $Configuration = 'Debug',
|
|
|
|
[switch] $NoBuild,
|
|
|
|
[Parameter(ValueFromRemainingArguments = $true)]
|
|
[string[]] $AppArgs = @()
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
Set-Location $PSScriptRoot
|
|
|
|
$arguments = @('run', '--project', 'src/AvParser.Desktop', '-c', $Configuration)
|
|
if ($NoBuild) {
|
|
$arguments += '--no-build'
|
|
}
|
|
if ($AppArgs.Count -gt 0) {
|
|
$arguments += '--'
|
|
$arguments += $AppArgs
|
|
}
|
|
|
|
Write-Host "==> dotnet $($arguments -join ' ')" -ForegroundColor Cyan
|
|
& dotnet @arguments
|
|
exit $LASTEXITCODE
|