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>
34 lines
1.2 KiB
Bash
Executable File
34 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Запускает desktop-приложение.
|
|
#
|
|
# По умолчанию Debug: быстрее собирается и даёт осмысленные стеки. Инспектора в Avalonia 12
|
|
# из коробки нет — см. README.
|
|
#
|
|
# ./run.sh Debug
|
|
# ./run.sh -c Release --no-build запустить уже собранное
|
|
# ./run.sh -- --какой-то-аргумент передать аргументы приложению
|
|
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
CONFIGURATION=Debug
|
|
NO_BUILD=0
|
|
APP_ARGS=()
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
-c|--configuration) CONFIGURATION="$2"; shift 2 ;;
|
|
--no-build) NO_BUILD=1; shift ;;
|
|
-h|--help) sed -n '2,9p' "$0"; exit 0 ;;
|
|
--) shift; APP_ARGS=("$@"); break ;;
|
|
*) echo "Неизвестный аргумент: $1 (аргументы приложения — после --)" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
ARGS=(run --project src/AvParser.Desktop -c "$CONFIGURATION")
|
|
[ "$NO_BUILD" -eq 1 ] && ARGS+=(--no-build)
|
|
[ ${#APP_ARGS[@]} -gt 0 ] && ARGS+=(-- "${APP_ARGS[@]}")
|
|
|
|
printf '\033[36m==> dotnet %s\033[0m\n' "${ARGS[*]}"
|
|
exec dotnet "${ARGS[@]}"
|