This commit is contained in:
Your Name
2026-08-11 09:12:51 +08:00
parent c3ceb0dd0f
commit cfe4c82c90
111 changed files with 26110 additions and 826 deletions
+18
View File
@@ -7,6 +7,7 @@ $ErrorActionPreference = "Stop"
$ProjectRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
$BuildScript = Join-Path $PSScriptRoot "build_windows.ps1"
$BuildEnvironment = Join-Path $ProjectRoot ".venv-build"
$ProjectUvCache = Join-Path $ProjectRoot ".uv-cache"
$BuildPython = Join-Path $BuildEnvironment "Scripts\python.exe"
$FallbackPython = Join-Path $ProjectRoot ".venv\Scripts\python.exe"
$CompanionRoot = Join-Path $ProjectRoot "video_companion"
@@ -17,6 +18,7 @@ $DistributionRoot = Join-Path $ProjectRoot "dist"
$ReleaseLauncherTemplate = Join-Path $ProjectRoot "packaging\windows\start_release.bat"
$ReleaseLauncher = Join-Path $DistributionRoot "Start_DoctorWorkstation.bat"
$ProjectMetadata = Join-Path $ProjectRoot "pyproject.toml"
$MediaSmokeHook = Join-Path $ProjectRoot "packaging\runtime_media_smoke.py"
function Test-BuildPython {
param([Parameter(Mandatory = $true)][string]$Candidate)
@@ -48,6 +50,7 @@ try {
$PackageLock,
(Join-Path $ProjectRoot "uv.lock"),
$ProjectMetadata,
$MediaSmokeHook,
$ReleaseLauncherTemplate
)) {
if (-not (Test-Path -LiteralPath $RequiredFile -PathType Leaf)) {
@@ -83,11 +86,21 @@ try {
"UV_PROJECT_ENVIRONMENT",
"Process"
)
$PreviousUvCache = [Environment]::GetEnvironmentVariable(
"UV_CACHE_DIR",
"Process"
)
New-Item -ItemType Directory -Path $ProjectUvCache -Force | Out-Null
[Environment]::SetEnvironmentVariable(
"UV_PROJECT_ENVIRONMENT",
$BuildEnvironment,
"Process"
)
[Environment]::SetEnvironmentVariable(
"UV_CACHE_DIR",
$ProjectUvCache,
"Process"
)
Push-Location $ProjectRoot
try {
& $Uv sync --frozen --extra build
@@ -102,6 +115,11 @@ try {
$PreviousProjectEnvironment,
"Process"
)
[Environment]::SetEnvironmentVariable(
"UV_CACHE_DIR",
$PreviousUvCache,
"Process"
)
}
}
elseif (Test-BuildPython -Candidate $BuildPython) {